static void paintLayers(PaintLayer& layer, SimDisplayItemList& displayList)
{
    if (layer.isAllowedToQueryCompositingState() && layer.compositingState() == PaintsIntoOwnBacking) {
        CompositedLayerMapping* mapping = layer.compositedLayerMapping();
        GraphicsLayer* graphicsLayer = mapping->mainGraphicsLayer();
        if (graphicsLayer->hasTrackedPaintInvalidations()) {
            ContentLayerDelegate* delegate = graphicsLayer->contentLayerDelegateForTesting();
            delegate->paintContents(&displayList, WebRect(0, 0, layer.size().width(), layer.size().height()));
            graphicsLayer->resetTrackedPaintInvalidations();
        }
    }
    for (PaintLayer* child = layer.firstChild(); child; child = child->nextSibling())
        paintLayers(*child, displayList);
}
Exemplo n.º 2
0
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);
}