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

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

Issue 1417533009: Smaller initial DisplayItemList to use less memory. (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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 10 matching lines...) Expand all
21 #include "wtf/HashMap.h" 21 #include "wtf/HashMap.h"
22 #include "wtf/PassOwnPtr.h" 22 #include "wtf/PassOwnPtr.h"
23 #include "wtf/Utility.h" 23 #include "wtf/Utility.h"
24 #include "wtf/Vector.h" 24 #include "wtf/Vector.h"
25 25
26 namespace blink { 26 namespace blink {
27 27
28 class GraphicsLayer; 28 class GraphicsLayer;
29 class GraphicsContext; 29 class GraphicsContext;
30 30
31 static const size_t kInitialDisplayItemListCapacity = 64; 31 static const size_t kInitialDisplayItemListCapacityBytes = 512;
32 32
33 // Responsible for processing display items as they are produced, and producing 33 // Responsible for processing display items as they are produced, and producing
34 // a final paint artifact when complete. This class includes logic for caching, 34 // a final paint artifact when complete. This class includes logic for caching,
35 // cache invalidation, and merging. 35 // cache invalidation, and merging.
36 class PLATFORM_EXPORT PaintController { 36 class PLATFORM_EXPORT PaintController {
37 WTF_MAKE_NONCOPYABLE(PaintController); 37 WTF_MAKE_NONCOPYABLE(PaintController);
38 WTF_MAKE_FAST_ALLOCATED(PaintController); 38 WTF_MAKE_FAST_ALLOCATED(PaintController);
39 public: 39 public:
40 static PassOwnPtr<PaintController> create() 40 static PassOwnPtr<PaintController> create()
41 { 41 {
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 return m_clientsCheckedPaintInvalidation.contains(client); 155 return m_clientsCheckedPaintInvalidation.contains(client);
156 } 156 }
157 void setClientHasCheckedPaintInvalidation(DisplayItemClient client) 157 void setClientHasCheckedPaintInvalidation(DisplayItemClient client)
158 { 158 {
159 ASSERT(RuntimeEnabledFeatures::slimmingPaintSynchronizedPaintingEnabled( )); 159 ASSERT(RuntimeEnabledFeatures::slimmingPaintSynchronizedPaintingEnabled( ));
160 m_clientsCheckedPaintInvalidation.add(client); 160 m_clientsCheckedPaintInvalidation.add(client);
161 } 161 }
162 162
163 protected: 163 protected:
164 PaintController() 164 PaintController()
165 : m_newDisplayItemList(kInitialDisplayItemListCapacity * kMaximumDisplay ItemSize) 165 : m_newDisplayItemList(kInitialDisplayItemListCapacityBytes)
166 , m_validlyCachedClientsDirty(false) 166 , m_validlyCachedClientsDirty(false)
167 , m_constructionDisabled(false) 167 , m_constructionDisabled(false)
168 , m_textPainted(false) 168 , m_textPainted(false)
169 , m_skippingCacheCount(0) 169 , m_skippingCacheCount(0)
170 , m_numCachedItems(0) 170 , m_numCachedItems(0)
171 , m_nextScope(1) { } 171 , m_nextScope(1) { }
172 172
173 private: 173 private:
174 // Set new item state (scopes, cache skipping, etc) for a new item. 174 // Set new item state (scopes, cache skipping, etc) for a new item.
175 void processNewItem(DisplayItem&); 175 void processNewItem(DisplayItem&);
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 // easily find where the duplicated ids are from. 255 // easily find where the duplicated ids are from.
256 DisplayItemIndicesByClientMap m_newDisplayItemIndicesByClient; 256 DisplayItemIndicesByClientMap m_newDisplayItemIndicesByClient;
257 #endif 257 #endif
258 258
259 OwnPtr<Vector<String>> m_trackedPaintInvalidationObjects; 259 OwnPtr<Vector<String>> m_trackedPaintInvalidationObjects;
260 }; 260 };
261 261
262 } // namespace blink 262 } // namespace blink
263 263
264 #endif // PaintController_h 264 #endif // PaintController_h
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698