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

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

Issue 2671853003: [SPInvalidation] Use GeometryMapper in PaintLayerClipper for paint. (Closed)
Patch Set: none Created 3 years, 10 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 ce81f149ddeb4e940fac6e41aae6b63ff124d72e..8f958bbb0cc02235a253c520165a5645c50f6448 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayerClipper.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayerClipper.cpp
@@ -114,9 +114,8 @@ static void applyClipRects(const ClipRectsContext& context,
}
PaintLayerClipper::PaintLayerClipper(const PaintLayer& layer,
- bool useGeometryMapper)
- : m_layer(layer),
- m_geometryMapper(useGeometryMapper ? new GeometryMapper : nullptr) {}
+ GeometryMapper* geometryMapper)
+ : m_layer(layer), m_geometryMapper(geometryMapper) {}
ClipRects* PaintLayerClipper::clipRectsIfCached(
const ClipRectsContext& context) const {
@@ -166,8 +165,10 @@ ClipRects& PaintLayerClipper::getClipRects(
// before we call calculateClipRects so that calculateClipRects will hit
// the cache.
ClipRects* parentClipRects = nullptr;
- if (context.rootLayer != &m_layer && m_layer.parent())
- parentClipRects = &m_layer.parent()->clipper().getClipRects(context);
+ if (context.rootLayer != &m_layer && m_layer.parent()) {
+ parentClipRects =
+ &m_layer.parent()->clipper(m_geometryMapper).getClipRects(context);
+ }
RefPtr<ClipRects> clipRects = ClipRects::create();
calculateClipRects(context, *clipRects);
return storeClipRectsInCache(context, parentClipRects, *clipRects);
@@ -178,9 +179,6 @@ void PaintLayerClipper::clearCache(ClipRectsCacheSlot cacheSlot) {
m_layer.clearClipRectsCache();
else if (ClipRectsCache* cache = m_layer.clipRectsCache())
cache->clear(cacheSlot);
-
- if (m_geometryMapper)
- m_geometryMapper.reset(new GeometryMapper);
}
void PaintLayerClipper::clearClipRectsIncludingDescendants() {
@@ -195,7 +193,7 @@ void PaintLayerClipper::clearClipRectsIncludingDescendants(
while (!layers.empty()) {
const PaintLayer* currentLayer = layers.top();
layers.pop();
- currentLayer->clipper().clearCache(cacheSlot);
+ currentLayer->clipper(m_geometryMapper).clearCache(cacheSlot);
for (const PaintLayer* layer = currentLayer->firstChild(); layer;
layer = layer->nextSibling())
layers.push(layer);
@@ -402,7 +400,8 @@ void PaintLayerClipper::calculateClipRects(const ClipRectsContext& context,
// Ensure that our parent's clip has been calculated so that we can examine
// the values.
if (parentLayer) {
- parentLayer->clipper().getOrCalculateClipRects(context, clipRects);
+ parentLayer->clipper(m_geometryMapper)
+ .getOrCalculateClipRects(context, clipRects);
} else {
clipRects.reset(LayoutRect(LayoutRect::infiniteIntRect()));
}
@@ -512,11 +511,13 @@ ClipRect PaintLayerClipper::backgroundClipRect(
DCHECK(layoutView);
RefPtr<ClipRects> parentClipRects = ClipRects::create();
- if (&m_layer == context.rootLayer)
+ if (&m_layer == context.rootLayer) {
parentClipRects->reset(LayoutRect(LayoutRect::infiniteIntRect()));
- else
- m_layer.parent()->clipper().getOrCalculateClipRects(context,
- *parentClipRects);
+ } else {
+ m_layer.parent()
+ ->clipper(m_geometryMapper)
+ .getOrCalculateClipRects(context, *parentClipRects);
+ }
ClipRect result = backgroundClipRectForPosition(
*parentClipRects, m_layer.layoutObject()->styleRef().position());

Powered by Google App Engine
This is Rietveld 408576698