当前位置: 首页>>代码示例>>C++>>正文


C++ TextStream::release方法代码示例

本文整理汇总了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();
}
开发者ID:hackerkevin,项目名称:sky_engine,代码行数:10,代码来源:RenderTreeAsText.cpp

示例2: layerTreeAsText

String GraphicsLayer::layerTreeAsText(LayerTreeAsTextBehavior behavior) const
{
    TextStream ts;

    dumpLayer(ts, 0, behavior);
    return ts.release();
}
开发者ID:kcomkar,项目名称:webkit,代码行数:7,代码来源:GraphicsLayer.cpp

示例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();
 }
开发者ID:shaoboyan,项目名称:chromium-crosswalk,代码行数:7,代码来源:PrintContextTest.cpp

示例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();
}
开发者ID:edcwconan,项目名称:webkit,代码行数:34,代码来源:ViewportConfiguration.cpp

示例5: scrollingStateTreeAsText

String ScrollingStateNode::scrollingStateTreeAsText() const
{
    TextStream ts;

    dump(ts, 0);
    return ts.release();
}
开发者ID:3163504123,项目名称:phantomjs,代码行数:7,代码来源:ScrollingStateNode.cpp

示例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());
}
开发者ID:josedealcala,项目名称:webkit,代码行数:26,代码来源:SimpleLineLayout.cpp

示例7: scrollingStateTreeAsText

String ScrollingStateNode::scrollingStateTreeAsText() const
{
    TextStream ts;

    dump(ts, 0, ScrollingStateTreeAsTextBehaviorNormal);
    return ts.release();
}
开发者ID:edcwconan,项目名称:webkit,代码行数:7,代码来源:ScrollingStateNode.cpp

示例8: layerTreeAsText

String LayerRendererChromium::layerTreeAsText() const
{
    TextStream ts;
    if (rootLayer()) {
        ts << rootLayer()->layerTreeAsText();
        ts << "RenderSurfaces:\n";
        dumpRenderSurfaces(ts, 1, rootLayer());
    }
    return ts.release();
}
开发者ID:RasterCode,项目名称:wke,代码行数:10,代码来源:LayerRendererChromium.cpp

示例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();
}
开发者ID:Channely,项目名称:know-your-chrome,代码行数:14,代码来源:RenderTreeAsText.cpp

示例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();
}
开发者ID:hnney,项目名称:webkit,代码行数:50,代码来源:ViewportConfiguration.cpp

示例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();
}
开发者ID:jackiekaon,项目名称:owb-mirror,代码行数:17,代码来源:RenderTreeAsText.cpp

示例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();
}
开发者ID:Czerrr,项目名称:ISeeBrowser,代码行数:18,代码来源:RenderTreeAsText.cpp

示例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();
}
开发者ID:325116067,项目名称:semc-qsd8x50,代码行数:19,代码来源:RenderTreeAsText.cpp

示例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();
}
开发者ID:venkatarajasekhar,项目名称:Qt,代码行数:20,代码来源:LocalFrame.cpp

示例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());
}
开发者ID:josedealcala,项目名称:webkit,代码行数:40,代码来源:SimpleLineLayout.cpp


注:本文中的TextStream::release方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。