From 65f03d4f644ce73618e5f4f50dd694b26f55ae12 Mon Sep 17 00:00:00 2001 From: Ben Murdoch Date: Fri, 13 May 2011 16:23:25 +0100 Subject: Merge WebKit at r75993: Initial merge by git. Change-Id: I602bbdc3974787a3b0450456a30a7868286921c3 --- Source/WebCore/rendering/RenderLayerBacking.cpp | 26 +++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to 'Source/WebCore/rendering/RenderLayerBacking.cpp') diff --git a/Source/WebCore/rendering/RenderLayerBacking.cpp b/Source/WebCore/rendering/RenderLayerBacking.cpp index c430bae..8001c42 100644 --- a/Source/WebCore/rendering/RenderLayerBacking.cpp +++ b/Source/WebCore/rendering/RenderLayerBacking.cpp @@ -105,6 +105,12 @@ void RenderLayerBacking::createGraphicsLayer() m_graphicsLayer->setName(nameForLayer()); #endif // NDEBUG +#if USE(ACCELERATED_COMPOSITING) + ASSERT(renderer() && renderer()->document() && renderer()->document()->frame()); + if (Frame* frame = renderer()->document()->frame()) + m_graphicsLayer->setContentsScale(frame->pageScaleFactor()); +#endif + updateLayerOpacity(renderer()->style()); updateLayerTransform(renderer()->style()); } @@ -543,6 +549,8 @@ bool RenderLayerBacking::updateForegroundLayer(bool needsForegroundLayer) #endif m_foregroundLayer->setDrawsContent(true); m_foregroundLayer->setPaintingPhase(GraphicsLayerPaintForeground); + if (Frame* frame = renderer()->document()->frame()) + m_foregroundLayer->setContentsScale(frame->pageScaleFactor()); layerChanged = true; } } else if (m_foregroundLayer) { @@ -568,6 +576,8 @@ bool RenderLayerBacking::updateMaskLayer(bool needsMaskLayer) #endif m_maskLayer->setDrawsContent(true); m_maskLayer->setPaintingPhase(GraphicsLayerPaintMask); + if (Frame* frame = renderer()->document()->frame()) + m_maskLayer->setContentsScale(frame->pageScaleFactor()); layerChanged = true; } } else if (m_maskLayer) { @@ -933,7 +943,7 @@ FloatPoint RenderLayerBacking::contentsToGraphicsLayerCoordinates(const Graphics bool RenderLayerBacking::paintingGoesToWindow() const { if (m_owningLayer->isRootLayer()) - return !m_owningLayer->hasTransform() && (compositor()->rootLayerAttachment() != RenderLayerCompositor::RootLayerAttachedViaEnclosingIframe); + return compositor()->rootLayerAttachment() != RenderLayerCompositor::RootLayerAttachedViaEnclosingIframe; return false; } @@ -1275,7 +1285,7 @@ void RenderLayerBacking::notifyAnimationStarted(const GraphicsLayer*, double tim void RenderLayerBacking::notifySyncRequired(const GraphicsLayer*) { if (!renderer()->documentBeingDestroyed()) - compositor()->scheduleSync(); + compositor()->scheduleLayerFlush(); } // This is used for the 'freeze' API, for testing only. @@ -1361,6 +1371,18 @@ CompositingLayerType RenderLayerBacking::compositingLayerType() const return ContainerCompositingLayer; } +void RenderLayerBacking::updateContentsScale(float scale) +{ + if (m_graphicsLayer) + m_graphicsLayer->setContentsScale(scale); + + if (m_foregroundLayer) + m_foregroundLayer->setContentsScale(scale); + + if (m_maskLayer) + m_maskLayer->setContentsScale(scale); +} + } // namespace WebCore #endif // USE(ACCELERATED_COMPOSITING) -- cgit v1.1