Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(750)

Side by Side Diff: third_party/WebKit/Source/platform/graphics/paint/PaintController.h

Issue 2116693002: PaintChunk::id (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@CommitOnTheWay
Patch Set: Address chrishtr's comments. Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 DisplayItemClient::endShouldKeepAliveAllClients(this); 53 DisplayItemClient::endShouldKeepAliveAllClients(this);
54 #endif 54 #endif
55 } 55 }
56 56
57 void invalidateAll(); 57 void invalidateAll();
58 58
59 // These methods are called during painting. 59 // These methods are called during painting.
60 60
61 // Provide a new set of paint chunk properties to apply to recorded display 61 // Provide a new set of paint chunk properties to apply to recorded display
62 // items, for Slimming Paint v2. 62 // items, for Slimming Paint v2.
63 void updateCurrentPaintChunkProperties(const PaintChunkProperties&); 63 void updateCurrentPaintChunkProperties(const PaintChunk::Id*, const PaintChu nkProperties&);
64 64
65 // Retrieve the current paint properties. 65 // Retrieve the current paint properties.
66 const PaintChunkProperties& currentPaintChunkProperties() const; 66 const PaintChunkProperties& currentPaintChunkProperties() const;
67 67
68 template <typename DisplayItemClass, typename... Args> 68 template <typename DisplayItemClass, typename... Args>
69 void createAndAppend(Args&&... args) 69 void createAndAppend(Args&&... args)
70 { 70 {
71 static_assert(WTF::IsSubclass<DisplayItemClass, DisplayItem>::value, 71 static_assert(WTF::IsSubclass<DisplayItemClass, DisplayItem>::value,
72 "Can only createAndAppend subclasses of DisplayItem."); 72 "Can only createAndAppend subclasses of DisplayItem.");
73 static_assert(sizeof(DisplayItemClass) <= kMaximumDisplayItemSize, 73 static_assert(sizeof(DisplayItemClass) <= kMaximumDisplayItemSize,
(...skipping 30 matching lines...) Expand all
104 // Tries to find the cached subsequence corresponding to the given parameter s. If found, copies the 104 // Tries to find the cached subsequence corresponding to the given parameter s. If found, copies the
105 // cache subsequence to the new display list and returns true. Otherwise ret urns false. 105 // cache subsequence to the new display list and returns true. Otherwise ret urns false.
106 bool useCachedSubsequenceIfPossible(const DisplayItemClient&); 106 bool useCachedSubsequenceIfPossible(const DisplayItemClient&);
107 107
108 // True if the last display item is a begin that doesn't draw content. 108 // True if the last display item is a begin that doesn't draw content.
109 bool lastDisplayItemIsNoopBegin() const; 109 bool lastDisplayItemIsNoopBegin() const;
110 void removeLastDisplayItem(); 110 void removeLastDisplayItem();
111 111
112 void beginSkippingCache() { ++m_skippingCacheCount; } 112 void beginSkippingCache() { ++m_skippingCacheCount; }
113 void endSkippingCache() { DCHECK(m_skippingCacheCount > 0); --m_skippingCach eCount; } 113 void endSkippingCache() { DCHECK(m_skippingCacheCount > 0); --m_skippingCach eCount; }
114 bool skippingCache() const { return m_skippingCacheCount; } 114 bool isSkippingCache() const { return m_skippingCacheCount; }
115 115
116 // Must be called when a painting is finished. 116 // Must be called when a painting is finished.
117 // offsetFromLayoutObject is the offset between the space of the GraphicsLay er which owns this 117 // offsetFromLayoutObject is the offset between the space of the GraphicsLay er which owns this
118 // PaintController and the coordinate space of the owning LayoutObject. 118 // PaintController and the coordinate space of the owning LayoutObject.
119 void commitNewDisplayItems(const LayoutSize& offsetFromLayoutObject = Layout Size()); 119 void commitNewDisplayItems(const LayoutSize& offsetFromLayoutObject = Layout Size());
120 120
121 // Returns the approximate memory usage, excluding memory likely to be 121 // Returns the approximate memory usage, excluding memory likely to be
122 // shared with the embedder after copying to WebPaintController. 122 // shared with the embedder after copying to WebPaintController.
123 // Should only be called right after commitNewDisplayItems. 123 // Should only be called right after commitNewDisplayItems.
124 size_t approximateUnsharedMemoryUsage() const; 124 size_t approximateUnsharedMemoryUsage() const;
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 276
277 #if CHECK_DISPLAY_ITEM_CLIENT_ALIVENESS 277 #if CHECK_DISPLAY_ITEM_CLIENT_ALIVENESS
278 // A stack recording subsequence clients that are currently painting. 278 // A stack recording subsequence clients that are currently painting.
279 Vector<const DisplayItemClient*> m_currentSubsequenceClients; 279 Vector<const DisplayItemClient*> m_currentSubsequenceClients;
280 #endif 280 #endif
281 }; 281 };
282 282
283 } // namespace blink 283 } // namespace blink
284 284
285 #endif // PaintController_h 285 #endif // PaintController_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698