| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 ForeignLayerDisplayItem_h | 5 #ifndef ForeignLayerDisplayItem_h |
| 6 #define ForeignLayerDisplayItem_h | 6 #define ForeignLayerDisplayItem_h |
| 7 | 7 |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "platform/PlatformExport.h" | 9 #include "platform/PlatformExport.h" |
| 10 #include "platform/RuntimeEnabledFeatures.h" | 10 #include "platform/RuntimeEnabledFeatures.h" |
| 11 #include "platform/graphics/paint/DisplayItem.h" | 11 #include "platform/graphics/paint/DisplayItem.h" |
| 12 | 12 |
| 13 namespace cc { | 13 namespace cc { |
| 14 class Layer; | 14 class Layer; |
| 15 } | 15 } |
| 16 | 16 |
| 17 namespace blink { | 17 namespace blink { |
| 18 | 18 |
| 19 class GraphicsContext; | 19 class GraphicsContext; |
| 20 class WebLayer; | 20 class WebLayer; |
| 21 | 21 |
| 22 // Represents foreign content (produced outside Blink) which draws to a layer. | 22 // Represents foreign content (produced outside Blink) which draws to a layer. |
| 23 // A client supplies a layer which can be unwrapped and inserted into the full | 23 // A client supplies a layer which can be unwrapped and inserted into the full |
| 24 // layer tree. | 24 // layer tree. |
| 25 // | 25 // |
| 26 // Before SPv2, this content is not painted, but is instead inserted into the | 26 // Before SPv2, this content is not painted, but is instead inserted into the |
| 27 // GraphicsLayer tree. | 27 // GraphicsLayer tree. |
| 28 class PLATFORM_EXPORT ForeignLayerDisplayItem final : public DisplayItem { | 28 class PLATFORM_EXPORT ForeignLayerDisplayItem final : public DisplayItemBase<For
eignLayerDisplayItem> { |
| 29 public: | 29 public: |
| 30 ForeignLayerDisplayItem( | 30 ForeignLayerDisplayItem( |
| 31 const DisplayItemClient&, Type, | 31 const DisplayItemClient&, Type, |
| 32 scoped_refptr<cc::Layer>, | 32 scoped_refptr<cc::Layer>, |
| 33 const FloatPoint& location, | 33 const FloatPoint& location, |
| 34 const IntSize& bounds); | 34 const IntSize& bounds); |
| 35 ~ForeignLayerDisplayItem(); | 35 ~ForeignLayerDisplayItem(); |
| 36 | 36 |
| 37 cc::Layer* layer() const { return m_layer.get(); } | 37 cc::Layer* layer() const { return m_layer.get(); } |
| 38 const FloatPoint& location() const { return m_location; } | 38 const FloatPoint& location() const { return m_location; } |
| (...skipping 18 matching lines...) Expand all Loading... |
| 57 | 57 |
| 58 // Records a foreign layer into a GraphicsContext. | 58 // Records a foreign layer into a GraphicsContext. |
| 59 // Use this where you would use a recorder class. | 59 // Use this where you would use a recorder class. |
| 60 PLATFORM_EXPORT void recordForeignLayer( | 60 PLATFORM_EXPORT void recordForeignLayer( |
| 61 GraphicsContext&, const DisplayItemClient&, DisplayItem::Type, | 61 GraphicsContext&, const DisplayItemClient&, DisplayItem::Type, |
| 62 WebLayer*, const FloatPoint& location, const IntSize& bounds); | 62 WebLayer*, const FloatPoint& location, const IntSize& bounds); |
| 63 | 63 |
| 64 } // namespace blink | 64 } // namespace blink |
| 65 | 65 |
| 66 #endif // ForeignLayerDisplayItem_h | 66 #endif // ForeignLayerDisplayItem_h |
| OLD | NEW |