2009-02-06 Simon Fraser <simon.fraser@apple.com>

        Reviewed by Eric Seidel

        Expose an isRootLayer() method on RenderLayer that works whether the
        layer is rooted or not, and use that in a few places in the
        accelerated compositing code.

        * rendering/RenderLayer.h:
        (WebCore::RenderLayer::isRootLayer):
        * rendering/RenderLayerBacking.cpp:
        (WebCore::RenderLayerBacking::paintingGoesToWindow):
        * rendering/RenderLayerCompositor.cpp:
        (WebCore::RenderLayerCompositor::rebuildCompositingLayerTree):
        (WebCore::RenderLayerCompositor::requiresCompositingLayer):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@40731 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent e99c986f
2009-02-06 Simon Fraser <simon.fraser@apple.com>
Reviewed by Eric Seidel
Expose an isRootLayer() method on RenderLayer that works whether the
layer is rooted or not, and use that in a few places in the
accelerated compositing code.
* rendering/RenderLayer.h:
(WebCore::RenderLayer::isRootLayer):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::paintingGoesToWindow):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::rebuildCompositingLayerTree):
(WebCore::RenderLayerCompositor::requiresCompositingLayer):
2009-02-06 Dan Bernstein <mitz@apple.com>
Reviewed by Darin Adler.
......@@ -301,6 +301,9 @@ public:
bool inResizeMode() const { return m_inResizeMode; }
void setInResizeMode(bool b) { m_inResizeMode = b; }
// Can't just check !parent() because we might be unrooted.
bool isRootLayer() const { return renderer()->node()->isDocumentNode(); }
#if USE(ACCELERATED_COMPOSITING)
RenderLayerCompositor* compositor() const;
#endif
......
......@@ -617,7 +617,7 @@ FloatPoint RenderLayerBacking::contentsToGraphicsLayerCoordinates(const Graphics
bool RenderLayerBacking::paintingGoesToWindow() const
{
return m_owningLayer->isDocumentLayer();
return m_owningLayer->isRootLayer();
}
void RenderLayerBacking::setContentsNeedDisplay()
......
......@@ -453,7 +453,7 @@ void RenderLayerCompositor::rebuildCompositingLayerTree(RenderLayer* layer, stru
updateLayerCompositingState(layer, StyleDifferenceEqual);
// host the document layer in the RenderView's root layer
if (layer->isDocumentLayer())
if (layer->isRootLayer())
parentInRootLayer(layer);
CompositingState childState = ioCompState;
......@@ -637,7 +637,7 @@ bool RenderLayerCompositor::requiresCompositingLayer(const RenderLayer* layer) c
#if VERBOSE_COMPOSITINGLAYER
bool gotReason = false;
if (!gotReason && inCompositingMode() && layer->isDocumentLayer()) {
if (!gotReason && inCompositingMode() && layer->isRootLayer()) {
fprintf(stderr, "RenderLayer %p requires compositing layer because: it's the document root\n", layer);
gotReason = true;
}
......@@ -661,8 +661,8 @@ bool RenderLayerCompositor::requiresCompositingLayer(const RenderLayer* layer) c
fprintf(stderr, "RenderLayer %p does not require compositing layer\n", layer);
#endif
// the root layer always has a compositing layer (for now).
return (inCompositingMode() && layer->isDocumentLayer()) ||
// The root layer always has a compositing layer, but it may not have backing.
return (inCompositingMode() && layer->isRootLayer()) ||
requiresCompositingLayerForTransform(layer->renderer()) ||
clipsCompositingDescendants(layer) ||
requiresCompositingForAnimation(layer);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment