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

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

Issue 2119033003: Fix alignment issue of ContiguousContainer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 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
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 12
13 namespace blink { 13 namespace blink {
14 14
15 class PLATFORM_EXPORT BeginClipPathDisplayItem final : public PairedBeginDisplay Item { 15 class PLATFORM_EXPORT BeginClipPathDisplayItem final : public PairedBeginDisplay Item<BeginClipPathDisplayItem> {
16 public: 16 public:
17 BeginClipPathDisplayItem(const DisplayItemClient& client, const Path& clipPa th) 17 BeginClipPathDisplayItem(const DisplayItemClient& client, const Path& clipPa th)
18 : PairedBeginDisplayItem(client, BeginClipPath, sizeof(*this)) 18 : PairedBeginDisplayItem(client, BeginClipPath)
19 , m_clipPath(clipPath.getSkPath()) { } 19 , m_clipPath(clipPath.getSkPath()) { }
20 20
21 void replay(GraphicsContext&) const override; 21 void replay(GraphicsContext&) const override;
22 void appendToWebDisplayItemList(const IntRect&, WebDisplayItemList*) const o verride; 22 void appendToWebDisplayItemList(const IntRect&, WebDisplayItemList*) const o verride;
23 23
24 void analyzeForGpuRasterization(SkPictureGpuAnalyzer&) const override; 24 void analyzeForGpuRasterization(SkPictureGpuAnalyzer&) const override;
25 25
26 private: 26 private:
27 const SkPath m_clipPath; 27 const SkPath m_clipPath;
28 #ifndef NDEBUG 28 #ifndef NDEBUG
29 void dumpPropertiesAsDebugString(WTF::StringBuilder&) const override; 29 void dumpPropertiesAsDebugString(WTF::StringBuilder&) const override;
30 #endif 30 #endif
31 #if ENABLE(ASSERT) 31 #if ENABLE(ASSERT)
32 bool equals(const DisplayItem& other) const final 32 bool equals(const DisplayItem& other) const final
33 { 33 {
34 return DisplayItem::equals(other) 34 return DisplayItem::equals(other)
35 && m_clipPath == static_cast<const BeginClipPathDisplayItem&>(other) .m_clipPath; 35 && m_clipPath == static_cast<const BeginClipPathDisplayItem&>(other) .m_clipPath;
36 } 36 }
37 #endif 37 #endif
38 }; 38 };
39 39
40 class PLATFORM_EXPORT EndClipPathDisplayItem final : public PairedEndDisplayItem { 40 class PLATFORM_EXPORT EndClipPathDisplayItem final : public PairedEndDisplayItem <EndClipPathDisplayItem> {
41 public: 41 public:
42 EndClipPathDisplayItem(const DisplayItemClient& client) 42 EndClipPathDisplayItem(const DisplayItemClient& client)
43 : PairedEndDisplayItem(client, EndClipPath, sizeof(*this)) { } 43 : PairedEndDisplayItem(client, EndClipPath) { }
44 44
45 void replay(GraphicsContext&) const override; 45 void replay(GraphicsContext&) const override;
46 void appendToWebDisplayItemList(const IntRect&, WebDisplayItemList*) const o verride; 46 void appendToWebDisplayItemList(const IntRect&, WebDisplayItemList*) const o verride;
47 47
48 private: 48 private:
49 #if ENABLE(ASSERT) 49 #if ENABLE(ASSERT)
50 bool isEndAndPairedWith(DisplayItem::Type otherType) const final { return ot herType == BeginClipPath; } 50 bool isEndAndPairedWith(DisplayItem::Type otherType) const final { return ot herType == BeginClipPath; }
51 #endif 51 #endif
52 }; 52 };
53 53
54 } // namespace blink 54 } // namespace blink
55 55
56 #endif // ClipPathDisplayItem_h 56 #endif // ClipPathDisplayItem_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698