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_H_ | 5 #ifndef CC_LAYERS_SURFACE_LAYER_H_ |
6 #define CC_LAYERS_SURFACE_LAYER_H_ | 6 #define CC_LAYERS_SURFACE_LAYER_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "cc/base/cc_export.h" | 9 #include "cc/base/cc_export.h" |
10 #include "cc/layers/layer.h" | 10 #include "cc/layers/layer.h" |
(...skipping 16 matching lines...) Expand all Loading... | |
27 // received before a SurfaceId is destroyed. | 27 // received before a SurfaceId is destroyed. |
28 using RequireCallback = | 28 using RequireCallback = |
29 base::Callback<void(const SurfaceId&, const SurfaceSequence&)>; | 29 base::Callback<void(const SurfaceId&, const SurfaceSequence&)>; |
30 | 30 |
31 static scoped_refptr<SurfaceLayer> Create( | 31 static scoped_refptr<SurfaceLayer> Create( |
32 const SatisfyCallback& satisfy_callback, | 32 const SatisfyCallback& satisfy_callback, |
33 const RequireCallback& require_callback); | 33 const RequireCallback& require_callback); |
34 | 34 |
35 void SetSurfaceId(const SurfaceId& surface_id, | 35 void SetSurfaceId(const SurfaceId& surface_id, |
36 float scale, | 36 float scale, |
37 const gfx::Size& size); | 37 const gfx::Size& size, |
38 bool scale_layer_bounds_with_surface_size = false); | |
danakj
2016/11/28 22:26:22
i'd prefer no default behaviour here, just update
danakj
2016/11/28 22:26:22
also, I think "stretch_content_to_fill_bounds" mig
xlai (Olivia)
2016/12/13 17:29:18
Done.
xlai (Olivia)
2016/12/13 17:29:18
Done.
| |
38 | 39 |
39 // Layer overrides. | 40 // Layer overrides. |
40 std::unique_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override; | 41 std::unique_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override; |
41 void SetLayerTreeHost(LayerTreeHost* host) override; | 42 void SetLayerTreeHost(LayerTreeHost* host) override; |
42 void PushPropertiesTo(LayerImpl* layer) override; | 43 void PushPropertiesTo(LayerImpl* layer) override; |
43 | 44 |
44 SurfaceId surface_id() const { return surface_id_; } | 45 SurfaceId surface_id() const { return surface_id_; } |
45 const gfx::Size& surface_size() const { return surface_size_; } | 46 const gfx::Size& surface_size() const { return surface_size_; } |
46 float surface_scale() const { return surface_scale_; } | 47 float surface_scale() const { return surface_scale_; } |
47 | 48 |
48 const SatisfyCallback& satisfy_callback() const { return satisfy_callback_; } | 49 const SatisfyCallback& satisfy_callback() const { return satisfy_callback_; } |
49 const RequireCallback& require_callback() const { return require_callback_; } | 50 const RequireCallback& require_callback() const { return require_callback_; } |
50 | 51 |
51 protected: | 52 protected: |
52 SurfaceLayer(const SatisfyCallback& satisfy_callback, | 53 SurfaceLayer(const SatisfyCallback& satisfy_callback, |
53 const RequireCallback& require_callback); | 54 const RequireCallback& require_callback); |
54 bool HasDrawableContent() const override; | 55 bool HasDrawableContent() const override; |
55 | 56 |
56 private: | 57 private: |
57 ~SurfaceLayer() override; | 58 ~SurfaceLayer() override; |
58 void CreateNewDestroySequence(); | 59 void CreateNewDestroySequence(); |
59 void SatisfyDestroySequence(); | 60 void SatisfyDestroySequence(); |
60 | 61 |
61 SurfaceId surface_id_; | 62 SurfaceId surface_id_; |
62 gfx::Size surface_size_; | 63 gfx::Size surface_size_; |
63 float surface_scale_; | 64 float surface_scale_; |
65 bool scale_layer_bounds_with_surface_size_; | |
danakj
2016/11/28 22:26:22
= false
xlai (Olivia)
2016/12/13 17:29:18
Done
| |
64 SurfaceSequence destroy_sequence_; | 66 SurfaceSequence destroy_sequence_; |
65 SatisfyCallback satisfy_callback_; | 67 SatisfyCallback satisfy_callback_; |
66 RequireCallback require_callback_; | 68 RequireCallback require_callback_; |
67 | 69 |
68 DISALLOW_COPY_AND_ASSIGN(SurfaceLayer); | 70 DISALLOW_COPY_AND_ASSIGN(SurfaceLayer); |
69 }; | 71 }; |
70 | 72 |
71 } // namespace cc | 73 } // namespace cc |
72 | 74 |
73 #endif // CC_LAYERS_SURFACE_LAYER_H_ | 75 #endif // CC_LAYERS_SURFACE_LAYER_H_ |
OLD | NEW |