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

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

Issue 1640843003: Make PaintLayerClipper objects transient (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@PaintLayerRareData
Patch Set: Inline PaintLayerClipper ctor Created 4 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
Index: third_party/WebKit/Source/core/paint/PaintLayerClipper.h
diff --git a/third_party/WebKit/Source/core/paint/PaintLayerClipper.h b/third_party/WebKit/Source/core/paint/PaintLayerClipper.h
index b891d05222db98a383ee2e5319610af3868a5f5d..733396df3f6a086413106505178b00630865060a 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayerClipper.h
+++ b/third_party/WebKit/Source/core/paint/PaintLayerClipper.h
@@ -149,9 +149,8 @@ private:
// a layout tree walk and cache them for painting.
class CORE_EXPORT PaintLayerClipper {
DISALLOW_NEW();
- WTF_MAKE_NONCOPYABLE(PaintLayerClipper);
public:
- explicit PaintLayerClipper(const LayoutBoxModelObject&);
+ explicit PaintLayerClipper(const PaintLayer& layer) : m_layer(layer) { }
void clearClipRectsIncludingDescendants();
void clearClipRectsIncludingDescendants(ClipRectsCacheSlot);
@@ -168,37 +167,20 @@ public:
void calculateRects(const ClipRectsContext&, const LayoutRect& paintDirtyRect, LayoutRect& layerBounds,
ClipRect& backgroundRect, ClipRect& foregroundRect, const LayoutPoint* offsetFromRoot = 0) const;
- ClipRects* paintingClipRects(const PaintLayer* rootLayer, ShouldRespectOverflowClip, const LayoutSize& subpixelAccumulation) const;
+ ClipRects& paintingClipRects(const PaintLayer* rootLayer, ShouldRespectOverflowClip, const LayoutSize& subpixelAccumulation) const;
private:
- ClipRects* getClipRects(const ClipRectsContext&) const;
+ ClipRects& getClipRects(const ClipRectsContext&) const;
void calculateClipRects(const ClipRectsContext&, ClipRects&) const;
ClipRects* clipRectsIfCached(const ClipRectsContext&) const;
- ClipRects* storeClipRectsInCache(const ClipRectsContext&, ClipRects* parentClipRects, const ClipRects&) const;
+ ClipRects& storeClipRectsInCache(const ClipRectsContext&, ClipRects* parentClipRects, const ClipRects&) const;
- // cachedClipRects looks buggy: It doesn't check whether context.rootLayer and entry.root match.
- // FIXME: Move callers to clipRectsIfCached, which does the proper checks.
- ClipRects* cachedClipRects(const ClipRectsContext& context) const
- {
- return m_cache ? m_cache->get(context.cacheSlot()).clipRects.get() : 0;
- }
void getOrCalculateClipRects(const ClipRectsContext&, ClipRects&) const;
- ClipRectsCache& cache() const
- {
- if (!m_cache)
- m_cache = adoptPtr(new ClipRectsCache);
- return *m_cache;
- }
-
bool shouldRespectOverflowClip(const ClipRectsContext&) const;
- // FIXME: Could this be a LayoutBox?
- const LayoutBoxModelObject& m_layoutObject;
-
- // Lazily created by 'cache() const'.
- mutable OwnPtr<ClipRectsCache> m_cache;
+ const PaintLayer& m_layer;
};
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintLayer.cpp ('k') | third_party/WebKit/Source/core/paint/PaintLayerClipper.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698