Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1755)

Unified Diff: Source/core/rendering/RenderLayer.cpp

Issue 301843002: Store repaint rects in the coordinate space of their backing GraphicsLayer. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Changed name. Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/rendering/RenderLayer.h ('k') | Source/core/rendering/RenderLayerRepainter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderLayer.cpp
diff --git a/Source/core/rendering/RenderLayer.cpp b/Source/core/rendering/RenderLayer.cpp
index 35307e16f3cbbaf39f433327a26f34fb813c1d6a..20248a728a58ff9ea6f6d14d61560a5274a62930 100644
--- a/Source/core/rendering/RenderLayer.cpp
+++ b/Source/core/rendering/RenderLayer.cpp
@@ -709,6 +709,48 @@ void RenderLayer::updatePagination()
}
}
+void RenderLayer::mapRectToRepaintBacking(const RenderLayerModelObject* repaintContainer, LayoutRect& rect) const
+{
+ if (!repaintContainer->groupedMapping()) {
+ m_renderer->mapRectToRepaintBacking(repaintContainer, rect);
+ return;
+ }
+
+ ASSERT(enclosingTransformedAncestor());
+ ASSERT(enclosingTransformedAncestor()->renderer());
+
+ // FIXME: this defensive code should not have to exist. None of these pointers should ever be 0. See crbug.com/370410.
+ RenderLayerModelObject* transformedAncestor = 0;
+ if (RenderLayer* ancestor = repaintContainer->layer()->enclosingTransformedAncestor())
+ transformedAncestor = ancestor->renderer();
+ if (!transformedAncestor)
+ return;
+
+ // If the transformedAncestor is actually the RenderView, we might get
+ // confused and think that we can use LayoutState. Ideally, we'd made
+ // LayoutState work for all composited layers as well, but until then
+ // we need to disable LayoutState for squashed layers.
+ LayoutStateDisabler layoutStateDisabler(*transformedAncestor);
+
+ // This code adjusts the repaint rectangle to be in the space of the transformed ancestor of the grouped (i.e. squashed)
+ // layer. This is because all layers that squash together need to repaint w.r.t. a single container that is
+ // an ancestor of all of them, in order to properly take into account any local transforms etc.
+ // FIXME: remove this special-case code that works around the repainting code structure.
+ m_renderer->mapRectToRepaintBacking(transformedAncestor, rect);
+ rect.moveBy(-repaintContainer->groupedMapping()->squashingOffsetFromTransformedAncestor());
+
+ return;
+}
+
+LayoutRect RenderLayer::computeRepaintRect(const RenderLayerModelObject* repaintContainer) const
+{
+ if (!repaintContainer->groupedMapping())
+ return m_renderer->computeRepaintRect(repaintContainer);
+ LayoutRect rect = renderer()->clippedOverflowRectForRepaint(repaintContainer);
+ repaintContainer->layer()->mapRectToRepaintBacking(repaintContainer, rect);
+ return rect;
+}
+
void RenderLayer::setHasVisibleContent()
{
if (m_hasVisibleContent && !m_visibleContentStatusDirty) {
« no previous file with comments | « Source/core/rendering/RenderLayer.h ('k') | Source/core/rendering/RenderLayerRepainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698