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

Side by Side Diff: third_party/WebKit/Source/core/layout/ClipRectsCache.h

Issue 2371523002: Apply SVG root viewport clips in PaintLayerClipper. (Closed)
Patch Set: none Created 4 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef ClipRectsCache_h 5 #ifndef ClipRectsCache_h
6 #define ClipRectsCache_h 6 #define ClipRectsCache_h
7 7
8 #include "core/layout/ClipRects.h" 8 #include "core/layout/ClipRects.h"
9 9
10 #if ENABLE(ASSERT) 10 #if DCHECK_IS_ON()
11 #include "core/layout/ScrollEnums.h" // For OverlayScrollbarClipBehavior. 11 #include "core/layout/ScrollEnums.h" // For OverlayScrollbarClipBehavior.
12 #endif 12 #endif
13 13
14 namespace blink { 14 namespace blink {
15 15
16 class PaintLayer; 16 class PaintLayer;
17 17
18 enum ClipRectsCacheSlot { 18 enum ClipRectsCacheSlot {
19 // Relative to the ancestor treated as the root (e.g. transformed layer). Us ed for hit testing. 19 // Relative to the ancestor treated as the root (e.g. transformed layer). Us ed for hit testing.
20 RootRelativeClipRects, 20 RootRelativeClipRects,
21 RootRelativeClipRectsIgnoringViewportClip, 21 RootRelativeClipRectsIgnoringViewportClip,
22 22
23 // Relative to the LayoutView's layer. Used for compositing overlap testing. 23 // Relative to the LayoutView's layer. Used for compositing overlap testing.
24 AbsoluteClipRects, 24 AbsoluteClipRects,
25 25
26 // Relative to painting ancestor. Used for painting. 26 // Relative to painting ancestor. Used for painting.
27 PaintingClipRects, 27 PaintingClipRects,
28 PaintingClipRectsIgnoringOverflowClip, 28 PaintingClipRectsIgnoringOverflowClip,
29 29
30 NumberOfClipRectsCacheSlots, 30 NumberOfClipRectsCacheSlots,
31 UncachedClipRects, 31 UncachedClipRects,
32 }; 32 };
33 33
34 class ClipRectsCache { 34 class ClipRectsCache {
35 USING_FAST_MALLOC(ClipRectsCache); 35 USING_FAST_MALLOC(ClipRectsCache);
36 public: 36 public:
37 struct Entry { 37 struct Entry {
38 Entry() 38 Entry()
39 : root(nullptr) 39 : root(nullptr)
40 #if ENABLE(ASSERT) 40 #if DCHECK_IS_ON()
41 , overlayScrollbarClipBehavior(IgnoreOverlayScrollbarSize) 41 , overlayScrollbarClipBehavior(IgnoreOverlayScrollbarSize)
42 #endif 42 #endif
43 { 43 {
44 } 44 }
45 const PaintLayer* root; 45 const PaintLayer* root;
46 RefPtr<ClipRects> clipRects; 46 RefPtr<ClipRects> clipRects;
47 #if ENABLE(ASSERT) 47 #if DCHECK_IS_ON()
48 OverlayScrollbarClipBehavior overlayScrollbarClipBehavior; 48 OverlayScrollbarClipBehavior overlayScrollbarClipBehavior;
49 #endif 49 #endif
50 }; 50 };
51 Entry& get(ClipRectsCacheSlot slot) 51 Entry& get(ClipRectsCacheSlot slot)
52 { 52 {
53 ASSERT(slot < NumberOfClipRectsCacheSlots); 53 DCHECK(slot < NumberOfClipRectsCacheSlots);
54 return m_entries[slot]; 54 return m_entries[slot];
55 } 55 }
56 void clear(ClipRectsCacheSlot slot) 56 void clear(ClipRectsCacheSlot slot)
57 { 57 {
58 ASSERT(slot < NumberOfClipRectsCacheSlots); 58 DCHECK(slot < NumberOfClipRectsCacheSlots);
59 m_entries[slot] = Entry(); 59 m_entries[slot] = Entry();
60 } 60 }
61 private: 61 private:
62 Entry m_entries[NumberOfClipRectsCacheSlots]; 62 Entry m_entries[NumberOfClipRectsCacheSlots];
63 }; 63 };
64 64
65 } // namespace blink 65 } // namespace blink
66 66
67 #endif // ClipRectsCache_h 67 #endif // ClipRectsCache_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/BUILD.gn ('k') | third_party/WebKit/Source/core/paint/PaintLayerClipper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698