| 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 | 20 |
| 21 class PLATFORM_EXPORT DrawingRecorder { | 21 class PLATFORM_EXPORT DrawingRecorder { |
| 22 public: | 22 public: |
| 23 DrawingRecorder(GraphicsContext&, const DisplayItemClientWrapper&, DisplayIt
em::Type); |
| 23 DrawingRecorder(GraphicsContext&, const DisplayItemClientWrapper&, DisplayIt
em::Type, const FloatRect& cullRect); | 24 DrawingRecorder(GraphicsContext&, const DisplayItemClientWrapper&, DisplayIt
em::Type, const FloatRect& cullRect); |
| 24 ~DrawingRecorder(); | 25 ~DrawingRecorder(); |
| 25 | 26 |
| 27 void begin(const FloatRect& cullRect); |
| 28 |
| 26 bool canUseCachedDrawing() const | 29 bool canUseCachedDrawing() const |
| 27 { | 30 { |
| 28 #if ENABLE(ASSERT) | 31 #if ENABLE(ASSERT) |
| 29 m_checkedCachedDrawing = true; | 32 m_checkedCachedDrawing = true; |
| 30 #endif | 33 #endif |
| 31 return m_canUseCachedDrawing; | 34 return m_canUseCachedDrawing; |
| 32 } | 35 } |
| 33 | 36 |
| 34 #if ENABLE(ASSERT) | 37 #if ENABLE(ASSERT) |
| 35 void setSkipUnderInvalidationChecking() { m_skipUnderInvalidationChecking =
true; } | 38 void setSkipUnderInvalidationChecking() { m_skipUnderInvalidationChecking =
true; } |
| 36 #endif | 39 #endif |
| 37 | 40 |
| 38 private: | 41 private: |
| 39 GraphicsContext& m_context; | 42 GraphicsContext& m_context; |
| 40 DisplayItemClientWrapper m_displayItemClient; | 43 DisplayItemClientWrapper m_displayItemClient; |
| 41 const DisplayItem::Type m_displayItemType; | 44 const DisplayItem::Type m_displayItemType; |
| 42 bool m_canUseCachedDrawing; | 45 bool m_canUseCachedDrawing; |
| 46 bool m_engaged; |
| 43 #if ENABLE(ASSERT) | 47 #if ENABLE(ASSERT) |
| 44 mutable bool m_checkedCachedDrawing; | 48 mutable bool m_checkedCachedDrawing; |
| 45 size_t m_displayItemPosition; | 49 size_t m_displayItemPosition; |
| 46 bool m_skipUnderInvalidationChecking; | 50 bool m_skipUnderInvalidationChecking; |
| 47 #endif | 51 #endif |
| 48 }; | 52 }; |
| 49 | 53 |
| 50 } // namespace blink | 54 } // namespace blink |
| 51 | 55 |
| 52 #endif // DrawingRecorder_h | 56 #endif // DrawingRecorder_h |
| OLD | NEW |