本文整理汇总了C++中TextStream::release方法的典型用法代码示例。如果您正苦于以下问题:C++ TextStream::release方法的具体用法?C++ TextStream::release怎么用?C++ TextStream::release使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TextStream
的用法示例。
在下文中一共展示了TextStream::release方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: externalRepresentation
static String externalRepresentation(RenderBox* renderer, RenderAsTextBehavior behavior)
{
TextStream ts;
if (!renderer->hasLayer())
return ts.release();
RenderLayer* layer = renderer->layer();
RenderTreeAsText::writeLayers(ts, layer, layer, layer->rect(), 0, behavior);
return ts.release();
}
示例2: layerTreeAsText
String GraphicsLayer::layerTreeAsText(LayerTreeAsTextBehavior behavior) const
{
TextStream ts;
dumpLayer(ts, 0, behavior);
return ts.release();
}
示例3: absoluteBlockHtmlForLink
static String absoluteBlockHtmlForLink(int x, int y, int width, int height, const char* url, const char* children = nullptr)
{
TextStream ts;
ts << "<a style='position: absolute; left: " << x << "px; top: " << y << "px; width: " << width << "px; height: " << height
<< "px' href='" << url << "'>" << (children ? children : url) << "</a>";
return ts.release();
}
示例4: description
CString ViewportConfiguration::description() const
{
TextStream ts;
ts.startGroup();
ts << "viewport-configuration " << (void*)this;
{
TextStream::GroupScope scope(ts);
ts << "viewport arguments";
ts << m_viewportArguments;
}
{
TextStream::GroupScope scope(ts);
ts << "configuration";
ts << m_configuration;
}
{
TextStream::GroupScope scope(ts);
ts << "default configuration";
ts << m_defaultConfiguration;
}
ts.dumpProperty("contentSize", m_contentSize);
ts.dumpProperty("minimumLayoutSize", m_minimumLayoutSize);
ts.dumpProperty("computed initial scale", initialScale());
ts.dumpProperty("computed minimum scale", minimumScale());
ts.dumpProperty("computed layout size", layoutSize());
ts.dumpProperty("ignoring horizontal scaling constraints", shouldIgnoreHorizontalScalingConstraints() ? "true" : "false");
ts.dumpProperty("ignoring vertical scaling constraints", shouldIgnoreVerticalScalingConstraints() ? "true" : "false");
ts.endGroup();
return ts.release().utf8();
}
示例5: scrollingStateTreeAsText
String ScrollingStateNode::scrollingStateTreeAsText() const
{
TextStream ts;
dump(ts, 0);
return ts.release();
}
示例6: printSimpleLineLayoutBlockList
void printSimpleLineLayoutBlockList()
{
HashSet<const RenderBlockFlow*> leafRenderers;
collectNonEmptyLeafRenderBlockFlowsForCurrentPage(leafRenderers);
if (!leafRenderers.size()) {
WTFLogAlways("No text found in this document\n");
return;
}
TextStream stream;
stream << "---------------------------------------------------\n";
for (const auto* flow : leafRenderers) {
auto reason = canUseForWithReason(*flow, FallThrough::Yes);
if (reason == NoReason)
continue;
unsigned printedLength = 30;
stream << "\"";
printTextForSubtree(*flow, printedLength, stream);
for (;printedLength > 0; --printedLength)
stream << " ";
stream << "\"(" << textLengthForSubtree(*flow) << "):";
printReasons(reason, stream);
stream << "\n";
}
stream << "---------------------------------------------------\n";
WTFLogAlways("%s", stream.release().utf8().data());
}
示例7: scrollingStateTreeAsText
String ScrollingStateNode::scrollingStateTreeAsText() const
{
TextStream ts;
dump(ts, 0, ScrollingStateTreeAsTextBehaviorNormal);
return ts.release();
}
示例8: layerTreeAsText
String LayerRendererChromium::layerTreeAsText() const
{
TextStream ts;
if (rootLayer()) {
ts << rootLayer()->layerTreeAsText();
ts << "RenderSurfaces:\n";
dumpRenderSurfaces(ts, 1, rootLayer());
}
return ts.release();
}
示例9: counterValueForElement
String counterValueForElement(Element* element)
{
// Make sure the element is not freed during the layout.
RefPtr<Element> elementRef(element);
element->document()->updateLayout();
TextStream stream;
bool isFirstCounter = true;
// The counter renderers should be children of :before or :after pseudo-elements.
if (RenderObject* before = element->pseudoElementRenderer(BEFORE))
writeCounterValuesFromChildren(stream, before, isFirstCounter);
if (RenderObject* after = element->pseudoElementRenderer(AFTER))
writeCounterValuesFromChildren(stream, after, isFirstCounter);
return stream.release();
}
示例10: description
CString ViewportConfiguration::description() const
{
TextStream ts;
ts << "(viewport-configuration " << (void*)this;
ts << "\n";
ts.increaseIndent();
ts.writeIndent();
ts << "(viewport arguments";
ts << m_viewportArguments;
ts << ")";
ts.decreaseIndent();
ts << "\n";
ts.increaseIndent();
ts.writeIndent();
ts << "(configuration";
ts << m_configuration;
ts << ")";
ts.decreaseIndent();
ts << "\n";
ts.increaseIndent();
ts.writeIndent();
ts << "(default configuration";
ts << m_defaultConfiguration;
ts << ")";
ts.decreaseIndent();
ts.dumpProperty("contentSize", m_contentSize);
ts.dumpProperty("minimumLayoutSize", m_minimumLayoutSize);
ts << "\n";
ts.increaseIndent();
ts.writeIndent();
ts << "(computed initial scale " << initialScale() << ")\n";
ts.writeIndent();
ts << "(computed minimum scale " << minimumScale() << ")\n";
ts.writeIndent();
ts << "(computed layout size " << layoutSize() << ")\n";
ts.writeIndent();
ts << "(ignoring horizontal scaling constraints " << (shouldIgnoreHorizontalScalingConstraints() ? "true" : "false") << ")\n";
ts.writeIndent();
ts << "(ignoring vertical scaling constraints " << (shouldIgnoreVerticalScalingConstraints() ? "true" : "false") << ")";
ts.decreaseIndent();
ts << ")\n";
return ts.release().utf8();
}
示例11: counterValueForElement
String counterValueForElement(Element* element)
{
// Make sure the element is not freed during the layout.
RefPtr<Element> elementRef(element);
element->document()->updateLayout();
TextStream stream;
bool isFirstCounter = true;
// The counter renderers should be children of anonymous children
// (i.e., :before or :after pseudo-elements).
if (RenderObject* renderer = element->renderer()) {
for (RenderObject* child = renderer->firstChild(); child; child = child->nextSibling()) {
if (child->isAnonymous())
writeCounterValuesFromChildren(stream, child, isFirstCounter);
}
}
return stream.release();
}
示例12: externalRepresentation
String externalRepresentation(RenderObject* o)
{
if (!o)
return String();
TextStream ts;
#if ENABLE(SVG)
writeRenderResources(ts, o->document());
#endif
if (o->view()->frameView())
o->view()->frameView()->layout();
RenderLayer* l = o->layer();
if (l) {
writeLayers(ts, l, l, IntRect(l->xPos(), l->yPos(), l->width(), l->height()));
writeSelection(ts, o);
}
return ts.release();
}
示例13: externalRepresentation
String externalRepresentation(Frame* frame, RenderAsTextBehavior behavior)
{
frame->document()->updateLayout();
RenderObject* o = frame->contentRenderer();
if (!o)
return String();
TextStream ts;
#if ENABLE(SVG)
writeRenderResources(ts, o->document());
#endif
if (o->hasLayer()) {
RenderLayer* l = toRenderBox(o)->layer();
writeLayers(ts, l, l, IntRect(l->x(), l->y(), l->width(), l->height()), 0, behavior);
writeSelection(ts, o);
}
return ts.release();
}
示例14: layerTreeAsText
String LocalFrame::layerTreeAsText(LayerTreeFlags flags) const
{
TextStream textStream;
textStream << localLayerTreeAsText(flags);
for (Frame* child = tree().firstChild(); child; child = child->tree().traverseNext(this)) {
if (!child->isLocalFrame())
continue;
String childLayerTree = toLocalFrame(child)->localLayerTreeAsText(flags);
if (!childLayerTree.length())
continue;
textStream << "\n\n--------\nFrame: '";
textStream << child->tree().uniqueName();
textStream << "'\n--------\n";
textStream << childLayerTree;
}
return textStream.release();
}
示例15: printSimpleLineLayoutCoverage
void printSimpleLineLayoutCoverage()
{
HashSet<const RenderBlockFlow*> leafRenderers;
collectNonEmptyLeafRenderBlockFlowsForCurrentPage(leafRenderers);
if (!leafRenderers.size()) {
WTFLogAlways("No text found in this document\n");
return;
}
TextStream stream;
HashMap<AvoidanceReason, unsigned> flowStatistics;
unsigned textLength = 0;
unsigned unsupportedTextLength = 0;
unsigned numberOfUnsupportedLeafBlocks = 0;
for (const auto* flow : leafRenderers) {
auto flowLength = textLengthForSubtree(*flow);
textLength += flowLength;
auto reasons = canUseForWithReason(*flow, FallThrough::Yes);
if (reasons == NoReason)
continue;
++numberOfUnsupportedLeafBlocks;
unsupportedTextLength += flowLength;
for (auto reasonItem = EndOfReasons >> 1; reasonItem != NoReason; reasonItem >>= 1) {
if (!(reasons & reasonItem))
continue;
auto result = flowStatistics.add(reasonItem, flowLength);
if (!result.isNewEntry)
result.iterator->value += flowLength;
}
}
stream << "---------------------------------------------------\n";
stream << "Number of text blocks: total(" << leafRenderers.size() << ") non-simple(" << numberOfUnsupportedLeafBlocks << ")\nText length: total(" <<
textLength << ") non-simple(" << unsupportedTextLength << ")\n";
for (const auto reasonEntry : flowStatistics) {
printReason(reasonEntry.key, stream);
stream << ": " << (float)reasonEntry.value / (float)textLength * 100 << "%\n";
}
stream << "simple line layout coverage: " << (float)(textLength - unsupportedTextLength) / (float)textLength * 100 << "%\n";
stream << "---------------------------------------------------\n";
WTFLogAlways("%s", stream.release().utf8().data());
}