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

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

Issue 1193433004: Blink-side contiguous allocation of display items. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Ready for review Created 5 years, 6 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 ScrollDisplayItem_h 5 #ifndef ScrollDisplayItem_h
6 #define ScrollDisplayItem_h 6 #define ScrollDisplayItem_h
7 7
8 #include "platform/geometry/IntSize.h" 8 #include "platform/geometry/IntSize.h"
9 #include "platform/graphics/paint/DisplayItem.h" 9 #include "platform/graphics/paint/DisplayItem.h"
10 #include "wtf/FastAllocBase.h"
11 #include "wtf/PassOwnPtr.h"
12 10
13 namespace blink { 11 namespace blink {
14 12
15 class PLATFORM_EXPORT BeginScrollDisplayItem : public PairedBeginDisplayItem { 13 class PLATFORM_EXPORT BeginScrollDisplayItem : public PairedBeginDisplayItem {
16 WTF_MAKE_FAST_ALLOCATED(BeginScrollDisplayItem);
17 public: 14 public:
18 static PassOwnPtr<BeginScrollDisplayItem> create(const DisplayItemClientWrap per& client, Type type, const IntSize& currentOffset)
19 {
20 return adoptPtr(new BeginScrollDisplayItem(client, type, currentOffset)) ;
21 }
22
23 BeginScrollDisplayItem(const DisplayItemClientWrapper& client, Type type, co nst IntSize& currentOffset) 15 BeginScrollDisplayItem(const DisplayItemClientWrapper& client, Type type, co nst IntSize& currentOffset)
24 : PairedBeginDisplayItem(client, type) 16 : PairedBeginDisplayItem(client, type)
25 , m_currentOffset(currentOffset) 17 , m_currentOffset(currentOffset)
26 { 18 {
27 ASSERT(isScrollType(type)); 19 ASSERT(isScrollType(type));
28 } 20 }
29 21
30 virtual void replay(GraphicsContext&) override; 22 virtual void replay(GraphicsContext&) override;
31 virtual void appendToWebDisplayItemList(WebDisplayItemList*) const override; 23 virtual void appendToWebDisplayItemList(WebDisplayItemList*) const override;
24 void appendByMoving(DisplayItems&) override;
32 25
33 private: 26 private:
34 #ifndef NDEBUG 27 #ifndef NDEBUG
35 virtual void dumpPropertiesAsDebugString(WTF::StringBuilder&) const override final; 28 virtual void dumpPropertiesAsDebugString(WTF::StringBuilder&) const override final;
36 #endif 29 #endif
37 30
38 const IntSize m_currentOffset; 31 const IntSize m_currentOffset;
39 }; 32 };
40 33
41 class PLATFORM_EXPORT EndScrollDisplayItem : public PairedEndDisplayItem { 34 class PLATFORM_EXPORT EndScrollDisplayItem : public PairedEndDisplayItem {
42 WTF_MAKE_FAST_ALLOCATED(EndScrollDisplayItem);
43 public: 35 public:
44 static PassOwnPtr<EndScrollDisplayItem> create(const DisplayItemClientWrappe r& client, Type type)
45 {
46 return adoptPtr(new EndScrollDisplayItem(client, type));
47 }
48
49 EndScrollDisplayItem(const DisplayItemClientWrapper& client, Type type) 36 EndScrollDisplayItem(const DisplayItemClientWrapper& client, Type type)
50 : PairedEndDisplayItem(client, type) 37 : PairedEndDisplayItem(client, type)
51 { 38 {
52 ASSERT(isEndScrollType(type)); 39 ASSERT(isEndScrollType(type));
53 } 40 }
54 41
55 virtual void replay(GraphicsContext&) override; 42 virtual void replay(GraphicsContext&) override;
56 virtual void appendToWebDisplayItemList(WebDisplayItemList*) const override; 43 virtual void appendToWebDisplayItemList(WebDisplayItemList*) const override;
44 void appendByMoving(DisplayItems&) override;
57 45
58 private: 46 private:
59 #if ENABLE(ASSERT) 47 #if ENABLE(ASSERT)
60 virtual bool isEndAndPairedWith(DisplayItem::Type otherType) const override final { return DisplayItem::isScrollType(otherType); } 48 virtual bool isEndAndPairedWith(DisplayItem::Type otherType) const override final { return DisplayItem::isScrollType(otherType); }
61 #endif 49 #endif
62 }; 50 };
63 51
64 } // namespace blink 52 } // namespace blink
65 53
66 #endif // ScrollDisplayItem_h 54 #endif // ScrollDisplayItem_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698