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

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

Issue 2792833002: Revert of Optimize the pre-paint tree walk and ClipRects (Closed)
Patch Set: Created 3 years, 9 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
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 a96d6e860cd5a0aef5aac6607f0d28309be65ed8..ac670bf730d2374730a42870f98319e2bd4f9368 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayerClipper.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayerClipper.cpp
@@ -128,7 +128,7 @@
DCHECK(entry.overlayScrollbarClipBehavior ==
context.overlayScrollbarClipBehavior);
#endif
- return &entry.clipRects;
+ return entry.clipRects.get();
}
ClipRects& PaintLayerClipper::storeClipRectsInCache(
@@ -144,12 +144,12 @@
if (parentClipRects) {
// If our clip rects match the clip rects of our parent, we share storage.
if (clipRects == *parentClipRects) {
- entry.clipRects = *parentClipRects;
+ entry.clipRects = parentClipRects;
return *parentClipRects;
}
}
- entry.clipRects = clipRects;
- return entry.clipRects;
+ entry.clipRects = ClipRects::create(clipRects);
+ return *entry.clipRects;
}
ClipRects& PaintLayerClipper::getClipRects(
@@ -165,9 +165,9 @@
parentClipRects =
&PaintLayerClipper(*m_layer.parent(), nullptr).getClipRects(context);
}
- ClipRects clipRects;
- calculateClipRects(context, clipRects);
- return storeClipRectsInCache(context, parentClipRects, clipRects);
+ RefPtr<ClipRects> clipRects = ClipRects::create();
+ calculateClipRects(context, *clipRects);
+ return storeClipRectsInCache(context, parentClipRects, *clipRects);
}
void PaintLayerClipper::clearCache(ClipRectsCacheSlot cacheSlot) {
@@ -533,20 +533,20 @@
LayoutView* layoutView = m_layer.layoutObject().view();
DCHECK(layoutView);
- ClipRects parentClipRects;
+ RefPtr<ClipRects> parentClipRects = ClipRects::create();
if (&m_layer == context.rootLayer) {
- parentClipRects.reset(LayoutRect(LayoutRect::infiniteIntRect()));
+ parentClipRects->reset(LayoutRect(LayoutRect::infiniteIntRect()));
} else {
PaintLayerClipper(*m_layer.parent(), m_geometryMapper)
- .getOrCalculateClipRects(context, parentClipRects);
+ .getOrCalculateClipRects(context, *parentClipRects);
}
output = backgroundClipRectForPosition(
- parentClipRects, m_layer.layoutObject().styleRef().position());
+ *parentClipRects, m_layer.layoutObject().styleRef().position());
// Note: infinite clipRects should not be scrolled here, otherwise they will
// accidentally no longer be considered infinite.
- if (parentClipRects.fixed() &&
+ if (parentClipRects->fixed() &&
&context.rootLayer->layoutObject() == layoutView &&
output != LayoutRect(LayoutRect::infiniteIntRect()))
output.move(LayoutSize(layoutView->frameView()->getScrollOffset()));
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintLayer.cpp ('k') | third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698