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> |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 void SetNeedsAnimate() override; | 120 void SetNeedsAnimate() override; |
121 void SetVisible(bool visible); | 121 void SetVisible(bool visible); |
122 void CreateLayerTreeHost(); | 122 void CreateLayerTreeHost(); |
123 | 123 |
124 void HandlePendingOutputSurfaceRequest(); | 124 void HandlePendingOutputSurfaceRequest(); |
125 | 125 |
126 #if defined(ENABLE_VULKAN) | 126 #if defined(ENABLE_VULKAN) |
127 void CreateVulkanOutputSurface(); | 127 void CreateVulkanOutputSurface(); |
128 #endif | 128 #endif |
129 void CreateCompositorOutputSurface( | 129 void CreateCompositorOutputSurface( |
130 const scoped_refptr<cc::ContextProvider>& context_provider, | 130 const scoped_refptr<cc::ContextProvider>& context_provider); |
131 ui::ContextProviderFactory::ContextCreationResult result); | |
132 void InitializeDisplay( | 131 void InitializeDisplay( |
133 std::unique_ptr<cc::OutputSurface> display_output_surface, | 132 std::unique_ptr<cc::OutputSurface> display_output_surface, |
134 scoped_refptr<cc::VulkanContextProvider> vulkan_context_provider, | 133 scoped_refptr<cc::VulkanContextProvider> vulkan_context_provider, |
135 scoped_refptr<cc::ContextProvider> context_provider); | 134 scoped_refptr<cc::ContextProvider> context_provider); |
136 | 135 |
137 bool HavePendingReadbacks(); | 136 bool HavePendingReadbacks(); |
138 | 137 |
139 // root_layer_ is the persistent internal root layer, while subroot_layer_ | 138 // root_layer_ is the persistent internal root layer, while subroot_layer_ |
140 // is the one attached by the compositor client. | 139 // is the one attached by the compositor client. |
141 scoped_refptr<cc::Layer> subroot_layer_; | 140 scoped_refptr<cc::Layer> subroot_layer_; |
(...skipping 20 matching lines...) Expand all Loading... |
162 | 161 |
163 gfx::NativeWindow root_window_; | 162 gfx::NativeWindow root_window_; |
164 | 163 |
165 // Whether we need to update animations on the next composite. | 164 // Whether we need to update animations on the next composite. |
166 bool needs_animate_; | 165 bool needs_animate_; |
167 | 166 |
168 // The number of SwapBuffer calls that have not returned and ACK'd from | 167 // The number of SwapBuffer calls that have not returned and ACK'd from |
169 // the GPU thread. | 168 // the GPU thread. |
170 unsigned int pending_swapbuffers_; | 169 unsigned int pending_swapbuffers_; |
171 | 170 |
172 size_t num_successive_gpu_process_initialization_failures_; | |
173 size_t num_successive_context_creation_failures_; | 171 size_t num_successive_context_creation_failures_; |
174 | 172 |
175 // Whether there is an OutputSurface request pending from the current | 173 // Whether there is an OutputSurface request pending from the current |
176 // |host_|. Becomes |true| if RequestNewOutputSurface is called, and |false| | 174 // |host_|. Becomes |true| if RequestNewOutputSurface is called, and |false| |
177 // if |host_| is deleted or we succeed in creating *and* initializing an | 175 // if |host_| is deleted or we succeed in creating *and* initializing an |
178 // OutputSurface (which is essentially the contract with cc). | 176 // OutputSurface (which is essentially the contract with cc). |
179 bool output_surface_request_pending_; | 177 bool output_surface_request_pending_; |
180 | 178 |
181 gpu::Capabilities gpu_capabilities_; | 179 gpu::Capabilities gpu_capabilities_; |
182 bool needs_begin_frames_; | 180 bool needs_begin_frames_; |
183 base::WeakPtrFactory<CompositorImpl> weak_factory_; | 181 base::WeakPtrFactory<CompositorImpl> weak_factory_; |
184 | 182 |
185 DISALLOW_COPY_AND_ASSIGN(CompositorImpl); | 183 DISALLOW_COPY_AND_ASSIGN(CompositorImpl); |
186 }; | 184 }; |
187 | 185 |
188 } // namespace content | 186 } // namespace content |
189 | 187 |
190 #endif // CONTENT_BROWSER_RENDERER_HOST_COMPOSITOR_IMPL_ANDROID_H_ | 188 #endif // CONTENT_BROWSER_RENDERER_HOST_COMPOSITOR_IMPL_ANDROID_H_ |
OLD | NEW |