| 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/DrawingDisplayItem.h" | 11 #include "platform/graphics/paint/DrawingDisplayItem.h" |
| 12 #include "wtf/Allocator.h" | 12 #include "wtf/Allocator.h" |
| 13 #include "wtf/Noncopyable.h" | 13 #include "wtf/Noncopyable.h" |
| 14 | 14 |
| 15 #ifndef NDEBUG | 15 #ifndef NDEBUG |
| 16 #include "wtf/text/WTFString.h" | 16 #include "wtf/text/WTFString.h" |
| 17 #endif | 17 #endif |
| 18 | 18 |
| 19 namespace blink { | 19 namespace blink { |
| 20 | 20 |
| 21 class GraphicsContext; | 21 class GraphicsContext; |
| 22 | 22 |
| 23 class PLATFORM_EXPORT DrawingRecorder final { | 23 class PLATFORM_EXPORT DrawingRecorder final { |
| 24 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); | 24 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); |
| 25 WTF_MAKE_NONCOPYABLE(DrawingRecorder); | 25 WTF_MAKE_NONCOPYABLE(DrawingRecorder); |
| 26 public: | 26 public: |
| 27 static bool useCachedDrawingIfPossible(GraphicsContext&, const DisplayItemCl
ientWrapper&, DisplayItem::Type); | 27 static bool useCachedDrawingIfPossible(GraphicsContext&, const DisplayItemCl
ient&, DisplayItem::Type); |
| 28 | 28 |
| 29 DrawingRecorder(GraphicsContext&, const DisplayItemClientWrapper&, DisplayIt
em::Type, const FloatRect& cullRect); | 29 DrawingRecorder(GraphicsContext&, const DisplayItemClient&, DisplayItem::Typ
e, const FloatRect& cullRect); |
| 30 ~DrawingRecorder(); | 30 ~DrawingRecorder(); |
| 31 | 31 |
| 32 #if ENABLE(ASSERT) | 32 #if ENABLE(ASSERT) |
| 33 void setUnderInvalidationCheckingMode(DrawingDisplayItem::UnderInvalidationC
heckingMode mode) { m_underInvalidationCheckingMode = mode; } | 33 void setUnderInvalidationCheckingMode(DrawingDisplayItem::UnderInvalidationC
heckingMode mode) { m_underInvalidationCheckingMode = mode; } |
| 34 #endif | 34 #endif |
| 35 | 35 |
| 36 private: | 36 private: |
| 37 GraphicsContext& m_context; | 37 GraphicsContext& m_context; |
| 38 DisplayItemClientWrapper m_displayItemClient; | 38 const DisplayItemClient& m_displayItemClient; |
| 39 const DisplayItem::Type m_displayItemType; | 39 const DisplayItem::Type m_displayItemType; |
| 40 #if ENABLE(ASSERT) | 40 #if ENABLE(ASSERT) |
| 41 size_t m_displayItemPosition; | 41 size_t m_displayItemPosition; |
| 42 DrawingDisplayItem::UnderInvalidationCheckingMode m_underInvalidationCheckin
gMode; | 42 DrawingDisplayItem::UnderInvalidationCheckingMode m_underInvalidationCheckin
gMode; |
| 43 #endif | 43 #endif |
| 44 }; | 44 }; |
| 45 | 45 |
| 46 } // namespace blink | 46 } // namespace blink |
| 47 | 47 |
| 48 #endif // DrawingRecorder_h | 48 #endif // DrawingRecorder_h |
| OLD | NEW |