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

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

Issue 1390123002: (WIP) Paint property hierarchy approach 1 of 2 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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 DisplayItemList_h 5 #ifndef DisplayItemList_h
6 #define DisplayItemList_h 6 #define DisplayItemList_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 item.setClientDebugString(originalDebugString); 53 item.setClientDebugString(originalDebugString);
54 #endif 54 #endif
55 return result; 55 return result;
56 } 56 }
57 }; 57 };
58 58
59 class PLATFORM_EXPORT DisplayItemList { 59 class PLATFORM_EXPORT DisplayItemList {
60 WTF_MAKE_NONCOPYABLE(DisplayItemList); 60 WTF_MAKE_NONCOPYABLE(DisplayItemList);
61 WTF_MAKE_FAST_ALLOCATED(DisplayItemList); 61 WTF_MAKE_FAST_ALLOCATED(DisplayItemList);
62 public: 62 public:
63 // TODO(pdr): With PaintArtifact, this class does not need to be heap
64 // allocated. We should refactor callers to use the constructor directly.
63 static PassOwnPtr<DisplayItemList> create() 65 static PassOwnPtr<DisplayItemList> create()
64 { 66 {
65 return adoptPtr(new DisplayItemList()); 67 return adoptPtr(new DisplayItemList());
66 } 68 }
67 69
68 // These methods are called during paint invalidation (or paint if SlimmingP aintSynchronizedPainting is on). 70 // These methods are called during paint invalidation (or paint if SlimmingP aintSynchronizedPainting is on).
69 void invalidate(const DisplayItemClientWrapper&, PaintInvalidationReason, co nst IntRect& previousPaintInvalidationRect, const IntRect& newPaintInvalidationR ect); 71 void invalidate(const DisplayItemClientWrapper&, PaintInvalidationReason, co nst IntRect& previousPaintInvalidationRect, const IntRect& newPaintInvalidationR ect);
70 void invalidateUntracked(DisplayItemClient); 72 void invalidateUntracked(DisplayItemClient);
71 void invalidateAll(); 73 void invalidateAll();
72 74
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 { 185 {
184 ASSERT(RuntimeEnabledFeatures::slimmingPaintSynchronizedPaintingEnabled( )); 186 ASSERT(RuntimeEnabledFeatures::slimmingPaintSynchronizedPaintingEnabled( ));
185 return m_clientsCheckedPaintInvalidation.contains(client); 187 return m_clientsCheckedPaintInvalidation.contains(client);
186 } 188 }
187 void setClientHasCheckedPaintInvalidation(DisplayItemClient client) 189 void setClientHasCheckedPaintInvalidation(DisplayItemClient client)
188 { 190 {
189 ASSERT(RuntimeEnabledFeatures::slimmingPaintSynchronizedPaintingEnabled( )); 191 ASSERT(RuntimeEnabledFeatures::slimmingPaintSynchronizedPaintingEnabled( ));
190 m_clientsCheckedPaintInvalidation.add(client); 192 m_clientsCheckedPaintInvalidation.add(client);
191 } 193 }
192 194
193 protected:
194 DisplayItemList() 195 DisplayItemList()
195 : m_currentDisplayItems(0) 196 : m_currentDisplayItems(0)
196 , m_newDisplayItems(kInitialDisplayItemsCapacity * kMaximumDisplayItemSi ze) 197 , m_newDisplayItems(kInitialDisplayItemsCapacity * kMaximumDisplayItemSi ze)
197 , m_validlyCachedClientsDirty(false) 198 , m_validlyCachedClientsDirty(false)
198 , m_constructionDisabled(false) 199 , m_constructionDisabled(false)
199 , m_skippingCacheCount(0) 200 , m_skippingCacheCount(0)
200 , m_numCachedItems(0) 201 , m_numCachedItems(0)
201 , m_nextScope(1) { } 202 , m_nextScope(1) { }
202 203
203 private: 204 private:
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 // the duplicated ids are from. 286 // the duplicated ids are from.
286 DisplayItemIndicesByClientMap m_newDisplayItemIndicesByClient; 287 DisplayItemIndicesByClientMap m_newDisplayItemIndicesByClient;
287 #endif 288 #endif
288 289
289 OwnPtr<Vector<String>> m_trackedPaintInvalidationObjects; 290 OwnPtr<Vector<String>> m_trackedPaintInvalidationObjects;
290 }; 291 };
291 292
292 } // namespace blink 293 } // namespace blink
293 294
294 #endif // DisplayItemList_h 295 #endif // DisplayItemList_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698