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/PtrUtil.h" |
24 #include "wtf/Vector.h" | 24 #include "wtf/Vector.h" |
| 25 #include <memory> |
25 #include <utility> | 26 #include <utility> |
26 | 27 |
27 class SkPicture; | 28 class SkPicture; |
28 | 29 |
29 namespace blink { | 30 namespace blink { |
30 | 31 |
31 class GraphicsContext; | 32 class GraphicsContext; |
32 | 33 |
33 static const size_t kInitialDisplayItemListCapacityBytes = 512; | 34 static const size_t kInitialDisplayItemListCapacityBytes = 512; |
34 | 35 |
35 // Responsible for processing display items as they are produced, and producing | 36 // Responsible for processing display items as they are produced, and producing |
36 // 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, |
37 // cache invalidation, and merging. | 38 // cache invalidation, and merging. |
38 class PLATFORM_EXPORT PaintController { | 39 class PLATFORM_EXPORT PaintController { |
39 WTF_MAKE_NONCOPYABLE(PaintController); | 40 WTF_MAKE_NONCOPYABLE(PaintController); |
40 USING_FAST_MALLOC(PaintController); | 41 USING_FAST_MALLOC(PaintController); |
41 public: | 42 public: |
42 static PassOwnPtr<PaintController> create() | 43 static std::unique_ptr<PaintController> create() |
43 { | 44 { |
44 return adoptPtr(new PaintController()); | 45 return wrapUnique(new PaintController()); |
45 } | 46 } |
46 | 47 |
47 ~PaintController() | 48 ~PaintController() |
48 { | 49 { |
49 // New display items should be committed before PaintController is destr
ucted. | 50 // New display items should be committed before PaintController is destr
ucted. |
50 DCHECK(m_newDisplayItemList.isEmpty()); | 51 DCHECK(m_newDisplayItemList.isEmpty()); |
51 #if CHECK_DISPLAY_ITEM_CLIENT_ALIVENESS | 52 #if CHECK_DISPLAY_ITEM_CLIENT_ALIVENESS |
52 DisplayItemClient::endShouldKeepAliveAllClients(this); | 53 DisplayItemClient::endShouldKeepAliveAllClients(this); |
53 #endif | 54 #endif |
54 } | 55 } |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 | 220 |
220 #if CHECK_DISPLAY_ITEM_CLIENT_ALIVENESS | 221 #if CHECK_DISPLAY_ITEM_CLIENT_ALIVENESS |
221 // A stack recording subsequence clients that are currently painting. | 222 // A stack recording subsequence clients that are currently painting. |
222 Vector<const DisplayItemClient*> m_currentSubsequenceClients; | 223 Vector<const DisplayItemClient*> m_currentSubsequenceClients; |
223 #endif | 224 #endif |
224 }; | 225 }; |
225 | 226 |
226 } // namespace blink | 227 } // namespace blink |
227 | 228 |
228 #endif // PaintController_h | 229 #endif // PaintController_h |
OLD | NEW |