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


C++ LayerChromium::replicaLayer方法代码示例

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


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

示例1: paintLayerContents

void LayerRendererChromium::paintLayerContents(const LayerList& renderSurfaceLayerList)
{
    for (int surfaceIndex = renderSurfaceLayerList.size() - 1; surfaceIndex >= 0 ; --surfaceIndex) {
        CCLayerImpl* renderSurfaceLayer = renderSurfaceLayerList[surfaceIndex].get();
        RenderSurfaceChromium* renderSurface = renderSurfaceLayer->renderSurface();
        ASSERT(renderSurface);

        // Make sure any renderSurfaceLayer is associated with this layerRenderer.
        // This is a defensive assignment in case the owner of this layer hasn't
        // set the layerRenderer on this layer already.
        renderSurfaceLayer->setLayerRenderer(this);

        // Render surfaces whose drawable area has zero width or height
        // will have no layers associated with them and should be skipped.
        if (!renderSurface->m_layerList.size())
            continue;

        LayerList& layerList = renderSurface->m_layerList;
        ASSERT(layerList.size());
        for (unsigned layerIndex = 0; layerIndex < layerList.size(); ++layerIndex) {
            CCLayerImpl* ccLayerImpl = layerList[layerIndex].get();

            // Layers that start a new render surface will be painted when the render
            // surface's list is processed.
            if (ccLayerImpl->renderSurface() && ccLayerImpl->renderSurface() != renderSurface)
                continue;

            LayerChromium* layer = ccLayerImpl->owner();

            layer->setLayerRenderer(this);

            if (layer->maskLayer())
                layer->maskLayer()->setLayerRenderer(this);
            if (layer->replicaLayer()) {
                layer->replicaLayer()->setLayerRenderer(this);
                if (layer->replicaLayer()->maskLayer())
                    layer->replicaLayer()->maskLayer()->setLayerRenderer(this);
            }

            if (layer->bounds().isEmpty())
              continue;

            IntRect targetSurfaceRect = ccLayerImpl->targetRenderSurface() ? ccLayerImpl->targetRenderSurface()->contentRect() : m_defaultRenderSurface->contentRect();
            IntRect scissorRect = layer->ccLayerImpl()->scissorRect();
            if (!scissorRect.isEmpty())
                targetSurfaceRect.intersect(scissorRect);

            if (layer->drawsContent())
                layer->paintContentsIfDirty(targetSurfaceRect);
            if (layer->maskLayer() && layer->maskLayer()->drawsContent())
                layer->maskLayer()->paintContentsIfDirty(targetSurfaceRect);
            if (layer->replicaLayer() && layer->replicaLayer()->drawsContent())
                layer->replicaLayer()->paintContentsIfDirty(targetSurfaceRect);
            if (layer->replicaLayer() && layer->replicaLayer()->maskLayer() && layer->replicaLayer()->maskLayer()->drawsContent())
                layer->replicaLayer()->maskLayer()->paintContentsIfDirty(targetSurfaceRect);
        }
    }
}
开发者ID:sanyaade-mobiledev,项目名称:Webkit-Projects,代码行数:58,代码来源:LayerRendererChromium.cpp


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