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 "core/paint/ViewDisplayList.h" | 8 #include "core/paint/ViewDisplayList.h" |
9 #include "core/rendering/PaintPhase.h" | 9 #include "core/rendering/PaintPhase.h" |
10 #include "platform/geometry/RoundedRect.h" | 10 #include "platform/geometry/RoundedRect.h" |
11 #include "wtf/Vector.h" | 11 #include "wtf/Vector.h" |
12 | 12 |
13 namespace blink { | 13 namespace blink { |
14 | 14 |
15 class ClipRect; | 15 class ClipRect; |
16 class GraphicsContext; | 16 class GraphicsContext; |
17 class RenderObject; | 17 class RenderObject; |
18 class RenderLayer; | 18 class RenderLayer; |
19 | 19 |
20 class ClipDisplayItem : public DisplayItem { | 20 class ClipDisplayItem : public DisplayItem { |
21 public: | 21 public: |
22 ClipDisplayItem(RenderObject* renderer, RenderLayer*, Type type, IntRect cli pRect) | 22 ClipDisplayItem(const RenderObject* renderer, RenderLayer*, Type type, IntRe ct clipRect) |
leviw_travelin_and_unemployed
2014/11/13 01:46:40
This should be a RenderLayerModelObject.
pdr.
2014/11/13 06:49:29
Done
| |
23 : DisplayItem(renderer, type), m_clipRect(clipRect) { } | 23 : DisplayItem(renderer, type), m_clipRect(clipRect) { } |
24 | 24 |
25 Vector<RoundedRect>& roundedRectClips() { return m_roundedRectClips; } | 25 Vector<RoundedRect>& roundedRectClips() { return m_roundedRectClips; } |
26 | 26 |
27 private: | 27 private: |
28 virtual void replay(GraphicsContext*) override; | 28 virtual void replay(GraphicsContext*) override; |
29 | 29 |
30 IntRect m_clipRect; | 30 IntRect m_clipRect; |
31 Vector<RoundedRect> m_roundedRectClips; | 31 Vector<RoundedRect> m_roundedRectClips; |
32 #ifndef NDEBUG | 32 #ifndef NDEBUG |
33 virtual WTF::String asDebugString() const override; | 33 virtual WTF::String asDebugString() const override; |
34 #endif | 34 #endif |
35 }; | 35 }; |
36 | 36 |
37 class EndClipDisplayItem : public DisplayItem { | 37 class EndClipDisplayItem : public DisplayItem { |
38 public: | 38 public: |
39 EndClipDisplayItem() : DisplayItem(0, EndClip) { } | 39 EndClipDisplayItem(const RenderObject* renderer) : DisplayItem(renderer, End Clip) { } |
40 | 40 |
41 private: | 41 private: |
42 virtual void replay(GraphicsContext*) override; | 42 virtual void replay(GraphicsContext*) override; |
43 }; | 43 }; |
44 | 44 |
45 class ClipRecorder { | 45 class ClipRecorder { |
46 public: | 46 public: |
47 explicit ClipRecorder(RenderLayer*, GraphicsContext*, DisplayItem::Type, con st ClipRect&); | 47 explicit ClipRecorder(const RenderObject*, RenderLayer*, GraphicsContext*, D isplayItem::Type, const ClipRect&); |
48 void addRoundedRectClip(const RoundedRect&); | 48 void addRoundedRectClip(const RoundedRect&); |
49 | 49 |
50 ~ClipRecorder(); | 50 ~ClipRecorder(); |
51 | 51 |
52 private: | 52 private: |
53 ClipDisplayItem* m_clipDisplayItem; | 53 ClipDisplayItem* m_clipDisplayItem; |
54 GraphicsContext* m_graphicsContext; | 54 GraphicsContext* m_graphicsContext; |
55 RenderLayer* m_renderLayer; | 55 RenderLayer* m_renderLayer; |
leviw_travelin_and_unemployed
2014/11/13 01:46:40
We can kill the RenderLayer member, no?
pdr.
2014/11/13 06:49:29
R.I.P. RenderLayer member.
| |
56 const RenderObject* m_renderer; | |
56 }; | 57 }; |
57 | 58 |
58 } // namespace blink | 59 } // namespace blink |
59 | 60 |
60 #endif // ViewDisplayList_h | 61 #endif // ViewDisplayList_h |
OLD | NEW |