OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 BLIMP_CLIENT_CORE_COMPOSITOR_DELEGATED_OUTPUT_SURFACE_H_ | 5 #ifndef BLIMP_CLIENT_CORE_COMPOSITOR_DELEGATED_OUTPUT_SURFACE_H_ |
6 #define BLIMP_CLIENT_CORE_COMPOSITOR_DELEGATED_OUTPUT_SURFACE_H_ | 6 #define BLIMP_CLIENT_CORE_COMPOSITOR_DELEGATED_OUTPUT_SURFACE_H_ |
7 | 7 |
| 8 #include <memory> |
| 9 |
8 #include "base/macros.h" | 10 #include "base/macros.h" |
9 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
10 #include "blimp/client/core/compositor/blimp_output_surface.h" | 12 #include "blimp/client/core/compositor/blimp_output_surface.h" |
11 #include "cc/output/output_surface.h" | 13 #include "cc/output/output_surface.h" |
12 | 14 |
13 namespace base { | 15 namespace base { |
14 class SingleThreadTaskRunner; | 16 class SingleThreadTaskRunner; |
15 } // namespace base | 17 } // namespace base |
16 | 18 |
17 namespace cc { | 19 namespace cc { |
| 20 class BeginFrameSource; |
18 class ContextProvider; | 21 class ContextProvider; |
19 } // namespace cc | 22 } // namespace cc |
20 | 23 |
21 namespace blimp { | 24 namespace blimp { |
22 namespace client { | 25 namespace client { |
23 | 26 |
24 // This class is created on the main thread, but then becomes bound to the | 27 // This class is created on the main thread, but then becomes bound to the |
25 // compositor thread and will be destroyed there (soon, crbug.com/640730). | 28 // compositor thread and will be destroyed there (soon, crbug.com/640730). |
26 class DelegatedOutputSurface : public cc::OutputSurface, | 29 class DelegatedOutputSurface : public cc::OutputSurface, |
27 public BlimpOutputSurface { | 30 public BlimpOutputSurface { |
(...skipping 15 matching lines...) Expand all Loading... |
43 // BlimpOutputSurface implementation. | 46 // BlimpOutputSurface implementation. |
44 void ReclaimCompositorResources( | 47 void ReclaimCompositorResources( |
45 const cc::ReturnedResourceArray& resources) override; | 48 const cc::ReturnedResourceArray& resources) override; |
46 | 49 |
47 private: | 50 private: |
48 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_; | 51 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_; |
49 base::WeakPtr<BlimpOutputSurfaceClient> client_; | 52 base::WeakPtr<BlimpOutputSurfaceClient> client_; |
50 | 53 |
51 bool bound_to_client_; | 54 bool bound_to_client_; |
52 | 55 |
| 56 // This OutputSurface is responsible for providing the BeginFrameSource to |
| 57 // drive frame creation. This will be built on the compositor impl thread at |
| 58 // BindToClient call time. |
| 59 std::unique_ptr<cc::BeginFrameSource> begin_frame_source_; |
| 60 |
53 base::WeakPtrFactory<DelegatedOutputSurface> weak_factory_; | 61 base::WeakPtrFactory<DelegatedOutputSurface> weak_factory_; |
54 | 62 |
55 DISALLOW_COPY_AND_ASSIGN(DelegatedOutputSurface); | 63 DISALLOW_COPY_AND_ASSIGN(DelegatedOutputSurface); |
56 }; | 64 }; |
57 | 65 |
58 } // namespace client | 66 } // namespace client |
59 } // namespace blimp | 67 } // namespace blimp |
60 | 68 |
61 #endif // BLIMP_CLIENT_CORE_COMPOSITOR_DELEGATED_OUTPUT_SURFACE_H_ | 69 #endif // BLIMP_CLIENT_CORE_COMPOSITOR_DELEGATED_OUTPUT_SURFACE_H_ |
OLD | NEW |