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