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 CC_LAYERS_SURFACE_LAYER_IMPL_H_ | 5 #ifndef CC_LAYERS_SURFACE_LAYER_IMPL_H_ |
6 #define CC_LAYERS_SURFACE_LAYER_IMPL_H_ | 6 #define CC_LAYERS_SURFACE_LAYER_IMPL_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 int id) { | 23 int id) { |
24 return base::WrapUnique(new SurfaceLayerImpl(tree_impl, id)); | 24 return base::WrapUnique(new SurfaceLayerImpl(tree_impl, id)); |
25 } | 25 } |
26 ~SurfaceLayerImpl() override; | 26 ~SurfaceLayerImpl() override; |
27 | 27 |
28 void SetPrimarySurfaceInfo(const SurfaceInfo& surface_info); | 28 void SetPrimarySurfaceInfo(const SurfaceInfo& surface_info); |
29 const SurfaceInfo& primary_surface_info() const { | 29 const SurfaceInfo& primary_surface_info() const { |
30 return primary_surface_info_; | 30 return primary_surface_info_; |
31 } | 31 } |
32 | 32 |
| 33 // A fallback Surface is a Surface that is already known to exist in the |
| 34 // display compositor. If surface synchronization is enabled, the display |
| 35 // compositor will use the fallback if the primary surface is unavailable |
| 36 // at the time of surface aggregation. If surface synchronization is not |
| 37 // enabled, then a fallback surface will not be specified. |
33 void SetFallbackSurfaceInfo(const SurfaceInfo& surface_info); | 38 void SetFallbackSurfaceInfo(const SurfaceInfo& surface_info); |
34 const SurfaceInfo& fallback_surface_info() const { | 39 const SurfaceInfo& fallback_surface_info() const { |
35 return fallback_surface_info_; | 40 return fallback_surface_info_; |
36 } | 41 } |
37 | 42 |
38 void SetStretchContentToFillBounds(bool stretch_content); | 43 void SetStretchContentToFillBounds(bool stretch_content); |
39 | 44 |
40 // LayerImpl overrides. | 45 // LayerImpl overrides. |
41 std::unique_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override; | 46 std::unique_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override; |
42 void PushPropertiesTo(LayerImpl* layer) override; | 47 void PushPropertiesTo(LayerImpl* layer) override; |
43 void AppendQuads(RenderPass* render_pass, | 48 void AppendQuads(RenderPass* render_pass, |
44 AppendQuadsData* append_quads_data) override; | 49 AppendQuadsData* append_quads_data) override; |
45 | 50 |
46 protected: | 51 protected: |
47 SurfaceLayerImpl(LayerTreeImpl* tree_impl, int id); | 52 SurfaceLayerImpl(LayerTreeImpl* tree_impl, int id); |
48 | 53 |
49 private: | 54 private: |
50 SurfaceDrawQuad* CreateSurfaceDrawQuad( | 55 SurfaceDrawQuad* CreateSurfaceDrawQuad( |
51 RenderPass* render_pass, | 56 RenderPass* render_pass, |
52 SurfaceDrawQuadType surface_draw_quad_type, | 57 SurfaceDrawQuadType surface_draw_quad_type, |
53 const SurfaceInfo& surface_info, | 58 const SurfaceInfo& surface_info, |
54 std::vector<SurfaceId>* embedded_surfaces, | |
55 SharedQuadState** common_shared_quad_state); | 59 SharedQuadState** common_shared_quad_state); |
56 | 60 |
57 void GetDebugBorderProperties(SkColor* color, float* width) const override; | 61 void GetDebugBorderProperties(SkColor* color, float* width) const override; |
58 void AppendRainbowDebugBorder(RenderPass* render_pass); | 62 void AppendRainbowDebugBorder(RenderPass* render_pass); |
59 void AsValueInto(base::trace_event::TracedValue* dict) const override; | 63 void AsValueInto(base::trace_event::TracedValue* dict) const override; |
60 const char* LayerTypeAsString() const override; | 64 const char* LayerTypeAsString() const override; |
61 | 65 |
62 SurfaceInfo primary_surface_info_; | 66 SurfaceInfo primary_surface_info_; |
63 SurfaceInfo fallback_surface_info_; | 67 SurfaceInfo fallback_surface_info_; |
64 | 68 |
65 bool stretch_content_to_fill_bounds_ = false; | 69 bool stretch_content_to_fill_bounds_ = false; |
66 | 70 |
67 DISALLOW_COPY_AND_ASSIGN(SurfaceLayerImpl); | 71 DISALLOW_COPY_AND_ASSIGN(SurfaceLayerImpl); |
68 }; | 72 }; |
69 | 73 |
70 } // namespace cc | 74 } // namespace cc |
71 | 75 |
72 #endif // CC_LAYERS_SURFACE_LAYER_IMPL_H_ | 76 #endif // CC_LAYERS_SURFACE_LAYER_IMPL_H_ |
OLD | NEW |