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

Side by Side Diff: Source/platform/graphics/paint/Transform3DDisplayItem.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 Transform3DDisplayItem_h 5 #ifndef Transform3DDisplayItem_h
6 #define Transform3DDisplayItem_h 6 #define Transform3DDisplayItem_h
7 7
8 #include "platform/graphics/paint/DisplayItem.h" 8 #include "platform/graphics/paint/DisplayItem.h"
9 #include "platform/transforms/TransformationMatrix.h" 9 #include "platform/transforms/TransformationMatrix.h"
10 #include "wtf/Assertions.h" 10 #include "wtf/Assertions.h"
11 #include "wtf/PassOwnPtr.h"
12 11
13 namespace blink { 12 namespace blink {
14 13
15 class PLATFORM_EXPORT BeginTransform3DDisplayItem : public PairedBeginDisplayIte m { 14 class PLATFORM_EXPORT BeginTransform3DDisplayItem : public PairedBeginDisplayIte m {
16 WTF_MAKE_FAST_ALLOCATED(BeginTransform3DDisplayItem);
17 public: 15 public:
18 static PassOwnPtr<BeginTransform3DDisplayItem> create(const DisplayItemClien tWrapper& client, DisplayItem::Type type, const TransformationMatrix& transform)
19 {
20 return adoptPtr(new BeginTransform3DDisplayItem(client, type, transform) );
21 }
22
23 BeginTransform3DDisplayItem(const DisplayItemClientWrapper& client, DisplayI tem::Type type, const TransformationMatrix& transform) 16 BeginTransform3DDisplayItem(const DisplayItemClientWrapper& client, DisplayI tem::Type type, const TransformationMatrix& transform)
24 : PairedBeginDisplayItem(client, type) 17 : PairedBeginDisplayItem(client, type)
25 , m_transform(transform) 18 , m_transform(transform)
26 { 19 {
27 ASSERT(DisplayItem::isTransform3DType(type)); 20 ASSERT(DisplayItem::isTransform3DType(type));
28 } 21 }
29 22
30 virtual void replay(GraphicsContext&) override; 23 virtual void replay(GraphicsContext&) override;
31 virtual void appendToWebDisplayItemList(WebDisplayItemList*) const override; 24 virtual void appendToWebDisplayItemList(WebDisplayItemList*) const override;
25 void appendByMoving(DisplayItems&) override;
32 26
33 const TransformationMatrix& transform() const { return m_transform; } 27 const TransformationMatrix& transform() const { return m_transform; }
34 28
35 private: 29 private:
36 const TransformationMatrix m_transform; 30 const TransformationMatrix m_transform;
37 FloatPoint3D m_transformOrigin; 31 FloatPoint3D m_transformOrigin;
38 }; 32 };
39 33
40 class PLATFORM_EXPORT EndTransform3DDisplayItem : public PairedEndDisplayItem { 34 class PLATFORM_EXPORT EndTransform3DDisplayItem : public PairedEndDisplayItem {
41 WTF_MAKE_FAST_ALLOCATED(EndTransform3DDisplayItem);
42 public: 35 public:
43 static PassOwnPtr<EndTransform3DDisplayItem> create(const DisplayItemClientW rapper& client, DisplayItem::Type type)
44 {
45 return adoptPtr(new EndTransform3DDisplayItem(client, type));
46 }
47
48 EndTransform3DDisplayItem(const DisplayItemClientWrapper& client, DisplayIte m::Type type) 36 EndTransform3DDisplayItem(const DisplayItemClientWrapper& client, DisplayIte m::Type type)
49 : PairedEndDisplayItem(client, type) 37 : PairedEndDisplayItem(client, type)
50 { 38 {
51 ASSERT(DisplayItem::isEndTransform3DType(type)); 39 ASSERT(DisplayItem::isEndTransform3DType(type));
52 } 40 }
53 41
54 virtual void replay(GraphicsContext&) override; 42 virtual void replay(GraphicsContext&) override;
55 virtual void appendToWebDisplayItemList(WebDisplayItemList*) const override; 43 virtual void appendToWebDisplayItemList(WebDisplayItemList*) const override;
44 void appendByMoving(DisplayItems&) override;
56 45
57 private: 46 private:
58 #if ENABLE(ASSERT) 47 #if ENABLE(ASSERT)
59 virtual bool isEndAndPairedWith(DisplayItem::Type otherType) const override final 48 virtual bool isEndAndPairedWith(DisplayItem::Type otherType) const override final
60 { 49 {
61 return DisplayItem::transform3DTypeToEndTransform3DType(otherType) == ty pe(); 50 return DisplayItem::transform3DTypeToEndTransform3DType(otherType) == ty pe();
62 } 51 }
63 #endif 52 #endif
64 }; 53 };
65 54
66 } // namespace blink 55 } // namespace blink
67 56
68 #endif // Transform3DDisplayItem_h 57 #endif // Transform3DDisplayItem_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698