| 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/DrawingDisplayItem.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, const FloatRect& cullRect); | 23 DrawingRecorder(GraphicsContext&, const DisplayItemClientWrapper&, DisplayIt
em::Type, const FloatRect& cullRect); |
| 24 ~DrawingRecorder(); | 24 ~DrawingRecorder(); |
| 25 | 25 |
| 26 bool canUseCachedDrawing() const | 26 bool canUseCachedDrawing() const |
| 27 { | 27 { |
| 28 #if ENABLE(ASSERT) | 28 #if ENABLE(ASSERT) |
| 29 m_checkedCachedDrawing = true; | 29 m_checkedCachedDrawing = true; |
| 30 #endif | 30 #endif |
| 31 return m_canUseCachedDrawing; | 31 return m_canUseCachedDrawing; |
| 32 } | 32 } |
| 33 | 33 |
| 34 #if ENABLE(ASSERT) | 34 #if ENABLE(ASSERT) |
| 35 void setSkipUnderInvalidationChecking() { m_skipUnderInvalidationChecking =
true; } | 35 void setUnderInvalidationCheckingMode(DrawingDisplayItem::UnderInvalidationC
heckingMode mode) { m_underInvalidationCheckingMode = mode; } |
| 36 #endif | 36 #endif |
| 37 | 37 |
| 38 private: | 38 private: |
| 39 GraphicsContext& m_context; | 39 GraphicsContext& m_context; |
| 40 DisplayItemClientWrapper m_displayItemClient; | 40 DisplayItemClientWrapper m_displayItemClient; |
| 41 const DisplayItem::Type m_displayItemType; | 41 const DisplayItem::Type m_displayItemType; |
| 42 bool m_canUseCachedDrawing; | 42 bool m_canUseCachedDrawing; |
| 43 #if ENABLE(ASSERT) | 43 #if ENABLE(ASSERT) |
| 44 mutable bool m_checkedCachedDrawing; | 44 mutable bool m_checkedCachedDrawing; |
| 45 size_t m_displayItemPosition; | 45 size_t m_displayItemPosition; |
| 46 bool m_skipUnderInvalidationChecking; | 46 DrawingDisplayItem::UnderInvalidationCheckingMode m_underInvalidationCheckin
gMode; |
| 47 #endif | 47 #endif |
| 48 }; | 48 }; |
| 49 | 49 |
| 50 } // namespace blink | 50 } // namespace blink |
| 51 | 51 |
| 52 #endif // DrawingRecorder_h | 52 #endif // DrawingRecorder_h |
| OLD | NEW |