OLD | NEW |
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 ClipRecorder_h | 5 #ifndef ClipRecorder_h |
6 #define ClipRecorder_h | 6 #define ClipRecorder_h |
7 | 7 |
8 #include "platform/graphics/paint/DisplayItem.h" | 8 #include "core/paint/ViewDisplayList.h" |
| 9 #include "core/rendering/PaintPhase.h" |
| 10 #include "platform/geometry/RoundedRect.h" |
| 11 #include "wtf/Vector.h" |
9 | 12 |
10 namespace blink { | 13 namespace blink { |
11 | 14 |
12 class ClipDisplayItem; | |
13 class ClipRect; | 15 class ClipRect; |
14 class GraphicsContext; | 16 class GraphicsContext; |
| 17 class RenderObject; |
15 class RenderLayer; | 18 class RenderLayer; |
16 class RoundedRect; | 19 |
| 20 class ClipDisplayItem : public DisplayItem { |
| 21 public: |
| 22 ClipDisplayItem(RenderObject* renderer, RenderLayer*, Type type, IntRect cli
pRect) |
| 23 : DisplayItem(renderer, type), m_clipRect(clipRect) { } |
| 24 |
| 25 Vector<RoundedRect>& roundedRectClips() { return m_roundedRectClips; } |
| 26 |
| 27 private: |
| 28 virtual void replay(GraphicsContext*) override; |
| 29 |
| 30 IntRect m_clipRect; |
| 31 Vector<RoundedRect> m_roundedRectClips; |
| 32 #ifndef NDEBUG |
| 33 virtual WTF::String asDebugString() const override; |
| 34 #endif |
| 35 }; |
| 36 |
| 37 class EndClipDisplayItem : public DisplayItem { |
| 38 public: |
| 39 EndClipDisplayItem() : DisplayItem(0, EndClip) { } |
| 40 |
| 41 private: |
| 42 virtual void replay(GraphicsContext*) override; |
| 43 }; |
17 | 44 |
18 class ClipRecorder { | 45 class ClipRecorder { |
19 public: | 46 public: |
20 explicit ClipRecorder(RenderLayer*, GraphicsContext*, DisplayItem::Type, con
st ClipRect&); | 47 explicit ClipRecorder(RenderLayer*, GraphicsContext*, DisplayItem::Type, con
st ClipRect&); |
21 void addRoundedRectClip(const RoundedRect&); | 48 void addRoundedRectClip(const RoundedRect&); |
22 | 49 |
23 ~ClipRecorder(); | 50 ~ClipRecorder(); |
24 | 51 |
25 private: | 52 private: |
26 ClipDisplayItem* m_clipDisplayItem; | 53 ClipDisplayItem* m_clipDisplayItem; |
27 GraphicsContext* m_graphicsContext; | 54 GraphicsContext* m_graphicsContext; |
28 RenderLayer* m_renderLayer; | 55 RenderLayer* m_renderLayer; |
29 }; | 56 }; |
30 | 57 |
31 } // namespace blink | 58 } // namespace blink |
32 | 59 |
33 #endif // ClipRecorder_h | 60 #endif // ViewDisplayList_h |
OLD | NEW |