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/RasterInvalidationTracking.h" | 18 #include "platform/graphics/paint/RasterInvalidationTracking.h" |
19 #include "platform/graphics/paint/Transform3DDisplayItem.h" | 19 #include "platform/graphics/paint/Transform3DDisplayItem.h" |
20 #include "third_party/skia/include/core/SkRefCnt.h" | 20 #include "third_party/skia/include/core/SkRefCnt.h" |
21 #include "wtf/Alignment.h" | 21 #include "wtf/Alignment.h" |
22 #include "wtf/Assertions.h" | 22 #include "wtf/Assertions.h" |
23 #include "wtf/HashMap.h" | 23 #include "wtf/HashMap.h" |
24 #include "wtf/HashSet.h" | 24 #include "wtf/HashSet.h" |
25 #include "wtf/PtrUtil.h" | 25 #include "wtf/PtrUtil.h" |
26 #include "wtf/Vector.h" | 26 #include "wtf/Vector.h" |
27 #include <memory> | 27 #include <memory> |
28 #include <utility> | 28 #include <utility> |
29 | 29 |
30 class SkPicture; | |
31 | |
32 namespace blink { | 30 namespace blink { |
33 | 31 |
34 static const size_t kInitialDisplayItemListCapacityBytes = 512; | 32 static const size_t kInitialDisplayItemListCapacityBytes = 512; |
35 | 33 |
36 template class RasterInvalidationTrackingMap<const PaintChunk>; | 34 template class RasterInvalidationTrackingMap<const PaintChunk>; |
37 | 35 |
38 // Responsible for processing display items as they are produced, and producing | 36 // Responsible for processing display items as they are produced, and producing |
39 // a final paint artifact when complete. This class includes logic for caching, | 37 // a final paint artifact when complete. This class includes logic for caching, |
40 // cache invalidation, and merging. | 38 // cache invalidation, and merging. |
41 class PLATFORM_EXPORT PaintController { | 39 class PLATFORM_EXPORT PaintController { |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 bool textPainted() const { return m_textPainted; } | 163 bool textPainted() const { return m_textPainted; } |
166 void setTextPainted() { m_textPainted = true; } | 164 void setTextPainted() { m_textPainted = true; } |
167 bool imagePainted() const { return m_imagePainted; } | 165 bool imagePainted() const { return m_imagePainted; } |
168 void setImagePainted() { m_imagePainted = true; } | 166 void setImagePainted() { m_imagePainted = true; } |
169 | 167 |
170 // Returns displayItemList added using createAndAppend() since beginning or | 168 // Returns displayItemList added using createAndAppend() since beginning or |
171 // the last commitNewDisplayItems(). Use with care. | 169 // the last commitNewDisplayItems(). Use with care. |
172 DisplayItemList& newDisplayItemList() { return m_newDisplayItemList; } | 170 DisplayItemList& newDisplayItemList() { return m_newDisplayItemList; } |
173 | 171 |
174 void appendDebugDrawingAfterCommit(const DisplayItemClient&, | 172 void appendDebugDrawingAfterCommit(const DisplayItemClient&, |
175 sk_sp<SkPicture>, | 173 sk_sp<PaintRecord>, |
176 const LayoutSize& offsetFromLayoutObject); | 174 const LayoutSize& offsetFromLayoutObject); |
177 | 175 |
178 void showDebugData() const { showDebugDataInternal(false); } | 176 void showDebugData() const { showDebugDataInternal(false); } |
179 #ifndef NDEBUG | 177 #ifndef NDEBUG |
180 void showDebugDataWithPictures() const { showDebugDataInternal(true); } | 178 void showDebugDataWithPictures() const { showDebugDataInternal(true); } |
181 #endif | 179 #endif |
182 | 180 |
183 #if DCHECK_IS_ON() | 181 #if DCHECK_IS_ON() |
184 void assertDisplayItemClientsAreLive(); | 182 void assertDisplayItemClientsAreLive(); |
185 | 183 |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 | 374 |
377 #if CHECK_DISPLAY_ITEM_CLIENT_ALIVENESS | 375 #if CHECK_DISPLAY_ITEM_CLIENT_ALIVENESS |
378 // A stack recording subsequence clients that are currently painting. | 376 // A stack recording subsequence clients that are currently painting. |
379 Vector<const DisplayItemClient*> m_currentSubsequenceClients; | 377 Vector<const DisplayItemClient*> m_currentSubsequenceClients; |
380 #endif | 378 #endif |
381 }; | 379 }; |
382 | 380 |
383 } // namespace blink | 381 } // namespace blink |
384 | 382 |
385 #endif // PaintController_h | 383 #endif // PaintController_h |
OLD | NEW |