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