本文整理汇总了C++中LayerChromium::setLayerRenderer方法的典型用法代码示例。如果您正苦于以下问题:C++ LayerChromium::setLayerRenderer方法的具体用法?C++ LayerChromium::setLayerRenderer怎么用?C++ LayerChromium::setLayerRenderer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LayerChromium
的用法示例。
在下文中一共展示了LayerChromium::setLayerRenderer方法的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);
}
}
}