OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CONTENT_BROWSER_RENDERER_HOST_COMPOSITOR_IMPL_ANDROID_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_COMPOSITOR_IMPL_ANDROID_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_COMPOSITOR_IMPL_ANDROID_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_COMPOSITOR_IMPL_ANDROID_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
11 #include <unordered_set> | |
11 | 12 |
12 #include "base/cancelable_callback.h" | 13 #include "base/cancelable_callback.h" |
13 #include "base/compiler_specific.h" | 14 #include "base/compiler_specific.h" |
14 #include "base/macros.h" | 15 #include "base/macros.h" |
15 #include "base/memory/weak_ptr.h" | 16 #include "base/memory/weak_ptr.h" |
16 #include "base/observer_list.h" | 17 #include "base/observer_list.h" |
17 #include "base/timer/timer.h" | 18 #include "base/timer/timer.h" |
18 #include "cc/surfaces/frame_sink_id.h" | 19 #include "cc/surfaces/frame_sink_id.h" |
19 #include "cc/trees/layer_tree_host_client.h" | 20 #include "cc/trees/layer_tree_host_client.h" |
20 #include "cc/trees/layer_tree_host_single_thread_client.h" | 21 #include "cc/trees/layer_tree_host_single_thread_client.h" |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
96 // LayerTreeHostSingleThreadClient implementation. | 97 // LayerTreeHostSingleThreadClient implementation. |
97 void DidSubmitCompositorFrame() override; | 98 void DidSubmitCompositorFrame() override; |
98 void DidLoseCompositorFrameSink() override; | 99 void DidLoseCompositorFrameSink() override; |
99 | 100 |
100 // WindowAndroidCompositor implementation. | 101 // WindowAndroidCompositor implementation. |
101 void AttachLayerForReadback(scoped_refptr<cc::Layer> layer) override; | 102 void AttachLayerForReadback(scoped_refptr<cc::Layer> layer) override; |
102 void RequestCopyOfOutputOnRootLayer( | 103 void RequestCopyOfOutputOnRootLayer( |
103 std::unique_ptr<cc::CopyOutputRequest> request) override; | 104 std::unique_ptr<cc::CopyOutputRequest> request) override; |
104 void SetNeedsAnimate() override; | 105 void SetNeedsAnimate() override; |
105 cc::FrameSinkId GetFrameSinkId() override; | 106 cc::FrameSinkId GetFrameSinkId() override; |
107 void AddChildFrameSink(cc::FrameSinkId frame_sink_id) override; | |
106 | 108 |
107 void SetVisible(bool visible); | 109 void SetVisible(bool visible); |
108 void CreateLayerTreeHost(); | 110 void CreateLayerTreeHost(); |
109 | 111 |
110 void HandlePendingCompositorFrameSinkRequest(); | 112 void HandlePendingCompositorFrameSinkRequest(); |
111 | 113 |
112 #if defined(ENABLE_VULKAN) | 114 #if defined(ENABLE_VULKAN) |
113 void CreateVulkanOutputSurface(); | 115 void CreateVulkanOutputSurface(); |
114 #endif | 116 #endif |
115 void OnGpuChannelEstablished( | 117 void OnGpuChannelEstablished( |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
158 | 160 |
159 size_t num_successive_context_creation_failures_; | 161 size_t num_successive_context_creation_failures_; |
160 | 162 |
161 // Whether there is an CompositorFrameSink request pending from the current | 163 // Whether there is an CompositorFrameSink request pending from the current |
162 // |host_|. Becomes |true| if RequestNewCompositorFrameSink is called, and | 164 // |host_|. Becomes |true| if RequestNewCompositorFrameSink is called, and |
163 // |false| if |host_| is deleted or we succeed in creating *and* initializing | 165 // |false| if |host_| is deleted or we succeed in creating *and* initializing |
164 // a CompositorFrameSink (which is essentially the contract with cc). | 166 // a CompositorFrameSink (which is essentially the contract with cc). |
165 bool compositor_frame_sink_request_pending_; | 167 bool compositor_frame_sink_request_pending_; |
166 | 168 |
167 gpu::Capabilities gpu_capabilities_; | 169 gpu::Capabilities gpu_capabilities_; |
170 bool has_compositor_frame_sink_ = false; | |
171 std::unordered_set<cc::FrameSinkId, cc::FrameSinkIdHash> | |
172 pending_child_frame_sink_ids_; | |
173 | |
168 base::WeakPtrFactory<CompositorImpl> weak_factory_; | 174 base::WeakPtrFactory<CompositorImpl> weak_factory_; |
169 | |
boliu
2017/01/26 22:39:41
nit: don't remove this blank line
Alex Z.
2017/01/27 20:27:02
Done.
| |
170 DISALLOW_COPY_AND_ASSIGN(CompositorImpl); | 175 DISALLOW_COPY_AND_ASSIGN(CompositorImpl); |
171 }; | 176 }; |
172 | 177 |
173 } // namespace content | 178 } // namespace content |
174 | 179 |
175 #endif // CONTENT_BROWSER_RENDERER_HOST_COMPOSITOR_IMPL_ANDROID_H_ | 180 #endif // CONTENT_BROWSER_RENDERER_HOST_COMPOSITOR_IMPL_ANDROID_H_ |
OLD | NEW |