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

Unified Diff: Source/core/paint/DeprecatedPaintLayerClipper.cpp

Issue 1316173002: Move AbsoluteClipRects to the state machine (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 4 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/paint/DeprecatedPaintLayerClipper.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/paint/DeprecatedPaintLayerClipper.cpp
diff --git a/Source/core/paint/DeprecatedPaintLayerClipper.cpp b/Source/core/paint/DeprecatedPaintLayerClipper.cpp
index 1d0ea54eb3f87d220fef170844a9e2487d983156..70c690e9ef39b16c987c4ad1c4e4bf19a2d1a9c3 100644
--- a/Source/core/paint/DeprecatedPaintLayerClipper.cpp
+++ b/Source/core/paint/DeprecatedPaintLayerClipper.cpp
@@ -169,7 +169,7 @@ void DeprecatedPaintLayerClipper::calculateRects(const ClipRectsContext& context
}
}
-static void precalculate(const ClipRectsContext& context)
+void precalculate(const ClipRectsContext& context)
{
bool isComputingPaintingRect = context.isComputingPaintingRect();
ClipRectComputationState rects;
@@ -187,6 +187,13 @@ static void precalculate(const ClipRectsContext& context)
rootLayer->clipper().calculateClipRects(context, rects);
}
+void DeprecatedPaintLayerClipper::precalculateAbsoluteClipRects()
+{
+ ASSERT(m_layoutObject.layer()->isRootLayer());
+ // The absolute rectangles rely on layout sizes and position only.
+ ASSERT(m_layoutObject.document().lifecycle().state() >= DocumentLifecycle::LayoutClean);
+ precalculate(ClipRectsContext(m_layoutObject.layer(), AbsoluteClipRects));
+}
// Calculates clipRect for each element in the section of the tree starting with context.rootLayer
// For painting, context.rootLayer is ignored and the entire tree is calculated.
@@ -213,8 +220,11 @@ ClipRect DeprecatedPaintLayerClipper::backgroundClipRect(const ClipRectsContext&
// TODO(chadarmstrong): precalculation for painting should be moved to updateLifecyclePhasesInternal
// and precalculation could be done for all hit testing. This would let us avoid clearing the cache
- if (!m_clips[context.cacheSlot()])
+ if (!m_clips[context.cacheSlot()]) {
+ // AbsoluteClipRects should have been updated during compositing updates so we shouldn't miss here.
+ ASSERT(context.cacheSlot() != AbsoluteClipRects);
precalculate(context);
+ }
// TODO(chadarmstrong): eliminate this if possible.
// It is necessary only because of a seemingly atypical use of rootLayer that
« no previous file with comments | « Source/core/paint/DeprecatedPaintLayerClipper.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698