| 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 PaintController_h | 5 #ifndef PaintController_h |
| 6 #define PaintController_h | 6 #define PaintController_h |
| 7 | 7 |
| 8 #include "platform/PlatformExport.h" | 8 #include "platform/PlatformExport.h" |
| 9 #include "platform/RuntimeEnabledFeatures.h" | 9 #include "platform/RuntimeEnabledFeatures.h" |
| 10 #include "platform/geometry/IntRect.h" | 10 #include "platform/geometry/IntRect.h" |
| 11 #include "platform/geometry/LayoutPoint.h" | 11 #include "platform/geometry/LayoutPoint.h" |
| 12 #include "platform/graphics/ContiguousContainer.h" | 12 #include "platform/graphics/ContiguousContainer.h" |
| 13 #include "platform/graphics/paint/DisplayItem.h" | 13 #include "platform/graphics/paint/DisplayItem.h" |
| 14 #include "platform/graphics/paint/DisplayItemList.h" | 14 #include "platform/graphics/paint/DisplayItemList.h" |
| 15 #include "platform/graphics/paint/PaintArtifact.h" | 15 #include "platform/graphics/paint/PaintArtifact.h" |
| 16 #include "platform/graphics/paint/PaintChunk.h" | 16 #include "platform/graphics/paint/PaintChunk.h" |
| 17 #include "platform/graphics/paint/PaintChunker.h" | 17 #include "platform/graphics/paint/PaintChunker.h" |
| 18 #include "platform/graphics/paint/Transform3DDisplayItem.h" | 18 #include "platform/graphics/paint/Transform3DDisplayItem.h" |
| 19 #include "wtf/Alignment.h" | 19 #include "wtf/Alignment.h" |
| 20 #include "wtf/Assertions.h" | 20 #include "wtf/Assertions.h" |
| 21 #include "wtf/HashMap.h" | 21 #include "wtf/HashMap.h" |
| 22 #include "wtf/HashSet.h" | 22 #include "wtf/HashSet.h" |
| 23 #include "wtf/PassOwnPtr.h" | 23 #include "wtf/PassOwnPtr.h" |
| 24 #include "wtf/Vector.h" | 24 #include "wtf/Vector.h" |
| 25 #include <utility> | 25 #include <utility> |
| 26 | 26 |
| 27 class SkPicture; |
| 28 |
| 27 namespace blink { | 29 namespace blink { |
| 28 | 30 |
| 29 class GraphicsContext; | 31 class GraphicsContext; |
| 30 | 32 |
| 31 static const size_t kInitialDisplayItemListCapacityBytes = 512; | 33 static const size_t kInitialDisplayItemListCapacityBytes = 512; |
| 32 | 34 |
| 33 // Responsible for processing display items as they are produced, and producing | 35 // Responsible for processing display items as they are produced, and producing |
| 34 // a final paint artifact when complete. This class includes logic for caching, | 36 // a final paint artifact when complete. This class includes logic for caching, |
| 35 // cache invalidation, and merging. | 37 // cache invalidation, and merging. |
| 36 class PLATFORM_EXPORT PaintController { | 38 class PLATFORM_EXPORT PaintController { |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 | 134 |
| 133 bool textPainted() const { return m_textPainted; } | 135 bool textPainted() const { return m_textPainted; } |
| 134 void setTextPainted() { m_textPainted = true; } | 136 void setTextPainted() { m_textPainted = true; } |
| 135 bool imagePainted() const { return m_imagePainted; } | 137 bool imagePainted() const { return m_imagePainted; } |
| 136 void setImagePainted() { m_imagePainted = true; } | 138 void setImagePainted() { m_imagePainted = true; } |
| 137 | 139 |
| 138 // Returns displayItemList added using createAndAppend() since beginning or | 140 // Returns displayItemList added using createAndAppend() since beginning or |
| 139 // the last commitNewDisplayItems(). Use with care. | 141 // the last commitNewDisplayItems(). Use with care. |
| 140 DisplayItemList& newDisplayItemList() { return m_newDisplayItemList; } | 142 DisplayItemList& newDisplayItemList() { return m_newDisplayItemList; } |
| 141 | 143 |
| 144 void appendDebugDrawingAfterCommit(const DisplayItemClient&, PassRefPtr<SkPi
cture>, const LayoutSize& offsetFromLayoutObject); |
| 145 |
| 142 #ifndef NDEBUG | 146 #ifndef NDEBUG |
| 143 void showDebugData() const; | 147 void showDebugData() const; |
| 144 #endif | 148 #endif |
| 145 | 149 |
| 146 // This is called only if we are tracking paint invalidation for testing, or
DCHECK_IS_ON() | 150 // This is called only if we are tracking paint invalidation for testing, or
DCHECK_IS_ON() |
| 147 // for error checking and debugging. | 151 // for error checking and debugging. |
| 148 void displayItemClientWasInvalidated(const DisplayItemClient&); | 152 void displayItemClientWasInvalidated(const DisplayItemClient&); |
| 149 | 153 |
| 150 #if DCHECK_IS_ON() | 154 #if DCHECK_IS_ON() |
| 151 bool hasInvalidations() { return !m_invalidations.isEmpty(); } | 155 bool hasInvalidations() { return !m_invalidations.isEmpty(); } |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 // easily find where the duplicated ids are from. | 238 // easily find where the duplicated ids are from. |
| 235 DisplayItemIndicesByClientMap m_newDisplayItemIndicesByClient; | 239 DisplayItemIndicesByClientMap m_newDisplayItemIndicesByClient; |
| 236 #endif | 240 #endif |
| 237 | 241 |
| 238 DisplayItemCacheGeneration m_currentCacheGeneration; | 242 DisplayItemCacheGeneration m_currentCacheGeneration; |
| 239 }; | 243 }; |
| 240 | 244 |
| 241 } // namespace blink | 245 } // namespace blink |
| 242 | 246 |
| 243 #endif // PaintController_h | 247 #endif // PaintController_h |
| OLD | NEW |