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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/paint/FloatClipDisplayItem.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 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 FloatClipDisplayItem_h 5 #ifndef FloatClipDisplayItem_h
6 #define FloatClipDisplayItem_h 6 #define FloatClipDisplayItem_h
7 7
8 #include "platform/PlatformExport.h" 8 #include "platform/PlatformExport.h"
9 #include "platform/geometry/FloatRect.h" 9 #include "platform/geometry/FloatRect.h"
10 #include "platform/graphics/paint/DisplayItem.h" 10 #include "platform/graphics/paint/DisplayItem.h"
11 11
12 namespace blink { 12 namespace blink {
13 13
14 class RoundedRect; 14 class RoundedRect;
15 15
16 class PLATFORM_EXPORT FloatClipDisplayItem final : public PairedBeginDisplayItem { 16 class PLATFORM_EXPORT FloatClipDisplayItem final : public PairedBeginDisplayItem <FloatClipDisplayItem> {
17 public: 17 public:
18 FloatClipDisplayItem(const DisplayItemClient& client, Type type, const Float Rect& clipRect) 18 FloatClipDisplayItem(const DisplayItemClient& client, Type type, const Float Rect& clipRect)
19 : PairedBeginDisplayItem(client, type, sizeof(*this)) 19 : PairedBeginDisplayItem(client, type)
20 , m_clipRect(clipRect) 20 , m_clipRect(clipRect)
21 { 21 {
22 ASSERT(isFloatClipType(type)); 22 ASSERT(isFloatClipType(type));
23 } 23 }
24 24
25 void replay(GraphicsContext&) const override; 25 void replay(GraphicsContext&) const override;
26 void appendToWebDisplayItemList(const IntRect&, WebDisplayItemList*) const o verride; 26 void appendToWebDisplayItemList(const IntRect&, WebDisplayItemList*) const o verride;
27 27
28 private: 28 private:
29 #ifndef NDEBUG 29 #ifndef NDEBUG
30 void dumpPropertiesAsDebugString(WTF::StringBuilder&) const override; 30 void dumpPropertiesAsDebugString(WTF::StringBuilder&) const override;
31 #endif 31 #endif
32 #if ENABLE(ASSERT) 32 #if ENABLE(ASSERT)
33 bool equals(const DisplayItem& other) const final 33 bool equals(const DisplayItem& other) const final
34 { 34 {
35 return DisplayItem::equals(other) 35 return DisplayItem::equals(other)
36 && m_clipRect == static_cast<const FloatClipDisplayItem&>(other).m_c lipRect; 36 && m_clipRect == static_cast<const FloatClipDisplayItem&>(other).m_c lipRect;
37 } 37 }
38 #endif 38 #endif
39 39
40 const FloatRect m_clipRect; 40 const FloatRect m_clipRect;
41 }; 41 };
42 42
43 class PLATFORM_EXPORT EndFloatClipDisplayItem final : public PairedEndDisplayIte m { 43 class PLATFORM_EXPORT EndFloatClipDisplayItem final : public PairedEndDisplayIte m<EndFloatClipDisplayItem> {
44 public: 44 public:
45 EndFloatClipDisplayItem(const DisplayItemClient& client, Type type) 45 EndFloatClipDisplayItem(const DisplayItemClient& client, Type type)
46 : PairedEndDisplayItem(client, type, sizeof(*this)) 46 : PairedEndDisplayItem(client, type)
47 { 47 {
48 ASSERT(isEndFloatClipType(type)); 48 ASSERT(isEndFloatClipType(type));
49 } 49 }
50 50
51 void replay(GraphicsContext&) const override; 51 void replay(GraphicsContext&) const override;
52 void appendToWebDisplayItemList(const IntRect&, WebDisplayItemList*) const o verride; 52 void appendToWebDisplayItemList(const IntRect&, WebDisplayItemList*) const o verride;
53 53
54 private: 54 private:
55 #if ENABLE(ASSERT) 55 #if ENABLE(ASSERT)
56 bool isEndAndPairedWith(DisplayItem::Type otherType) const final { return Di splayItem::isFloatClipType(otherType); } 56 bool isEndAndPairedWith(DisplayItem::Type otherType) const final { return Di splayItem::isFloatClipType(otherType); }
57 #endif 57 #endif
58 }; 58 };
59 59
60 } // namespace blink 60 } // namespace blink
61 61
62 #endif // FloatClipDisplayItem_h 62 #endif // FloatClipDisplayItem_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698