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


C++ GraphicsLayer::drawsContent方法代码示例

本文整理汇总了C++中GraphicsLayer::drawsContent方法的典型用法代码示例。如果您正苦于以下问题:C++ GraphicsLayer::drawsContent方法的具体用法?C++ GraphicsLayer::drawsContent怎么用?C++ GraphicsLayer::drawsContent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在GraphicsLayer的用法示例。


在下文中一共展示了GraphicsLayer::drawsContent方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: acceleratedPaintUnclipped

void WebViewBenchmarkSupportImpl::acceleratedPaintUnclipped(PaintClient* paintClient, GraphicsLayer& layer)
{
    FloatSize layerSize = layer.size();
    IntRect clip(0, 0, layerSize.width(), layerSize.height());

    if (layer.drawsContent())
        paintLayer(paintClient, layer, clip);

    const Vector<GraphicsLayer*>& children = layer.children();
    Vector<GraphicsLayer*>::const_iterator it;
    for (it = children.begin(); it != children.end(); ++it)
        acceleratedPaintUnclipped(paintClient, **it);
}
开发者ID:IllusionRom-deprecated,项目名称:android_platform_external_chromium_org_third_party_WebKit,代码行数:13,代码来源:WebViewBenchmarkSupportImpl.cpp

示例2: paintLayers

static void paintLayers(GraphicsLayer& layer, SimDisplayItemList& displayList) {
  if (layer.drawsContent() && layer.hasTrackedRasterInvalidations()) {
    ContentLayerDelegate* delegate = layer.contentLayerDelegateForTesting();
    delegate->paintContents(&displayList);
    layer.resetTrackedRasterInvalidations();
  }

  if (GraphicsLayer* maskLayer = layer.maskLayer())
    paintLayers(*maskLayer, displayList);
  if (GraphicsLayer* contentsClippingMaskLayer =
          layer.contentsClippingMaskLayer())
    paintLayers(*contentsClippingMaskLayer, displayList);

  for (auto child : layer.children())
    paintLayers(*child, displayList);
}
开发者ID:mirror,项目名称:chromium,代码行数:16,代码来源:SimCompositor.cpp

示例3: computeEnclosingCompositingLayer

RenderLayer* LinkHighlight::computeEnclosingCompositingLayer()
{
    if (!m_node || !m_node->renderer())
        return 0;

    // Find the nearest enclosing composited layer and attach to it. We may need to cross frame boundaries
    // to find a suitable layer.
    RenderLayerModelObject* renderer = toRenderLayerModelObject(m_node->renderer());
    RenderLayerModelObject* repaintContainer;
    do {
        repaintContainer = renderer->containerForRepaint();
        if (!repaintContainer) {
            renderer = renderer->frame()->ownerRenderer();
            if (!renderer)
                return 0;
        }
    } while (!repaintContainer);
    RenderLayer* renderLayer = repaintContainer->layer();

    if (!renderLayer || !renderLayer->isComposited())
        return 0;

    GraphicsLayer* newGraphicsLayer = renderLayer->backing()->graphicsLayer();
    m_clipLayer->setSublayerTransform(SkMatrix44());

    if (!newGraphicsLayer->drawsContent()) {
        if (renderLayer->usesCompositedScrolling()) {
            ASSERT(renderLayer->backing() && renderLayer->backing()->scrollingContentsLayer());
            newGraphicsLayer = renderLayer->backing()->scrollingContentsLayer();
        } else
            ASSERT_NOT_REACHED();
    }

    if (m_currentGraphicsLayer != newGraphicsLayer) {
        if (m_currentGraphicsLayer)
            clearGraphicsLayerLinkHighlightPointer();

        m_currentGraphicsLayer = newGraphicsLayer;
        m_currentGraphicsLayer->setLinkHighlight(this);
    }

    return renderLayer;
}
开发者ID:,项目名称:,代码行数:43,代码来源:

示例4: attachLinkHighlightToCompositingLayer

