| 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/paint/ViewDisplayList.h" | 8 #include "core/rendering/PaintPhase.h" |
| 9 #include "platform/graphics/DisplayList.h" | 9 #include "platform/geometry/FloatRect.h" |
| 10 | 10 |
| 11 namespace blink { | 11 namespace blink { |
| 12 | 12 |
| 13 class DrawingDisplayItem : public DisplayItem { | 13 class GraphicsContext; |
| 14 public: | 14 class RenderObject; |
| 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 | |
| 31 | 15 |
| 32 class DrawingRecorder { | 16 class DrawingRecorder { |
| 33 public: | 17 public: |
| 34 explicit DrawingRecorder(GraphicsContext*, const RenderObject*, PaintPhase,
const FloatRect&); | 18 explicit DrawingRecorder(GraphicsContext*, const RenderObject*, PaintPhase,
const FloatRect&); |
| 35 ~DrawingRecorder(); | 19 ~DrawingRecorder(); |
| 36 | 20 |
| 37 private: | 21 private: |
| 38 GraphicsContext* m_context; | 22 GraphicsContext* m_context; |
| 39 const RenderObject* m_renderer; | 23 const RenderObject* m_renderer; |
| 40 const PaintPhase m_phase; | 24 const PaintPhase m_phase; |
| 41 const FloatRect m_bounds; | 25 const FloatRect m_bounds; |
| 42 }; | 26 }; |
| 43 | 27 |
| 44 } // namespace blink | 28 } // namespace blink |
| 45 | 29 |
| 46 #endif // DrawingRecorder_h | 30 #endif // DrawingRecorder_h |
| OLD | NEW |