| 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/GraphicsContext.h" | 11 #include "platform/graphics/GraphicsContext.h" |
| 12 #include "platform/graphics/paint/DrawingDisplayItem.h" | 12 #include "platform/graphics/paint/DrawingDisplayItem.h" |
| 13 #include "platform/graphics/paint/PaintController.h" | 13 #include "platform/graphics/paint/PaintController.h" |
| 14 #include "wtf/Allocator.h" | 14 #include "wtf/Allocator.h" |
| 15 #include "wtf/AutoReset.h" |
| 15 #include "wtf/Noncopyable.h" | 16 #include "wtf/Noncopyable.h" |
| 16 | 17 |
| 17 #ifndef NDEBUG | 18 #ifndef NDEBUG |
| 18 #include "wtf/text/WTFString.h" | 19 #include "wtf/text/WTFString.h" |
| 19 #endif | 20 #endif |
| 20 | 21 |
| 21 namespace blink { | 22 namespace blink { |
| 22 | 23 |
| 23 class GraphicsContext; | 24 class GraphicsContext; |
| 24 | 25 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 47 | 48 |
| 48 private: | 49 private: |
| 49 GraphicsContext& m_context; | 50 GraphicsContext& m_context; |
| 50 const DisplayItemClient& m_displayItemClient; | 51 const DisplayItemClient& m_displayItemClient; |
| 51 const DisplayItem::Type m_displayItemType; | 52 const DisplayItem::Type m_displayItemType; |
| 52 | 53 |
| 53 // True if there are no transparent areas. Only used for SlimmingPaintV2. | 54 // True if there are no transparent areas. Only used for SlimmingPaintV2. |
| 54 bool m_knownToBeOpaque; | 55 bool m_knownToBeOpaque; |
| 55 | 56 |
| 56 #if DCHECK_IS_ON() | 57 #if DCHECK_IS_ON() |
| 57 size_t m_displayItemPosition; | 58 // Ensures the list size does not change during the recorder's scope. |
| 59 size_t m_initialDisplayItemListSize; |
| 58 #endif | 60 #endif |
| 59 }; | 61 }; |
| 60 | 62 |
| 63 #if DCHECK_IS_ON() |
| 64 class DisableListModificationCheck { |
| 65 STACK_ALLOCATED(); |
| 66 WTF_MAKE_NONCOPYABLE(DisableListModificationCheck); |
| 67 |
| 68 public: |
| 69 DisableListModificationCheck(); |
| 70 |
| 71 private: |
| 72 AutoReset<bool> m_disabler; |
| 73 }; |
| 74 #endif // DCHECK_IS_ON() |
| 75 |
| 61 } // namespace blink | 76 } // namespace blink |
| 62 | 77 |
| 63 #endif // DrawingRecorder_h | 78 #endif // DrawingRecorder_h |
| OLD | NEW |