void LinkHighlight::attachLinkHighlightToCompositingLayer(const LayoutBoxModelObject* paintInvalidationContainer)
{
    GraphicsLayer* newGraphicsLayer = paintInvalidationContainer->layer()->graphicsLayerBacking();
    // FIXME: There should always be a GraphicsLayer. See crbug.com/431961.
    if (newGraphicsLayer && !newGraphicsLayer->drawsContent())
        newGraphicsLayer = paintInvalidationContainer->layer()->graphicsLayerBackingForScrolling();
    if (!newGraphicsLayer)
        return;

    m_clipLayer->setTransform(SkMatrix44(SkMatrix44::kIdentity_Constructor));

    if (m_currentGraphicsLayer != newGraphicsLayer) {
        if (m_currentGraphicsLayer)
            clearGraphicsLayerLinkHighlightPointer();

        m_currentGraphicsLayer = newGraphicsLayer;
        m_currentGraphicsLayer->addLinkHighlight(this);
    }
}
开发者ID:kingysu,项目名称:blink-crosswalk,代码行数:19,代码来源:LinkHighlight.cpp

示例5: attachLinkHighlightToCompositingLayer

void LinkHighlight::attachLinkHighlightToCompositingLayer(const RenderLayerModelObject* paintInvalidationContainer)
{
    // FIXME: there should always be a GraphicsLayer. See https://code.google.com/p/chromium/issues/detail?id=359877.
    GraphicsLayer* newGraphicsLayer = paintInvalidationContainer->layer()->graphicsLayerBacking();
    if (newGraphicsLayer && !newGraphicsLayer->drawsContent())
        newGraphicsLayer = paintInvalidationContainer->layer()->graphicsLayerBackingForScrolling();
    if (!newGraphicsLayer)
        return;

    m_clipLayer->setTransform(SkMatrix44(SkMatrix44::kIdentity_Constructor));

    if (m_currentGraphicsLayer != newGraphicsLayer) {
        if (m_currentGraphicsLayer)
            clearGraphicsLayerLinkHighlightPointer();

        m_currentGraphicsLayer = newGraphicsLayer;
        m_currentGraphicsLayer->addLinkHighlight(this);
    }
}
开发者ID:RobinWuDev,项目名称:Qt,代码行数:19,代码来源:LinkHighlight.cpp

示例6: computeEnclosingCompositingLayer

RenderLayer* LinkHighlight::computeEnclosingCompositingLayer()
{
    if (!m_node || !m_node->renderer())
        return 0;

    // Find the nearest enclosing composited layer and attach to it. We may need to cross frame boundaries
    // to find a suitable layer.
    RenderObject* renderer = m_node->renderer();
    RenderLayerModelObject* repaintContainer;
    do {
        repaintContainer = renderer->containerForRepaint();
        if (!repaintContainer) {
            renderer = renderer->frame()->ownerRenderer();
            if (!renderer)
                return 0;
        }
    } while (!repaintContainer);
    RenderLayer* renderLayer = repaintContainer->layer();

    if (!renderLayer || renderLayer->compositingState() == NotComposited)
        return 0;

    GraphicsLayer* newGraphicsLayer = renderLayer->compositedLayerMapping()->mainGraphicsLayer();
    m_clipLayer->setTransform(SkMatrix44());

    if (!newGraphicsLayer->drawsContent()) {
        if (renderLayer->scrollableArea() && renderLayer->scrollableArea()->usesCompositedScrolling()) {
            ASSERT(renderLayer->hasCompositedLayerMapping() && renderLayer->compositedLayerMapping()->scrollingContentsLayer());
            newGraphicsLayer = renderLayer->compositedLayerMapping()->scrollingContentsLayer();
        }
    }

    if (m_currentGraphicsLayer != newGraphicsLayer) {
        if (m_currentGraphicsLayer)
            clearGraphicsLayerLinkHighlightPointer();

        m_currentGraphicsLayer = newGraphicsLayer;
        m_currentGraphicsLayer->addLinkHighlight(this);
    }

    return renderLayer;
}
开发者ID:junmin-zhu,项目名称:blink,代码行数:42,代码来源:LinkHighlight.cpp

示例7: registerMockedHttpURLLoad

