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 "platform/PlatformExport.h" | 8 #include "platform/PlatformExport.h" |
9 | 9 |
10 #include "platform/geometry/FloatRect.h" | 10 #include "platform/geometry/FloatRect.h" |
11 #include "platform/graphics/paint/DisplayItem.h" | 11 #include "platform/graphics/paint/DisplayItem.h" |
12 | 12 |
13 #ifndef NDEBUG | 13 #ifndef NDEBUG |
14 #include "wtf/text/WTFString.h" | 14 #include "wtf/text/WTFString.h" |
15 #endif | 15 #endif |
16 | 16 |
17 namespace blink { | 17 namespace blink { |
18 | 18 |
19 class GraphicsContext; | 19 class GraphicsContext; |
20 class RenderObject; | |
21 | 20 |
22 class PLATFORM_EXPORT DrawingRecorder { | 21 class PLATFORM_EXPORT DrawingRecorder { |
23 public: | 22 public: |
24 explicit DrawingRecorder(GraphicsContext*, const DisplayItemClient, DisplayI
tem::Type, const FloatRect& bounds); | 23 explicit DrawingRecorder(GraphicsContext*, const DisplayItemClient, DisplayI
tem::Type, const FloatRect& bounds); |
25 | 24 |
26 ~DrawingRecorder(); | 25 ~DrawingRecorder(); |
27 | 26 |
28 bool canUseCachedDrawing() const { return m_canUseCachedDrawing; } | 27 bool canUseCachedDrawing() const { return m_canUseCachedDrawing; } |
29 | 28 |
30 #ifndef NDEBUG | 29 #ifndef NDEBUG |
31 void setClientDebugString(const WTF::String&); | 30 void setClientDebugString(const WTF::String&); |
32 #endif | 31 #endif |
33 | 32 |
34 private: | 33 private: |
35 GraphicsContext* m_context; | 34 GraphicsContext* m_context; |
36 DisplayItemClient m_displayItemClient; | 35 DisplayItemClient m_displayItemClient; |
37 const DisplayItem::Type m_displayItemType; | 36 const DisplayItem::Type m_displayItemType; |
38 const FloatRect m_bounds; | 37 const FloatRect m_bounds; |
39 bool m_canUseCachedDrawing; | 38 bool m_canUseCachedDrawing; |
40 #ifndef NDEBUG | 39 #ifndef NDEBUG |
41 WTF::String m_clientDebugString; | 40 WTF::String m_clientDebugString; |
42 #endif | 41 #endif |
43 }; | 42 }; |
44 | 43 |
45 } // namespace blink | 44 } // namespace blink |
46 | 45 |
47 #endif // DrawingRecorder_h | 46 #endif // DrawingRecorder_h |
OLD | NEW |