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" |
11 #include "cc/surfaces/surface_id.h" | 11 #include "cc/surfaces/surface_id.h" |
12 #include "cc/surfaces/surface_sequence.h" | 12 #include "cc/surfaces/surface_sequence.h" |
13 #include "ui/gfx/geometry/size.h" | 13 #include "ui/gfx/geometry/size.h" |
14 | 14 |
15 namespace cc { | 15 namespace cc { |
16 | 16 |
17 // A layer that renders a surface referencing the output of another compositor | 17 // A layer that renders a surface referencing the output of another compositor |
18 // instance or client. | 18 // instance or client. |
19 class CC_EXPORT SurfaceLayer : public Layer { | 19 class CC_EXPORT SurfaceLayer : public Layer { |
20 public: | 20 public: |
21 // This callback is run when a SurfaceSequence needs to be satisfied, but | 21 // This callback is run when a SurfaceSequence needs to be satisfied, but |
22 // the parent compositor is unable to. It can be called on either the main | 22 // the parent compositor is unable to. It can be called on either the main |
23 // or impl threads. | 23 // or impl threads. |
24 using SatisfyCallback = base::Callback<void(SurfaceSequence)>; | 24 using SatisfyCallback = base::Callback<void(const SurfaceSequence&)>; |
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 = base::Callback<void(SurfaceId, SurfaceSequence)>; | 28 using RequireCallback = |
| 29 base::Callback<void(const SurfaceId&, const SurfaceSequence&)>; |
29 | 30 |
30 static scoped_refptr<SurfaceLayer> Create( | 31 static scoped_refptr<SurfaceLayer> Create( |
31 const SatisfyCallback& satisfy_callback, | 32 const SatisfyCallback& satisfy_callback, |
32 const RequireCallback& require_callback); | 33 const RequireCallback& require_callback); |
33 | 34 |
34 void SetSurfaceId(SurfaceId surface_id, float scale, const gfx::Size& size); | 35 void SetSurfaceId(SurfaceId surface_id, float scale, const gfx::Size& size); |
35 | 36 |
36 // Layer overrides. | 37 // Layer overrides. |
37 std::unique_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override; | 38 std::unique_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override; |
38 void SetLayerTreeHost(LayerTreeHost* host) override; | 39 void SetLayerTreeHost(LayerTreeHost* host) override; |
(...skipping 15 matching lines...) Expand all Loading... |
54 SurfaceSequence destroy_sequence_; | 55 SurfaceSequence destroy_sequence_; |
55 SatisfyCallback satisfy_callback_; | 56 SatisfyCallback satisfy_callback_; |
56 RequireCallback require_callback_; | 57 RequireCallback require_callback_; |
57 | 58 |
58 DISALLOW_COPY_AND_ASSIGN(SurfaceLayer); | 59 DISALLOW_COPY_AND_ASSIGN(SurfaceLayer); |
59 }; | 60 }; |
60 | 61 |
61 } // namespace cc | 62 } // namespace cc |
62 | 63 |
63 #endif // CC_LAYERS_SURFACE_LAYER_H_ | 64 #endif // CC_LAYERS_SURFACE_LAYER_H_ |
OLD | NEW |