OLD | NEW |
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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 #ifndef SKY_ENGINE_CORE_RENDERING_RENDERLAYERCLIPPER_H_ | 45 #ifndef SKY_ENGINE_CORE_RENDERING_RENDERLAYERCLIPPER_H_ |
46 #define SKY_ENGINE_CORE_RENDERING_RENDERLAYERCLIPPER_H_ | 46 #define SKY_ENGINE_CORE_RENDERING_RENDERLAYERCLIPPER_H_ |
47 | 47 |
48 #include "sky/engine/core/rendering/ClipRectsCache.h" | 48 #include "sky/engine/core/rendering/ClipRectsCache.h" |
49 #include "sky/engine/core/rendering/RenderBox.h" | 49 #include "sky/engine/core/rendering/RenderBox.h" |
50 | 50 |
51 namespace blink { | 51 namespace blink { |
52 | 52 |
53 class RenderLayer; | 53 class RenderLayer; |
54 | 54 |
55 enum ShouldRespectOverflowClip { | |
56 IgnoreOverflowClip, | |
57 RespectOverflowClip | |
58 }; | |
59 | |
60 class ClipRectsContext { | 55 class ClipRectsContext { |
61 public: | 56 public: |
62 ClipRectsContext(const RenderLayer* root, ClipRectsCacheSlot slot, const Lay
outSize& accumulation = LayoutSize()) | 57 ClipRectsContext(const RenderLayer* root, ClipRectsCacheSlot slot, const Lay
outSize& accumulation = LayoutSize()) |
63 : rootLayer(root) | 58 : rootLayer(root) |
64 , cacheSlot(slot) | 59 , cacheSlot(slot) |
65 , subPixelAccumulation(accumulation) | 60 , subPixelAccumulation(accumulation) |
66 , respectOverflowClip(slot == PaintingClipRectsIgnoringOverflowClip ? Ig
noreOverflowClip : RespectOverflowClip) | |
67 { | 61 { |
68 } | 62 } |
69 | 63 |
70 void setIgnoreOverflowClip() | |
71 { | |
72 ASSERT(!usesCache() || cacheSlot == PaintingClipRects); | |
73 ASSERT(respectOverflowClip == RespectOverflowClip); | |
74 if (usesCache()) | |
75 cacheSlot = PaintingClipRectsIgnoringOverflowClip; | |
76 respectOverflowClip = IgnoreOverflowClip; | |
77 } | |
78 | |
79 bool usesCache() const | 64 bool usesCache() const |
80 { | 65 { |
81 return cacheSlot != UncachedClipRects; | 66 return cacheSlot != UncachedClipRects; |
82 } | 67 } |
83 | 68 |
84 const RenderLayer* const rootLayer; | 69 const RenderLayer* const rootLayer; |
85 | 70 |
86 private: | 71 private: |
87 friend class RenderLayerClipper; | 72 friend class RenderLayerClipper; |
88 | 73 |
89 ClipRectsCacheSlot cacheSlot; | 74 ClipRectsCacheSlot cacheSlot; |
90 LayoutSize subPixelAccumulation; | 75 LayoutSize subPixelAccumulation; |
91 ShouldRespectOverflowClip respectOverflowClip; | |
92 }; | 76 }; |
93 | 77 |
94 class RenderLayerClipper { | 78 class RenderLayerClipper { |
95 WTF_MAKE_NONCOPYABLE(RenderLayerClipper); | 79 WTF_MAKE_NONCOPYABLE(RenderLayerClipper); |
96 public: | 80 public: |
97 explicit RenderLayerClipper(RenderLayerModelObject&); | 81 explicit RenderLayerClipper(RenderLayerModelObject&); |
98 | 82 |
99 void clearClipRectsIncludingDescendants(); | 83 void clearClipRectsIncludingDescendants(); |
100 void clearClipRectsIncludingDescendants(ClipRectsCacheSlot); | 84 void clearClipRectsIncludingDescendants(ClipRectsCacheSlot); |
101 | 85 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 } | 122 } |
139 | 123 |
140 // FIXME: Could this be a RenderBox? | 124 // FIXME: Could this be a RenderBox? |
141 RenderLayerModelObject& m_renderer; | 125 RenderLayerModelObject& m_renderer; |
142 mutable OwnPtr<ClipRectsCache> m_cache; | 126 mutable OwnPtr<ClipRectsCache> m_cache; |
143 }; | 127 }; |
144 | 128 |
145 } // namespace blink | 129 } // namespace blink |
146 | 130 |
147 #endif // SKY_ENGINE_CORE_RENDERING_RENDERLAYERCLIPPER_H_ | 131 #endif // SKY_ENGINE_CORE_RENDERING_RENDERLAYERCLIPPER_H_ |
OLD | NEW |