OLD | NEW |
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 CompositingDisplayItem_h | 5 #ifndef CompositingDisplayItem_h |
6 #define CompositingDisplayItem_h | 6 #define CompositingDisplayItem_h |
7 | 7 |
8 #include "platform/geometry/FloatRect.h" | 8 #include "platform/geometry/FloatRect.h" |
9 #include "platform/graphics/GraphicsTypes.h" | 9 #include "platform/graphics/GraphicsTypes.h" |
10 #include "platform/graphics/paint/DisplayItem.h" | 10 #include "platform/graphics/paint/DisplayItem.h" |
11 #include "public/platform/WebBlendMode.h" | 11 #include "public/platform/WebBlendMode.h" |
12 #include "wtf/PassOwnPtr.h" | 12 #include "wtf/PassOwnPtr.h" |
13 #ifndef NDEBUG | 13 #ifndef NDEBUG |
14 #include "wtf/text/WTFString.h" | 14 #include "wtf/text/WTFString.h" |
15 #endif | 15 #endif |
16 | 16 |
17 namespace blink { | 17 namespace blink { |
18 | 18 |
19 class PLATFORM_EXPORT BeginCompositingDisplayItem final : public PairedBeginDisp
layItem { | 19 class PLATFORM_EXPORT BeginCompositingDisplayItem final : public PairedBeginDisp
layItem { |
20 public: | 20 public: |
21 BeginCompositingDisplayItem(const DisplayItemClientWrapper& client, const Sk
Xfermode::Mode xferMode, const float opacity, const FloatRect* bounds, ColorFilt
er colorFilter = ColorFilterNone) | 21 BeginCompositingDisplayItem(const DisplayItemClient& client, const SkXfermod
e::Mode xferMode, const float opacity, const FloatRect* bounds, ColorFilter colo
rFilter = ColorFilterNone) |
22 : PairedBeginDisplayItem(client, BeginCompositing, sizeof(*this)) | 22 : PairedBeginDisplayItem(client, BeginCompositing, sizeof(*this)) |
23 , m_xferMode(xferMode) | 23 , m_xferMode(xferMode) |
24 , m_opacity(opacity) | 24 , m_opacity(opacity) |
25 , m_hasBounds(bounds) | 25 , m_hasBounds(bounds) |
26 , m_colorFilter(colorFilter) | 26 , m_colorFilter(colorFilter) |
27 { | 27 { |
28 if (bounds) | 28 if (bounds) |
29 m_bounds = FloatRect(*bounds); | 29 m_bounds = FloatRect(*bounds); |
30 } | 30 } |
31 | 31 |
(...skipping 18 matching lines...) Expand all Loading... |
50 | 50 |
51 const SkXfermode::Mode m_xferMode; | 51 const SkXfermode::Mode m_xferMode; |
52 const float m_opacity; | 52 const float m_opacity; |
53 bool m_hasBounds; | 53 bool m_hasBounds; |
54 FloatRect m_bounds; | 54 FloatRect m_bounds; |
55 ColorFilter m_colorFilter; | 55 ColorFilter m_colorFilter; |
56 }; | 56 }; |
57 | 57 |
58 class PLATFORM_EXPORT EndCompositingDisplayItem final : public PairedEndDisplayI
tem { | 58 class PLATFORM_EXPORT EndCompositingDisplayItem final : public PairedEndDisplayI
tem { |
59 public: | 59 public: |
60 EndCompositingDisplayItem(const DisplayItemClientWrapper& client) | 60 EndCompositingDisplayItem(const DisplayItemClient& client) |
61 : PairedEndDisplayItem(client, EndCompositing, sizeof(*this)) { } | 61 : PairedEndDisplayItem(client, EndCompositing, sizeof(*this)) { } |
62 | 62 |
63 void replay(GraphicsContext&) const override; | 63 void replay(GraphicsContext&) const override; |
64 void appendToWebDisplayItemList(const IntRect&, WebDisplayItemList*) const o
verride; | 64 void appendToWebDisplayItemList(const IntRect&, WebDisplayItemList*) const o
verride; |
65 | 65 |
66 private: | 66 private: |
67 #if ENABLE(ASSERT) | 67 #if ENABLE(ASSERT) |
68 bool isEndAndPairedWith(DisplayItem::Type otherType) const final { return ot
herType == BeginCompositing; } | 68 bool isEndAndPairedWith(DisplayItem::Type otherType) const final { return ot
herType == BeginCompositing; } |
69 #endif | 69 #endif |
70 }; | 70 }; |
71 | 71 |
72 } // namespace blink | 72 } // namespace blink |
73 | 73 |
74 #endif // CompositingDisplayItem_h | 74 #endif // CompositingDisplayItem_h |
OLD | NEW |