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

Unified Diff: Source/core/layout/ClipRectsCache.h

Issue 1307203004: Revert "Reworks the clipping logic" and follow-up. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 3 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 | « Source/core/layout/ClipRects.h ('k') | Source/core/layout/compositing/CompositingInputsUpdater.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/ClipRectsCache.h
diff --git a/Source/core/layout/ClipRectsCache.h b/Source/core/layout/ClipRectsCache.h
index 9415dbc1107daba338f81557f63e5f1772db5c26..a3a6089d20e49ce69a7e9f271aab5fc37e52bb80 100644
--- a/Source/core/layout/ClipRectsCache.h
+++ b/Source/core/layout/ClipRectsCache.h
@@ -15,14 +15,12 @@ namespace blink {
class DeprecatedPaintLayer;
-// TODO: Because this is mostly empty, this should be moved to a better place
enum ClipRectsCacheSlot {
// Relative to the ancestor treated as the root (e.g. transformed layer). Used for hit testing.
RootRelativeClipRects,
RootRelativeClipRectsIgnoringViewportClip,
// Relative to the LayoutView's layer. Used for compositing overlap testing.
- // Computed during the compositing update step (see CompositingInputsUpdater::update).
AbsoluteClipRects,
// Relative to painting ancestor. Used for painting.
@@ -33,6 +31,37 @@ enum ClipRectsCacheSlot {
UncachedClipRects,
};
+class ClipRectsCache {
+ WTF_MAKE_FAST_ALLOCATED(ClipRectsCache);
+public:
+ struct Entry {
+ Entry()
+ : root(nullptr)
+#if ENABLE(ASSERT)
+ , scrollbarRelevancy(IgnoreOverlayScrollbarSize)
+#endif
+ {
+ }
+ const DeprecatedPaintLayer* root;
+ RefPtr<ClipRects> clipRects;
+#if ENABLE(ASSERT)
+ OverlayScrollbarSizeRelevancy scrollbarRelevancy;
+#endif
+ };
+ Entry& get(ClipRectsCacheSlot slot)
+ {
+ ASSERT(slot < NumberOfClipRectsCacheSlots);
+ return m_entries[slot];
+ }
+ void clear(ClipRectsCacheSlot slot)
+ {
+ ASSERT(slot < NumberOfClipRectsCacheSlots);
+ m_entries[slot] = Entry();
+ }
+private:
+ Entry m_entries[NumberOfClipRectsCacheSlots];
+};
+
} // namespace blink
#endif // ClipRectsCache_h
« no previous file with comments | « Source/core/layout/ClipRects.h ('k') | Source/core/layout/compositing/CompositingInputsUpdater.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698