summaryrefslogtreecommitdiff
path: root/Source/WebCore/rendering/RenderLayerBacking.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2012-11-22 09:09:45 +0100
committerSimon Hausmann <simon.hausmann@digia.com>2012-11-22 09:10:13 +0100
commit470286ecfe79d59df14944e5b5d34630fc739391 (patch)
tree43983212872e06cebefd2ae474418fa2908ca54c /Source/WebCore/rendering/RenderLayerBacking.cpp
parent23037105e948c2065da5a937d3a2396b0ff45c1e (diff)
downloadqtwebkit-470286ecfe79d59df14944e5b5d34630fc739391.tar.gz
Imported WebKit commit e89504fa9195b2063b2530961d4b73dd08de3242 (http://svn.webkit.org/repository/webkit/trunk@135485)
Change-Id: I03774e5ac79721c13ffa30d152537a74d0b12e66 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'Source/WebCore/rendering/RenderLayerBacking.cpp')
-rw-r--r--Source/WebCore/rendering/RenderLayerBacking.cpp41
1 files changed, 29 insertions, 12 deletions
diff --git a/Source/WebCore/rendering/RenderLayerBacking.cpp b/Source/WebCore/rendering/RenderLayerBacking.cpp
index 1f2a647f5..88be08dfe 100644
--- a/Source/WebCore/rendering/RenderLayerBacking.cpp
+++ b/Source/WebCore/rendering/RenderLayerBacking.cpp
@@ -221,11 +221,22 @@ void RenderLayerBacking::updateDebugIndicators(bool showBorder, bool showRepaint
m_maskLayer->setShowRepaintCounter(showRepaintCounter);
}
+ if (m_layerForHorizontalScrollbar)
+ m_layerForHorizontalScrollbar->setShowDebugBorder(showBorder);
+
+ if (m_layerForVerticalScrollbar)
+ m_layerForVerticalScrollbar->setShowDebugBorder(showBorder);
+
+ if (m_layerForScrollCorner)
+ m_layerForScrollCorner->setShowDebugBorder(showBorder);
+
if (m_scrollingLayer)
m_scrollingLayer->setShowDebugBorder(showBorder);
- if (m_scrollingContentsLayer)
+ if (m_scrollingContentsLayer) {
m_scrollingContentsLayer->setShowDebugBorder(showBorder);
+ m_scrollingContentsLayer->setShowRepaintCounter(showRepaintCounter);
+ }
}
void RenderLayerBacking::createPrimaryGraphicsLayer()
@@ -370,7 +381,7 @@ void RenderLayerBacking::updateCompositedBounds()
LayoutRect clippingBounds = view->unscaledDocumentRect();
if (m_owningLayer != rootLayer)
- clippingBounds.intersect(m_owningLayer->backgroundClipRect(rootLayer, 0, AbsoluteClipRects).rect()); // FIXME: Incorrect for CSS regions.
+ clippingBounds.intersect(m_owningLayer->backgroundClipRect(RenderLayer::ClipRectsContext(rootLayer, 0, AbsoluteClipRects)).rect()); // FIXME: Incorrect for CSS regions.
LayoutPoint delta;
m_owningLayer->convertToLayerCoords(rootLayer, delta);
@@ -609,7 +620,8 @@ void RenderLayerBacking::updateGraphicsLayerGeometry()
// Call calculateRects to get the backgroundRect which is what is used to clip the contents of this
// layer. Note that we call it with temporaryClipRects = true because normally when computing clip rects
// for a compositing layer, rootLayer is the layer itself.
- IntRect parentClipRect = pixelSnappedIntRect(m_owningLayer->backgroundClipRect(compAncestor, 0, TemporaryClipRects, IgnoreOverlayScrollbarSize, RenderLayer::IgnoreOverflowClip).rect()); // FIXME: Incorrect for CSS regions.
+ RenderLayer::ClipRectsContext clipRectsContext(compAncestor, 0, TemporaryClipRects, IgnoreOverlayScrollbarSize, RenderLayer::IgnoreOverflowClip);
+ IntRect parentClipRect = pixelSnappedIntRect(m_owningLayer->backgroundClipRect(clipRectsContext).rect()); // FIXME: Incorrect for CSS regions.
ASSERT(parentClipRect != PaintInfo::infiniteRect());
m_ancestorClippingLayer->setPosition(FloatPoint() + (parentClipRect.location() - graphicsLayerParentLocation));
m_ancestorClippingLayer->setSize(parentClipRect.size());
@@ -742,9 +754,8 @@ void RenderLayerBacking::updateGraphicsLayerGeometry()
compositor()->scrollingLayerDidChange(m_owningLayer);
m_scrollingContentsLayer->setSize(scrollSize);
- // FIXME: Scrolling the content layer does not need to trigger a repaint. The offset will be compensated away during painting.
// FIXME: The paint offset and the scroll offset should really be separate concepts.
- m_scrollingContentsLayer->setOffsetFromRenderer(scrollingContentsOffset);
+ m_scrollingContentsLayer->setOffsetFromRenderer(scrollingContentsOffset, GraphicsLayer::DontSetNeedsDisplay);
}
m_graphicsLayer->setContentsRect(contentsBox());
@@ -1303,8 +1314,14 @@ bool RenderLayerBacking::isDirectlyCompositedImage() const
RenderImage* imageRenderer = toRenderImage(renderObject);
if (CachedImage* cachedImage = imageRenderer->cachedImage()) {
- if (cachedImage->hasImage())
- return cachedImage->imageForRenderer(imageRenderer)->isBitmapImage();
+ if (!cachedImage->hasImage())
+ return false;
+
+ Image* image = cachedImage->imageForRenderer(imageRenderer);
+ if (!image->isBitmapImage())
+ return false;
+
+ return m_graphicsLayer->shouldDirectlyCompositeImage(image);
}
return false;
@@ -1505,8 +1522,7 @@ void RenderLayerBacking::setContentsNeedDisplayInRect(const IntRect& r)
void RenderLayerBacking::paintIntoLayer(RenderLayer* rootLayer, GraphicsContext* context,
const IntRect& paintDirtyRect, // In the coords of rootLayer.
- PaintBehavior paintBehavior, GraphicsLayerPaintingPhase paintingPhase,
- RenderObject* paintingRoot)
+ PaintBehavior paintBehavior, GraphicsLayerPaintingPhase paintingPhase)
{
if (paintsIntoWindow() || paintsIntoCompositedAncestor()) {
ASSERT_NOT_REACHED();
@@ -1526,10 +1542,11 @@ void RenderLayerBacking::paintIntoLayer(RenderLayer* rootLayer, GraphicsContext*
paintFlags |= RenderLayer::PaintLayerPaintingOverflowContents;
// FIXME: GraphicsLayers need a way to split for RenderRegions.
- m_owningLayer->paintLayerContents(rootLayer, context, paintDirtyRect, LayoutSize(), paintBehavior, paintingRoot, 0, 0, paintFlags);
+ RenderLayer::LayerPaintingInfo paintingInfo(rootLayer, paintDirtyRect, paintBehavior, LayoutSize());
+ m_owningLayer->paintLayerContents(context, paintingInfo, paintFlags);
if (m_owningLayer->containsDirtyOverlayScrollbars())
- m_owningLayer->paintOverlayScrollbars(context, paintDirtyRect, paintBehavior, paintingRoot);
+ m_owningLayer->paintLayerContents(context, paintingInfo, paintFlags | RenderLayer::PaintLayerPaintingOverlayScrollbars);
ASSERT(!m_owningLayer->m_usedTransparency);
}
@@ -1565,7 +1582,7 @@ void RenderLayerBacking::paintContents(const GraphicsLayer* graphicsLayer, Graph
dirtyRect.intersect(compositedBounds());
// We have to use the same root as for hit testing, because both methods can compute and cache clipRects.
- paintIntoLayer(m_owningLayer, &context, dirtyRect, PaintBehaviorNormal, paintingPhase, renderer());
+ paintIntoLayer(m_owningLayer, &context, dirtyRect, PaintBehaviorNormal, paintingPhase);
if (m_usingTiledCacheLayer)
m_owningLayer->renderer()->frame()->view()->setLastPaintTime(currentTime());