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 | 11 |
12 #include "base/cancelable_callback.h" | 12 #include "base/cancelable_callback.h" |
13 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
14 #include "base/macros.h" | 14 #include "base/macros.h" |
15 #include "base/memory/weak_ptr.h" | 15 #include "base/memory/weak_ptr.h" |
16 #include "base/observer_list.h" | 16 #include "base/observer_list.h" |
17 #include "base/timer/timer.h" | 17 #include "base/timer/timer.h" |
| 18 #include "cc/surfaces/frame_sink_id.h" |
18 #include "cc/trees/layer_tree_host_client.h" | 19 #include "cc/trees/layer_tree_host_client.h" |
19 #include "cc/trees/layer_tree_host_single_thread_client.h" | 20 #include "cc/trees/layer_tree_host_single_thread_client.h" |
20 #include "content/common/content_export.h" | 21 #include "content/common/content_export.h" |
21 #include "content/common/gpu/client/context_provider_command_buffer.h" | 22 #include "content/common/gpu/client/context_provider_command_buffer.h" |
22 #include "content/public/browser/android/compositor.h" | 23 #include "content/public/browser/android/compositor.h" |
23 #include "gpu/command_buffer/common/capabilities.h" | 24 #include "gpu/command_buffer/common/capabilities.h" |
24 #include "gpu/ipc/common/surface_handle.h" | 25 #include "gpu/ipc/common/surface_handle.h" |
25 #include "third_party/khronos/GLES2/gl2.h" | 26 #include "third_party/khronos/GLES2/gl2.h" |
26 #include "ui/android/context_provider_factory.h" | 27 #include "ui/android/context_provider_factory.h" |
27 #include "ui/android/resources/resource_manager_impl.h" | 28 #include "ui/android/resources/resource_manager_impl.h" |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 void OnGpuChannelEstablished( | 133 void OnGpuChannelEstablished( |
133 scoped_refptr<gpu::GpuChannelHost> gpu_channel_host, | 134 scoped_refptr<gpu::GpuChannelHost> gpu_channel_host, |
134 ui::ContextProviderFactory::GpuChannelHostResult result); | 135 ui::ContextProviderFactory::GpuChannelHostResult result); |
135 void InitializeDisplay( | 136 void InitializeDisplay( |
136 std::unique_ptr<cc::OutputSurface> display_output_surface, | 137 std::unique_ptr<cc::OutputSurface> display_output_surface, |
137 scoped_refptr<cc::VulkanContextProvider> vulkan_context_provider, | 138 scoped_refptr<cc::VulkanContextProvider> vulkan_context_provider, |
138 scoped_refptr<cc::ContextProvider> context_provider); | 139 scoped_refptr<cc::ContextProvider> context_provider); |
139 | 140 |
140 bool HavePendingReadbacks(); | 141 bool HavePendingReadbacks(); |
141 | 142 |
| 143 cc::FrameSinkId frame_sink_id_; |
| 144 |
142 // root_layer_ is the persistent internal root layer, while subroot_layer_ | 145 // root_layer_ is the persistent internal root layer, while subroot_layer_ |
143 // is the one attached by the compositor client. | 146 // is the one attached by the compositor client. |
144 scoped_refptr<cc::Layer> subroot_layer_; | 147 scoped_refptr<cc::Layer> subroot_layer_; |
145 | 148 |
146 // Subtree for hidden layers with CopyOutputRequests on them. | 149 // Subtree for hidden layers with CopyOutputRequests on them. |
147 scoped_refptr<cc::Layer> readback_layer_tree_; | 150 scoped_refptr<cc::Layer> readback_layer_tree_; |
148 | 151 |
149 // Destruction order matters here: | 152 // Destruction order matters here: |
150 std::unique_ptr<cc::SurfaceIdAllocator> surface_id_allocator_; | |
151 base::ObserverList<VSyncObserver, true> observer_list_; | 153 base::ObserverList<VSyncObserver, true> observer_list_; |
152 std::unique_ptr<cc::LayerTreeHost> host_; | 154 std::unique_ptr<cc::LayerTreeHost> host_; |
153 ui::ResourceManagerImpl resource_manager_; | 155 ui::ResourceManagerImpl resource_manager_; |
154 | 156 |
155 std::unique_ptr<cc::Display> display_; | 157 std::unique_ptr<cc::Display> display_; |
156 | 158 |
157 gfx::Size size_; | 159 gfx::Size size_; |
158 bool has_transparent_background_; | 160 bool has_transparent_background_; |
159 float device_scale_factor_; | 161 float device_scale_factor_; |
160 | 162 |
(...skipping 22 matching lines...) Expand all Loading... |
183 gpu::Capabilities gpu_capabilities_; | 185 gpu::Capabilities gpu_capabilities_; |
184 bool needs_begin_frames_; | 186 bool needs_begin_frames_; |
185 base::WeakPtrFactory<CompositorImpl> weak_factory_; | 187 base::WeakPtrFactory<CompositorImpl> weak_factory_; |
186 | 188 |
187 DISALLOW_COPY_AND_ASSIGN(CompositorImpl); | 189 DISALLOW_COPY_AND_ASSIGN(CompositorImpl); |
188 }; | 190 }; |
189 | 191 |
190 } // namespace content | 192 } // namespace content |
191 | 193 |
192 #endif // CONTENT_BROWSER_RENDERER_HOST_COMPOSITOR_IMPL_ANDROID_H_ | 194 #endif // CONTENT_BROWSER_RENDERER_HOST_COMPOSITOR_IMPL_ANDROID_H_ |
OLD | NEW |