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 DrawingRecorder_h | 5 #ifndef DrawingRecorder_h |
6 #define DrawingRecorder_h | 6 #define DrawingRecorder_h |
7 | 7 |
8 #include "core/rendering/PaintPhase.h" | 8 #include "core/paint/ViewDisplayList.h" |
9 #include "platform/geometry/FloatRect.h" | 9 #include "platform/graphics/DisplayList.h" |
10 | 10 |
11 namespace blink { | 11 namespace blink { |
12 | 12 |
13 class GraphicsContext; | 13 class DrawingDisplayItem : public DisplayItem { |
14 class RenderObject; | 14 public: |
| 15 DrawingDisplayItem(PassRefPtr<SkPicture> picture, const FloatPoint& location
, PaintPhase phase, const RenderObject* renderer) |
| 16 : DisplayItem(renderer, (Type)phase), m_picture(picture), m_location(loc
ation) { } |
| 17 |
| 18 PassRefPtr<SkPicture> picture() const { return m_picture; } |
| 19 const FloatPoint& location() const { return m_location; } |
| 20 |
| 21 private: |
| 22 virtual void replay(GraphicsContext*); |
| 23 |
| 24 RefPtr<SkPicture> m_picture; |
| 25 const FloatPoint m_location; |
| 26 #ifndef NDEBUG |
| 27 virtual WTF::String asDebugString() const override; |
| 28 #endif |
| 29 }; |
| 30 |
15 | 31 |
16 class DrawingRecorder { | 32 class DrawingRecorder { |
17 public: | 33 public: |
18 explicit DrawingRecorder(GraphicsContext*, const RenderObject*, PaintPhase,
const FloatRect&); | 34 explicit DrawingRecorder(GraphicsContext*, const RenderObject*, PaintPhase,
const FloatRect&); |
19 ~DrawingRecorder(); | 35 ~DrawingRecorder(); |
20 | 36 |
21 private: | 37 private: |
22 GraphicsContext* m_context; | 38 GraphicsContext* m_context; |
23 const RenderObject* m_renderer; | 39 const RenderObject* m_renderer; |
24 const PaintPhase m_phase; | 40 const PaintPhase m_phase; |
25 const FloatRect m_bounds; | 41 const FloatRect m_bounds; |
26 }; | 42 }; |
27 | 43 |
28 } // namespace blink | 44 } // namespace blink |
29 | 45 |
30 #endif // DrawingRecorder_h | 46 #endif // DrawingRecorder_h |
OLD | NEW |