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 14 matching lines...) Expand all Loading... |
25 | 25 |
26 // This callback is run to require that a specific SurfaceSequence is | 26 // This callback is run to require that a specific SurfaceSequence is |
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(SurfaceId surface_id, float scale, const gfx::Size& size); | 35 void SetSurfaceId(const SurfaceId& surface_id, |
| 36 float scale, |
| 37 const gfx::Size& size); |
36 | 38 |
37 // Layer overrides. | 39 // Layer overrides. |
38 std::unique_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override; | 40 std::unique_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override; |
39 void SetLayerTreeHost(LayerTreeHost* host) override; | 41 void SetLayerTreeHost(LayerTreeHost* host) override; |
40 void PushPropertiesTo(LayerImpl* layer) override; | 42 void PushPropertiesTo(LayerImpl* layer) override; |
41 | 43 |
42 protected: | 44 protected: |
43 SurfaceLayer(const SatisfyCallback& satisfy_callback, | 45 SurfaceLayer(const SatisfyCallback& satisfy_callback, |
44 const RequireCallback& require_callback); | 46 const RequireCallback& require_callback); |
45 bool HasDrawableContent() const override; | 47 bool HasDrawableContent() const override; |
46 | 48 |
47 private: | 49 private: |
48 ~SurfaceLayer() override; | 50 ~SurfaceLayer() override; |
49 void CreateNewDestroySequence(); | 51 void CreateNewDestroySequence(); |
50 void SatisfyDestroySequence(); | 52 void SatisfyDestroySequence(); |
51 | 53 |
52 SurfaceId surface_id_; | 54 SurfaceId surface_id_; |
53 gfx::Size surface_size_; | 55 gfx::Size surface_size_; |
54 float surface_scale_; | 56 float surface_scale_; |
55 SurfaceSequence destroy_sequence_; | 57 SurfaceSequence destroy_sequence_; |
56 SatisfyCallback satisfy_callback_; | 58 SatisfyCallback satisfy_callback_; |
57 RequireCallback require_callback_; | 59 RequireCallback require_callback_; |
58 | 60 |
59 DISALLOW_COPY_AND_ASSIGN(SurfaceLayer); | 61 DISALLOW_COPY_AND_ASSIGN(SurfaceLayer); |
60 }; | 62 }; |
61 | 63 |
62 } // namespace cc | 64 } // namespace cc |
63 | 65 |
64 #endif // CC_LAYERS_SURFACE_LAYER_H_ | 66 #endif // CC_LAYERS_SURFACE_LAYER_H_ |
OLD | NEW |