| OLD | NEW |
| 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 CC_OUTPUT_CA_LAYER_OVERLAY_H_ | 5 #ifndef CC_OUTPUT_CA_LAYER_OVERLAY_H_ |
| 6 #define CC_OUTPUT_CA_LAYER_OVERLAY_H_ | 6 #define CC_OUTPUT_CA_LAYER_OVERLAY_H_ |
| 7 | 7 |
| 8 #include "cc/quads/render_pass.h" | 8 #include "cc/quads/render_pass.h" |
| 9 #include "cc/resources/resource_provider.h" |
| 9 #include "third_party/skia/include/core/SkColor.h" | 10 #include "third_party/skia/include/core/SkColor.h" |
| 10 #include "third_party/skia/include/core/SkMatrix44.h" | 11 #include "third_party/skia/include/core/SkMatrix44.h" |
| 11 #include "ui/gfx/geometry/rect_f.h" | 12 #include "ui/gfx/geometry/rect_f.h" |
| 12 | 13 |
| 13 namespace cc { | 14 namespace cc { |
| 14 | 15 |
| 15 class DrawQuad; | 16 class DrawQuad; |
| 16 class ResourceProvider; | |
| 17 | 17 |
| 18 class CC_EXPORT CALayerOverlay { | 18 class CC_EXPORT CALayerOverlay { |
| 19 public: | 19 public: |
| 20 CALayerOverlay(); | 20 CALayerOverlay(); |
| 21 CALayerOverlay(const CALayerOverlay& other); | 21 CALayerOverlay(CALayerOverlay&& other); |
| 22 ~CALayerOverlay(); | 22 ~CALayerOverlay(); |
| 23 | 23 |
| 24 // Resource that corresponds to an IOSurface to set as the content of the |
| 25 // CALayer. If this is nullptr then the CALayer is a solid color. |
| 26 std::unique_ptr<ResourceProvider::ScopedReadLockGpuMemoryBuffer> |
| 27 resource_lock; |
| 28 |
| 24 // If |is_clipped| is true, then clip to |clip_rect| in the target space. | 29 // If |is_clipped| is true, then clip to |clip_rect| in the target space. |
| 25 bool is_clipped = false; | 30 bool is_clipped = false; |
| 26 gfx::RectF clip_rect; | 31 gfx::RectF clip_rect; |
| 27 // Layers in a non-zero sorting context exist in the same 3D space and should | 32 // Layers in a non-zero sorting context exist in the same 3D space and should |
| 28 // intersect. | 33 // intersect. |
| 29 unsigned sorting_context_id = 0; | 34 unsigned sorting_context_id = 0; |
| 30 // Texture that corresponds to an IOSurface to set as the content of the | |
| 31 // CALayer. If this is 0 then the CALayer is a solid color. | |
| 32 unsigned contents_resource_id = 0; | |
| 33 // The contents rect property for the CALayer. | 35 // The contents rect property for the CALayer. |
| 34 gfx::RectF contents_rect; | 36 gfx::RectF contents_rect; |
| 35 // The opacity property for the CAayer. | 37 // The opacity property for the CAayer. |
| 36 float opacity = 1; | 38 float opacity = 1; |
| 37 // The background color property for the CALayer. | 39 // The background color property for the CALayer. |
| 38 SkColor background_color = SK_ColorTRANSPARENT; | 40 SkColor background_color = SK_ColorTRANSPARENT; |
| 39 // The edge anti-aliasing mask property for the CALayer. | 41 // The edge anti-aliasing mask property for the CALayer. |
| 40 unsigned edge_aa_mask = 0; | 42 unsigned edge_aa_mask = 0; |
| 41 // The bounds for the CALayer in pixels. | 43 // The bounds for the CALayer in pixels. |
| 42 gfx::RectF bounds_rect; | 44 gfx::RectF bounds_rect; |
| 43 // The transform to apply to the CALayer. | 45 // The transform to apply to the CALayer. |
| 44 SkMatrix44 transform = SkMatrix44(SkMatrix44::kIdentity_Constructor); | 46 SkMatrix44 transform = SkMatrix44(SkMatrix44::kIdentity_Constructor); |
| 45 // The minification and magnification filters for the CALayer. | 47 // The minification and magnification filters for the CALayer. |
| 46 unsigned filter; | 48 unsigned filter; |
| 47 }; | 49 }; |
| 48 | 50 |
| 49 typedef std::vector<CALayerOverlay> CALayerOverlayList; | |
| 50 | |
| 51 // Returns true if all quads in the root render pass have been replaced by | 51 // Returns true if all quads in the root render pass have been replaced by |
| 52 // CALayerOverlays. | 52 // CALayerOverlays. |
| 53 bool ProcessForCALayerOverlays(ResourceProvider* resource_provider, | 53 bool ProcessForCALayerOverlays(ResourceProvider* resource_provider, |
| 54 const gfx::RectF& display_rect, | 54 const gfx::RectF& display_rect, |
| 55 const QuadList& quad_list, | 55 const QuadList& quad_list, |
| 56 CALayerOverlayList* ca_layer_overlays); | 56 CALayerOverlayList* ca_layer_overlays); |
| 57 | 57 |
| 58 } // namespace cc | 58 } // namespace cc |
| 59 | 59 |
| 60 #endif // CC_OUTPUT_CA_LAYER_OVERLAY_H_ | 60 #endif // CC_OUTPUT_CA_LAYER_OVERLAY_H_ |
| OLD | NEW |