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

Unified Diff: third_party/WebKit/Source/core/paint/PaintLayerClipper.cpp

Issue 2662313003: Invalidate subsequence caching & empty paint phases if clips changed. (Closed)
Patch Set: Created 3 years, 11 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 | « no previous file | third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/paint/PaintLayerClipper.cpp
diff --git a/third_party/WebKit/Source/core/paint/PaintLayerClipper.cpp b/third_party/WebKit/Source/core/paint/PaintLayerClipper.cpp
index b8b71d4fb8e797175369a82539f15252e8294057..fa65bb692d88b92e87a6e22d4c8ee1ce08e778dc 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayerClipper.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayerClipper.cpp
@@ -160,8 +160,8 @@ ClipRects& PaintLayerClipper::storeClipRectsInCache(
ClipRects& PaintLayerClipper::getClipRects(
const ClipRectsContext& context) const {
- if (ClipRects* result = clipRectsIfCached(context))
- return *result;
+ // if (ClipRects* result = clipRectsIfCached(context))
+ // return *result;
// Note that it's important that we call getClipRects on our parent
// before we call calculateClipRects so that calculateClipRects will hit
// the cache.
@@ -169,6 +169,8 @@ ClipRects& PaintLayerClipper::getClipRects(
if (context.rootLayer != &m_layer && m_layer.parent())
parentClipRects = &m_layer.parent()->clipper().getClipRects(context);
RefPtr<ClipRects> clipRects = ClipRects::create();
+ // LOG(ERROR) << "calculateClipRects:" <<
+ // m_layer.layoutObject()->debugName();
calculateClipRects(context, *clipRects);
return storeClipRectsInCache(context, parentClipRects, *clipRects);
}
@@ -389,6 +391,7 @@ void PaintLayerClipper::calculateClipRects(const ClipRectsContext& context,
if (!m_layer.parent() &&
!RuntimeEnabledFeatures::rootLayerScrollingEnabled()) {
// The root layer's clip rect is always infinite.
+ // LOG(ERROR) << "wat";
clipRects.reset(LayoutRect(LayoutRect::infiniteIntRect()));
return;
}
@@ -408,16 +411,19 @@ void PaintLayerClipper::calculateClipRects(const ClipRectsContext& context,
}
adjustClipRectsForChildren(layoutObject, clipRects);
-
+ // LOG(ERROR) << "just before: " << m_layer.layoutObject()->debugName();
if (shouldClipOverflow(context) || layoutObject.hasClip()) {
+ // LOG(ERROR) << "clipping overflow: " <<
+ // m_layer.layoutObject()->debugName();
// This offset cannot use convertToLayerCoords, because sometimes our
// rootLayer may be across some transformed layer boundary, for example, in
// the PaintLayerCompositor overlapMap, where clipRects are needed in view
// space.
- applyClipRects(context, layoutObject,
- LayoutPoint(layoutObject.localToAncestorPoint(
- FloatPoint(), context.rootLayer->layoutObject())),
- clipRects);
+ LOG(ERROR) << "mapping to ancestor: from=" << layoutObject.debugName()
+ << " to=" << context.rootLayer->layoutObject()->debugName();
+ LayoutPoint point(layoutObject.localToAncestorPoint(
+ FloatPoint(), context.rootLayer->layoutObject()));
+ applyClipRects(context, layoutObject, point, clipRects);
}
}
@@ -479,6 +485,7 @@ ClipRect PaintLayerClipper::applyOverflowClipToBackgroundRectWithGeometryMapper(
const ClipRect& clip) const {
const LayoutObject& layoutObject = *m_layer.layoutObject();
FloatRect clipRect(clip.rect());
+ // fix??
if (shouldClipOverflow(context)) {
LayoutRect layerBoundsWithVisualOverflow =
layoutObject.isLayoutView()
@@ -543,11 +550,11 @@ bool PaintLayerClipper::shouldClipOverflow(
const ClipRectsContext& context) const {
if (!m_layer.layoutObject()->isBox())
return false;
+ // LOG(ERROR) << "wat";
const LayoutBox& box = *toLayoutBox(m_layer.layoutObject());
if (!shouldRespectOverflowClip(context))
return false;
-
return box.shouldClipOverflow();
}
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698