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

Side by Side Diff: third_party/WebKit/Source/core/paint/PaintLayerClipper.h

Issue 1907213002: Refactor OverlayScrollbarSizeRelevancy into OverlayScrollbarClipBehavior (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Include -> Exclude Created 4 years, 8 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 /* 1 /*
2 * Copyright (C) 2003, 2009, 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2003, 2009, 2012 Apple Inc. All rights reserved.
3 * Copyright (C) 2013 Intel Corporation. All rights reserved. 3 * Copyright (C) 2013 Intel Corporation. All rights reserved.
4 * 4 *
5 * Portions are Copyright (C) 1998 Netscape Communications Corporation. 5 * Portions are Copyright (C) 1998 Netscape Communications Corporation.
6 * 6 *
7 * Other contributors: 7 * Other contributors:
8 * Robert O'Callahan <roc+@cs.cmu.edu> 8 * Robert O'Callahan <roc+@cs.cmu.edu>
9 * David Baron <dbaron@fas.harvard.edu> 9 * David Baron <dbaron@fas.harvard.edu>
10 * Christian Biesinger <cbiesinger@web.de> 10 * Christian Biesinger <cbiesinger@web.de>
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 class PaintLayer; 54 class PaintLayer;
55 55
56 enum ShouldRespectOverflowClipType { 56 enum ShouldRespectOverflowClipType {
57 IgnoreOverflowClip, 57 IgnoreOverflowClip,
58 RespectOverflowClip 58 RespectOverflowClip
59 }; 59 };
60 60
61 class ClipRectsContext { 61 class ClipRectsContext {
62 STACK_ALLOCATED(); 62 STACK_ALLOCATED();
63 public: 63 public:
64 ClipRectsContext(const PaintLayer* root, ClipRectsCacheSlot slot, OverlayScr ollbarSizeRelevancy relevancy = IgnoreOverlayScrollbarSize, const LayoutSize& ac cumulation = LayoutSize()) 64 ClipRectsContext(const PaintLayer* root, ClipRectsCacheSlot slot, OverlayScr ollbarClipBehavior overlayScrollbarClipBehavior = IgnoreOverlayScrollbarSize, co nst LayoutSize& accumulation = LayoutSize())
65 : rootLayer(root) 65 : rootLayer(root)
66 , scrollbarRelevancy(relevancy) 66 , overlayScrollbarClipBehavior(overlayScrollbarClipBehavior)
67 , m_cacheSlot(slot) 67 , m_cacheSlot(slot)
68 , subPixelAccumulation(accumulation) 68 , subPixelAccumulation(accumulation)
69 , respectOverflowClip(slot == PaintingClipRectsIgnoringOverflowClip ? Ig noreOverflowClip : RespectOverflowClip) 69 , respectOverflowClip(slot == PaintingClipRectsIgnoringOverflowClip ? Ig noreOverflowClip : RespectOverflowClip)
70 , respectOverflowClipForViewport(slot == RootRelativeClipRectsIgnoringVi ewportClip ? IgnoreOverflowClip : RespectOverflowClip) 70 , respectOverflowClipForViewport(slot == RootRelativeClipRectsIgnoringVi ewportClip ? IgnoreOverflowClip : RespectOverflowClip)
71 { 71 {
72 } 72 }
73 73
74 void setIgnoreOverflowClip() 74 void setIgnoreOverflowClip()
75 { 75 {
76 ASSERT(!usesCache() || m_cacheSlot == PaintingClipRects); 76 ASSERT(!usesCache() || m_cacheSlot == PaintingClipRects);
77 ASSERT(respectOverflowClip == RespectOverflowClip); 77 ASSERT(respectOverflowClip == RespectOverflowClip);
78 if (usesCache()) 78 if (usesCache())
79 m_cacheSlot = PaintingClipRectsIgnoringOverflowClip; 79 m_cacheSlot = PaintingClipRectsIgnoringOverflowClip;
80 respectOverflowClip = IgnoreOverflowClip; 80 respectOverflowClip = IgnoreOverflowClip;
81 } 81 }
82 82
83 bool usesCache() const 83 bool usesCache() const
84 { 84 {
85 return m_cacheSlot != UncachedClipRects; 85 return m_cacheSlot != UncachedClipRects;
86 } 86 }
87 87
88 ClipRectsCacheSlot cacheSlot() const 88 ClipRectsCacheSlot cacheSlot() const
89 { 89 {
90 return m_cacheSlot; 90 return m_cacheSlot;
91 } 91 }
92 92
93 const PaintLayer* rootLayer; 93 const PaintLayer* rootLayer;
94 const OverlayScrollbarSizeRelevancy scrollbarRelevancy; 94 const OverlayScrollbarClipBehavior overlayScrollbarClipBehavior;
95 95
96 private: 96 private:
97 friend class PaintLayerClipper; 97 friend class PaintLayerClipper;
98 98
99 ClipRectsCacheSlot m_cacheSlot; 99 ClipRectsCacheSlot m_cacheSlot;
100 LayoutSize subPixelAccumulation; 100 LayoutSize subPixelAccumulation;
101 ShouldRespectOverflowClipType respectOverflowClip; 101 ShouldRespectOverflowClipType respectOverflowClip;
102 ShouldRespectOverflowClipType respectOverflowClipForViewport; 102 ShouldRespectOverflowClipType respectOverflowClipForViewport;
103 }; 103 };
104 104
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 void getOrCalculateClipRects(const ClipRectsContext&, ClipRects&) const; 179 void getOrCalculateClipRects(const ClipRectsContext&, ClipRects&) const;
180 180
181 bool shouldRespectOverflowClip(const ClipRectsContext&) const; 181 bool shouldRespectOverflowClip(const ClipRectsContext&) const;
182 182
183 const PaintLayer& m_layer; 183 const PaintLayer& m_layer;
184 }; 184 };
185 185
186 } // namespace blink 186 } // namespace blink
187 187
188 #endif // LayerClipper_h 188 #endif // LayerClipper_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698