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

Side by Side Diff: Source/platform/graphics/paint/ClipPathDisplayItem.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 ClipPathDisplayItem_h 5 #ifndef ClipPathDisplayItem_h
6 #define ClipPathDisplayItem_h 6 #define ClipPathDisplayItem_h
7 7
8 #include "platform/PlatformExport.h" 8 #include "platform/PlatformExport.h"
9 #include "platform/graphics/Path.h" 9 #include "platform/graphics/Path.h"
10 #include "platform/graphics/paint/DisplayItem.h" 10 #include "platform/graphics/paint/DisplayItem.h"
11 #include "third_party/skia/include/core/SkPath.h" 11 #include "third_party/skia/include/core/SkPath.h"
12 #include "wtf/PassOwnPtr.h" 12 #include "wtf/PassOwnPtr.h"
13 13
14 namespace blink { 14 namespace blink {
15 15
16 class PLATFORM_EXPORT BeginClipPathDisplayItem : public PairedBeginDisplayItem { 16 class PLATFORM_EXPORT BeginClipPathDisplayItem : public PairedBeginDisplayItem {
17 WTF_MAKE_FAST_ALLOCATED(BeginClipPathDisplayItem);
18 public: 17 public:
19 static PassOwnPtr<BeginClipPathDisplayItem> create(const DisplayItemClientWr apper& client, const Path& clipPath) 18 BeginClipPathDisplayItem(const DisplayItemClientWrapper& client, const SkPat h& clipPath)
20 { 19 : PairedBeginDisplayItem(client, BeginClipPath)
21 return adoptPtr(new BeginClipPathDisplayItem(client, clipPath)); 20 , m_clipPath(clipPath) { }
22 }
23
24 BeginClipPathDisplayItem(const DisplayItemClientWrapper& client, const Path& clipPath) 21 BeginClipPathDisplayItem(const DisplayItemClientWrapper& client, const Path& clipPath)
25 : PairedBeginDisplayItem(client, BeginClipPath) 22 : BeginClipPathDisplayItem(client, clipPath.skPath()) { }
26 , m_clipPath(clipPath.skPath()) { }
27 23
28 virtual void replay(GraphicsContext&) override; 24 virtual void replay(GraphicsContext&) override;
29 virtual void appendToWebDisplayItemList(WebDisplayItemList*) const override; 25 virtual void appendToWebDisplayItemList(WebDisplayItemList*) const override;
26 void appendByMoving(DisplayItems&) override;
30 27
31 private: 28 private:
32 const SkPath m_clipPath; 29 const SkPath m_clipPath;
33 #ifndef NDEBUG 30 #ifndef NDEBUG
34 virtual void dumpPropertiesAsDebugString(WTF::StringBuilder&) const override ; 31 virtual void dumpPropertiesAsDebugString(WTF::StringBuilder&) const override ;
35 #endif 32 #endif
36 }; 33 };
37 34
38 class PLATFORM_EXPORT EndClipPathDisplayItem : public PairedEndDisplayItem { 35 class PLATFORM_EXPORT EndClipPathDisplayItem : public PairedEndDisplayItem {
39 WTF_MAKE_FAST_ALLOCATED(EndClipPathDisplayItem);
40 public: 36 public:
41 static PassOwnPtr<EndClipPathDisplayItem> create(const DisplayItemClientWrap per& client)
42 {
43 return adoptPtr(new EndClipPathDisplayItem(client));
44 }
45
46 EndClipPathDisplayItem(const DisplayItemClientWrapper& client) 37 EndClipPathDisplayItem(const DisplayItemClientWrapper& client)
47 : PairedEndDisplayItem(client, EndClipPath) { } 38 : PairedEndDisplayItem(client, EndClipPath) { }
48 39
49 virtual void replay(GraphicsContext&) override; 40 virtual void replay(GraphicsContext&) override;
50 virtual void appendToWebDisplayItemList(WebDisplayItemList*) const override; 41 virtual void appendToWebDisplayItemList(WebDisplayItemList*) const override;
42 void appendByMoving(DisplayItems&) override;
51 43
52 private: 44 private:
53 #if ENABLE(ASSERT) 45 #if ENABLE(ASSERT)
54 virtual bool isEndAndPairedWith(DisplayItem::Type otherType) const override final { return otherType == BeginClipPath; } 46 virtual bool isEndAndPairedWith(DisplayItem::Type otherType) const override final { return otherType == BeginClipPath; }
55 #endif 47 #endif
56 }; 48 };
57 49
58 } // namespace blink 50 } // namespace blink
59 51
60 #endif // ClipPathDisplayItem_h 52 #endif // ClipPathDisplayItem_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698