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

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

Issue 1203343002: WIP for display item list backed by ListContainer Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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 void setNew(const Path& clipPath)
20 { 19 {
21 return adoptPtr(new BeginClipPathDisplayItem(client, clipPath)); 20 m_clipPath = clipPath.skPath();
22 } 21 }
23 22
24 BeginClipPathDisplayItem(const DisplayItemClientWrapper& client, const Path& clipPath)
25 : PairedBeginDisplayItem(client, BeginClipPath)
26 , m_clipPath(clipPath.skPath()) { }
27
28 virtual void replay(GraphicsContext&) override; 23 virtual void replay(GraphicsContext&) override;
29 virtual void appendToWebDisplayItemList(WebDisplayItemList*) const override; 24 virtual void appendToWebDisplayItemList(WebDisplayItemList*) const override;
30 25
31 private: 26 private:
32 const SkPath m_clipPath; 27 SkPath m_clipPath;
33 #ifndef NDEBUG 28 #ifndef NDEBUG
34 virtual void dumpPropertiesAsDebugString(WTF::StringBuilder&) const override ; 29 virtual void dumpPropertiesAsDebugString(WTF::StringBuilder&) const override ;
35 #endif 30 #endif
36 }; 31 };
37 32
38 class PLATFORM_EXPORT EndClipPathDisplayItem : public PairedEndDisplayItem { 33 class PLATFORM_EXPORT EndClipPathDisplayItem : public PairedEndDisplayItem {
39 WTF_MAKE_FAST_ALLOCATED(EndClipPathDisplayItem);
40 public: 34 public:
41 static PassOwnPtr<EndClipPathDisplayItem> create(const DisplayItemClientWrap per& client)
42 {
43 return adoptPtr(new EndClipPathDisplayItem(client));
44 }
45
46 EndClipPathDisplayItem(const DisplayItemClientWrapper& client)
47 : PairedEndDisplayItem(client, EndClipPath) { }
48
49 virtual void replay(GraphicsContext&) override; 35 virtual void replay(GraphicsContext&) override;
50 virtual void appendToWebDisplayItemList(WebDisplayItemList*) const override; 36 virtual void appendToWebDisplayItemList(WebDisplayItemList*) const override;
51 37
52 private: 38 private:
53 #if ENABLE(ASSERT) 39 #if ENABLE(ASSERT)
54 virtual bool isEndAndPairedWith(DisplayItem::Type otherType) const override final { return otherType == BeginClipPath; } 40 virtual bool isEndAndPairedWith(DisplayItem::Type otherType) const override final { return otherType == BeginClipPath; }
55 #endif 41 #endif
56 }; 42 };
57 43
58 } // namespace blink 44 } // namespace blink
59 45
60 #endif // ClipPathDisplayItem_h 46 #endif // ClipPathDisplayItem_h
OLDNEW
« no previous file with comments | « Source/platform/graphics/paint/ClipDisplayItem.h ('k') | Source/platform/graphics/paint/ClipPathRecorder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698