TEST_F(ScrollingCoordinatorTest, scrollbarsForceMainThreadOrHaveWebScrollbarLayer)
{
    registerMockedHttpURLLoad("trivial-scroller.html");
    navigateTo(m_baseURL + "trivial-scroller.html");
    forceFullCompositingUpdate();

    Document* document = frame()->document();
    Element* scrollableElement = document->getElementById("scroller");
    ASSERT(scrollableElement);

    LayoutObject* layoutObject = scrollableElement->layoutObject();
    ASSERT_TRUE(layoutObject->isBox());
    LayoutBox* box = toLayoutBox(layoutObject);
    ASSERT_TRUE(box->usesCompositedScrolling());
    CompositedLayerMapping* compositedLayerMapping = box->layer()->compositedLayerMapping();
    GraphicsLayer* scrollbarGraphicsLayer = compositedLayerMapping->layerForVerticalScrollbar();
    ASSERT_TRUE(scrollbarGraphicsLayer);

    bool hasWebScrollbarLayer = !scrollbarGraphicsLayer->drawsContent();
    ASSERT_TRUE(hasWebScrollbarLayer || scrollbarGraphicsLayer->platformLayer()->shouldScrollOnMainThread());
}
开发者ID:astojilj,项目名称:chromium-crosswalk,代码行数:21,代码来源:ScrollingCoordinatorTest.cpp

示例8: computeEnclosingCompositingLayer

RenderLayer* LinkHighlight::computeEnclosingCompositingLayer()
{
    if (!m_node || !m_node->renderer())
        return 0;

    // Find the nearest enclosing composited layer and attach to it. We may need to cross frame boundaries
    // to find a suitable layer.
    RenderObject* renderer = m_node->renderer();
    RenderLayer* renderLayer;
    do {
        renderLayer = renderer->enclosingLayer()->enclosingCompositingLayerForRepaint();
        if (!renderLayer) {
            renderer = renderer->frame()->ownerRenderer();
            if (!renderer)
                return 0;
        }
    } while (!renderLayer);

    CompositedLayerMappingPtr compositedLayerMapping = renderLayer->compositingState() == PaintsIntoGroupedBacking ? renderLayer->groupedMapping() : renderLayer->compositedLayerMapping();
    GraphicsLayer* newGraphicsLayer = renderLayer->compositingState() == PaintsIntoGroupedBacking ? compositedLayerMapping->squashingLayer() : compositedLayerMapping->mainGraphicsLayer();

    m_clipLayer->setTransform(SkMatrix44(SkMatrix44::kIdentity_Constructor));

    if (!newGraphicsLayer->drawsContent()) {
        if (renderLayer->scrollableArea() && renderLayer->scrollableArea()->usesCompositedScrolling()) {
            ASSERT(renderLayer->hasCompositedLayerMapping() && renderLayer->compositedLayerMapping()->scrollingContentsLayer());
            newGraphicsLayer = compositedLayerMapping->scrollingContentsLayer();
        }
    }

    if (m_currentGraphicsLayer != newGraphicsLayer) {
        if (m_currentGraphicsLayer)
            clearGraphicsLayerLinkHighlightPointer();

        m_currentGraphicsLayer = newGraphicsLayer;
        m_currentGraphicsLayer->addLinkHighlight(this);
    }

    return renderLayer;
}
开发者ID:venkatarajasekhar,项目名称:Qt,代码行数:40,代码来源:LinkHighlight.cpp

示例9: makeSnapshot

void InspectorLayerTreeAgent::makeSnapshot(ErrorString* errorString,
                                           const String& layerId,
                                           String* snapshotId) {
  GraphicsLayer* layer = layerById(errorString, layerId);
  if (!layer || !layer->drawsContent())
    return;

  IntSize size = expandedIntSize(layer->size());

  IntRect interestRect(IntPoint(0, 0), size);
  layer->paint(&interestRect);

  GraphicsContext context(layer->getPaintController());
  context.beginRecording(interestRect);
  layer->getPaintController().paintArtifact().replay(context);
  RefPtr<PictureSnapshot> snapshot =
      adoptRef(new PictureSnapshot(context.endRecording()));

  *snapshotId = String::number(++s_lastSnapshotId);
  bool newEntry = m_snapshotById.add(*snapshotId, snapshot).isNewEntry;
  DCHECK(newEntry);
}
开发者ID:ollie314,项目名称:chromium,代码行数:22,代码来源:InspectorLayerTreeAgent.cpp


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