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

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

Issue 1295403003: DisplayItemPropertyTreeBuilder: Support (2D) transform and scroll display items. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 4 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 | Annotate | Revision Log
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" 10 #include "wtf/FastAllocBase.h"
11 #include "wtf/PassOwnPtr.h" 11 #include "wtf/PassOwnPtr.h"
12 12
13 namespace blink { 13 namespace blink {
14 14
15 class PLATFORM_EXPORT BeginScrollDisplayItem final : public PairedBeginDisplayIt em { 15 class PLATFORM_EXPORT BeginScrollDisplayItem final : public PairedBeginDisplayIt em {
16 public: 16 public:
17 BeginScrollDisplayItem(const DisplayItemClientWrapper& client, Type type, co nst IntSize& currentOffset) 17 BeginScrollDisplayItem(const DisplayItemClientWrapper& client, Type type, co nst IntSize& currentOffset)
18 : PairedBeginDisplayItem(client, type, sizeof(*this)) 18 : PairedBeginDisplayItem(client, type, sizeof(*this))
19 , m_currentOffset(currentOffset) 19 , m_currentOffset(currentOffset)
20 { 20 {
21 ASSERT(isScrollType(type)); 21 ASSERT(isScrollType(type));
22 } 22 }
23 23
24 void replay(GraphicsContext&) override; 24 void replay(GraphicsContext&) override;
25 void appendToWebDisplayItemList(WebDisplayItemList*) const override; 25 void appendToWebDisplayItemList(WebDisplayItemList*) const override;
26 26
27 const IntSize& currentOffset() const { return m_currentOffset; }
28
27 private: 29 private:
28 #ifndef NDEBUG 30 #ifndef NDEBUG
29 void dumpPropertiesAsDebugString(WTF::StringBuilder&) const final; 31 void dumpPropertiesAsDebugString(WTF::StringBuilder&) const final;
30 #endif 32 #endif
31 33
34 private:
32 const IntSize m_currentOffset; 35 const IntSize m_currentOffset;
33 }; 36 };
34 37
35 class PLATFORM_EXPORT EndScrollDisplayItem final : public PairedEndDisplayItem { 38 class PLATFORM_EXPORT EndScrollDisplayItem final : public PairedEndDisplayItem {
36 public: 39 public:
37 EndScrollDisplayItem(const DisplayItemClientWrapper& client, Type type) 40 EndScrollDisplayItem(const DisplayItemClientWrapper& client, Type type)
38 : PairedEndDisplayItem(client, type, sizeof(*this)) 41 : PairedEndDisplayItem(client, type, sizeof(*this))
39 { 42 {
40 ASSERT(isEndScrollType(type)); 43 ASSERT(isEndScrollType(type));
41 } 44 }
42 45
43 void replay(GraphicsContext&) override; 46 void replay(GraphicsContext&) override;
44 void appendToWebDisplayItemList(WebDisplayItemList*) const override; 47 void appendToWebDisplayItemList(WebDisplayItemList*) const override;
45 48
46 private: 49 private:
47 #if ENABLE(ASSERT) 50 #if ENABLE(ASSERT)
48 bool isEndAndPairedWith(DisplayItem::Type otherType) const final { return Di splayItem::isScrollType(otherType); } 51 bool isEndAndPairedWith(DisplayItem::Type otherType) const final { return Di splayItem::isScrollType(otherType); }
49 #endif 52 #endif
50 }; 53 };
51 54
52 } // namespace blink 55 } // namespace blink
53 56
54 #endif // ScrollDisplayItem_h 57 #endif // ScrollDisplayItem_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698