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

Unified Diff: third_party/WebKit/Source/core/paint/PaintLayer.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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/paint/PaintLayer.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/PaintLayer.h
diff --git a/third_party/WebKit/Source/core/paint/PaintLayer.h b/third_party/WebKit/Source/core/paint/PaintLayer.h
index 8c2b35d8a551da15d2da44db6171c4b50e85b566..35dd58f1059c611844d8df226daa11c1e6c14062 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayer.h
+++ b/third_party/WebKit/Source/core/paint/PaintLayer.h
@@ -46,6 +46,7 @@
#define PaintLayer_h
#include "core/CoreExport.h"
+#include "core/layout/ClipRectsCache.h"
#include "core/layout/LayoutBox.h"
#include "core/paint/PaintLayerClipper.h"
#include "core/paint/PaintLayerFilterInfo.h"
@@ -497,8 +498,8 @@ public:
// FIXME: This should probably return a ScrollableArea but a lot of internal methods are mistakenly exposed.
PaintLayerScrollableArea* scrollableArea() const { return m_scrollableArea.get(); }
- PaintLayerClipper& clipper() { return m_clipper; }
- const PaintLayerClipper& clipper() const { return m_clipper; }
+
+ PaintLayerClipper clipper() const { return PaintLayerClipper(*this); }
bool scrollsOverflow() const;
@@ -650,7 +651,7 @@ public:
void setPreviousScrollOffsetAccumulationForPainting(const IntSize& s) { m_previousScrollOffsetAccumulationForPainting = s; }
ClipRects* previousPaintingClipRects() const { return m_previousPaintingClipRects.get(); }
- void setPreviousPaintingClipRects(ClipRects* clipRects) { m_previousPaintingClipRects = clipRects; }
+ void setPreviousPaintingClipRects(ClipRects& clipRects) { m_previousPaintingClipRects = &clipRects; }
LayoutRect previousPaintDirtyRect() const { return m_previousPaintDirtyRect; }
void setPreviousPaintDirtyRect(const LayoutRect& rect) { m_previousPaintDirtyRect = rect; }
@@ -665,6 +666,15 @@ public:
PaintTiming* paintTiming();
+ ClipRectsCache* clipRectsCache() const { return m_clipRectsCache.get(); }
+ ClipRectsCache& ensureClipRectsCache() const
+ {
+ if (!m_clipRectsCache)
+ m_clipRectsCache = adoptPtr(new ClipRectsCache);
+ return *m_clipRectsCache;
+ }
+ void clearClipRectsCache() const { m_clipRectsCache.clear(); }
+
private:
// Bounding box in the coordinates of this layer.
LayoutRect logicalBoundingBox() const;
@@ -835,7 +845,8 @@ private:
OwnPtrWillBePersistent<PaintLayerScrollableArea> m_scrollableArea;
- PaintLayerClipper m_clipper; // FIXME: Lazily allocate?
+ mutable OwnPtr<ClipRectsCache> m_clipRectsCache;
+
OwnPtr<PaintLayerStackingNode> m_stackingNode;
IntSize m_previousScrollOffsetAccumulationForPainting;
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/paint/PaintLayer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698