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

Side by Side Diff: Source/platform/graphics/paint/TransformDisplayItem.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
« no previous file with comments | « Source/platform/graphics/paint/Transform3DDisplayItem.h ('k') | 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 TransformDisplayItem_h 5 #ifndef TransformDisplayItem_h
6 #define TransformDisplayItem_h 6 #define TransformDisplayItem_h
7 7
8 #include "platform/graphics/paint/DisplayItem.h" 8 #include "platform/graphics/paint/DisplayItem.h"
9 #include "platform/transforms/AffineTransform.h" 9 #include "platform/transforms/AffineTransform.h"
10 #include "wtf/PassOwnPtr.h" 10 #include "wtf/PassOwnPtr.h"
11 11
12 namespace blink { 12 namespace blink {
13 13
14 class PLATFORM_EXPORT BeginTransformDisplayItem : public PairedBeginDisplayItem { 14 class PLATFORM_EXPORT BeginTransformDisplayItem : public PairedBeginDisplayItem {
15 WTF_MAKE_FAST_ALLOCATED(BeginTransformDisplayItem);
16 public: 15 public:
17 static PassOwnPtr<BeginTransformDisplayItem> create(const DisplayItemClientW rapper& client, const AffineTransform& transform)
18 {
19 return adoptPtr(new BeginTransformDisplayItem(client, transform));
20 }
21
22 BeginTransformDisplayItem(const DisplayItemClientWrapper& client, const Affi neTransform& transform) 16 BeginTransformDisplayItem(const DisplayItemClientWrapper& client, const Affi neTransform& transform)
23 : PairedBeginDisplayItem(client, BeginTransform) 17 : PairedBeginDisplayItem(client, BeginTransform)
24 , m_transform(transform) { } 18 , m_transform(transform) { }
25 19
26 virtual void replay(GraphicsContext&) override; 20 virtual void replay(GraphicsContext&) override;
27 virtual void appendToWebDisplayItemList(WebDisplayItemList*) const override; 21 virtual void appendToWebDisplayItemList(WebDisplayItemList*) const override;
28 22
29 private: 23 private:
30 #ifndef NDEBUG 24 #ifndef NDEBUG
31 virtual void dumpPropertiesAsDebugString(WTF::StringBuilder&) const override final; 25 virtual void dumpPropertiesAsDebugString(WTF::StringBuilder&) const override final;
32 #endif 26 #endif
33 27
34 const AffineTransform m_transform; 28 const AffineTransform m_transform;
35 }; 29 };
36 30
37 class PLATFORM_EXPORT EndTransformDisplayItem : public PairedEndDisplayItem { 31 class PLATFORM_EXPORT EndTransformDisplayItem : public PairedEndDisplayItem {
38 WTF_MAKE_FAST_ALLOCATED(EndTransformDisplayItem);
39 public: 32 public:
40 static PassOwnPtr<EndTransformDisplayItem> create(const DisplayItemClientWra pper& client)
41 {
42 return adoptPtr(new EndTransformDisplayItem(client));
43 }
44
45 EndTransformDisplayItem(const DisplayItemClientWrapper& client) 33 EndTransformDisplayItem(const DisplayItemClientWrapper& client)
46 : PairedEndDisplayItem(client, EndTransform) { } 34 : PairedEndDisplayItem(client, EndTransform) { }
47 35
48 virtual void replay(GraphicsContext&) override; 36 virtual void replay(GraphicsContext&) override;
49 virtual void appendToWebDisplayItemList(WebDisplayItemList*) const override; 37 virtual void appendToWebDisplayItemList(WebDisplayItemList*) const override;
50 38
51 private: 39 private:
52 #if ENABLE(ASSERT) 40 #if ENABLE(ASSERT)
53 virtual bool isEndAndPairedWith(DisplayItem::Type otherType) const override final { return otherType == BeginTransform; } 41 virtual bool isEndAndPairedWith(DisplayItem::Type otherType) const override final { return otherType == BeginTransform; }
54 #endif 42 #endif
55 }; 43 };
56 44
57 } // namespace blink 45 } // namespace blink
58 46
59 #endif // TransformDisplayItem_h 47 #endif // TransformDisplayItem_h
OLDNEW
« no previous file with comments | « Source/platform/graphics/paint/Transform3DDisplayItem.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698