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

Side by Side Diff: Source/platform/graphics/paint/CachedDisplayItem.h

Issue 1193433004: Blink-side contiguous allocation of display items. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add ListContainer::AllocateAndConstructWithArguments and a TODO in DisplayItemList::findMatchingIte… Created 5 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 CachedDisplayItem_h 5 #ifndef CachedDisplayItem_h
6 #define CachedDisplayItem_h 6 #define CachedDisplayItem_h
7 7
8 #include "platform/graphics/paint/DisplayItem.h" 8 #include "platform/graphics/paint/DisplayItem.h"
9 #include "wtf/Assertions.h" 9 #include "wtf/Assertions.h"
10 10
11 namespace blink { 11 namespace blink {
12 12
13 // A placeholder of DisplayItem in the new paint list of DisplayItemList, to ind icate that 13 // A placeholder of DisplayItem in the new paint list of DisplayItemList, to ind icate that
14 // the DisplayItem has not been changed and should be replaced with the cached D isplayItem 14 // the DisplayItem has not been changed and should be replaced with the cached D isplayItem
15 // when merging new paint list to cached paint list. 15 // when merging new paint list to cached paint list.
16 class PLATFORM_EXPORT CachedDisplayItem : public DisplayItem { 16 class PLATFORM_EXPORT CachedDisplayItem : public DisplayItem {
17 WTF_MAKE_FAST_ALLOCATED(CachedDisplayItem);
18 public: 17 public:
19 static PassOwnPtr<CachedDisplayItem> create(const DisplayItemClientWrapper& client, Type type)
20 {
21 return adoptPtr(new CachedDisplayItem(client, type));
22 }
23
24 private:
25 CachedDisplayItem(const DisplayItemClientWrapper& client, Type type) 18 CachedDisplayItem(const DisplayItemClientWrapper& client, Type type)
26 : DisplayItem(client, type) 19 : DisplayItem(client, type)
27 { 20 {
28 ASSERT(isCachedType(type)); 21 ASSERT(isCachedType(type));
29 } 22 }
30 23
24 private:
31 // CachedDisplayItem is never replayed or appended to WebDisplayItemList. 25 // CachedDisplayItem is never replayed or appended to WebDisplayItemList.
32 virtual void replay(GraphicsContext&) override final { ASSERT_NOT_REACHED(); } 26 virtual void replay(GraphicsContext&) override final { ASSERT_NOT_REACHED(); }
33 virtual void appendToWebDisplayItemList(WebDisplayItemList*) const override final { ASSERT_NOT_REACHED(); } 27 virtual void appendToWebDisplayItemList(WebDisplayItemList*) const override final { ASSERT_NOT_REACHED(); }
34 }; 28 };
35 29
36 } // namespace blink 30 } // namespace blink
37 31
38 #endif // CachedDisplayItem_h 32 #endif // CachedDisplayItem_h
OLDNEW
« no previous file with comments | « Source/platform/graphics/ListContainerTest.cpp ('k') | Source/platform/graphics/paint/ClipDisplayItem.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698