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 #include "content/browser/android/in_process/synchronous_compositor_factory_impl
.h" | 5 #include "content/browser/android/in_process/synchronous_compositor_factory_impl
.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/observer_list.h" | 8 #include "base/observer_list.h" |
9 #include "base/sys_info.h" | 9 #include "base/sys_info.h" |
10 #include "base/thread_task_runner_handle.h" | 10 #include "base/thread_task_runner_handle.h" |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 | 170 |
171 scoped_ptr<cc::OutputSurface> | 171 scoped_ptr<cc::OutputSurface> |
172 SynchronousCompositorFactoryImpl::CreateOutputSurface( | 172 SynchronousCompositorFactoryImpl::CreateOutputSurface( |
173 int routing_id, | 173 int routing_id, |
174 int surface_id, | 174 int surface_id, |
175 scoped_refptr<content::FrameSwapMessageQueue> frame_swap_message_queue) { | 175 scoped_refptr<content::FrameSwapMessageQueue> frame_swap_message_queue) { |
176 scoped_refptr<cc::ContextProvider> onscreen_context = | 176 scoped_refptr<cc::ContextProvider> onscreen_context = |
177 CreateContextProviderForCompositor(surface_id, RENDER_COMPOSITOR_CONTEXT); | 177 CreateContextProviderForCompositor(surface_id, RENDER_COMPOSITOR_CONTEXT); |
178 scoped_refptr<cc::ContextProvider> worker_context = | 178 scoped_refptr<cc::ContextProvider> worker_context = |
179 CreateContextProviderForCompositor(0, RENDER_WORKER_CONTEXT); | 179 CreateContextProviderForCompositor(0, RENDER_WORKER_CONTEXT); |
| 180 if (!worker_context->BindToCurrentThread()) |
| 181 worker_context = nullptr; |
| 182 if (worker_context) { |
| 183 worker_context->SetupLock(); |
| 184 // Detach from thread to allow context to be destroyed on a different |
| 185 // thread without being used. |
| 186 worker_context->DetachFromThread(); |
| 187 } |
180 | 188 |
181 return make_scoped_ptr(new SynchronousCompositorOutputSurface( | 189 return make_scoped_ptr(new SynchronousCompositorOutputSurface( |
182 onscreen_context, worker_context, routing_id, frame_swap_message_queue)); | 190 onscreen_context, worker_context, routing_id, frame_swap_message_queue)); |
183 } | 191 } |
184 | 192 |
185 InputHandlerManagerClient* | 193 InputHandlerManagerClient* |
186 SynchronousCompositorFactoryImpl::GetInputHandlerManagerClient() { | 194 SynchronousCompositorFactoryImpl::GetInputHandlerManagerClient() { |
187 return synchronous_input_event_filter(); | 195 return synchronous_input_event_filter(); |
188 } | 196 } |
189 | 197 |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
353 void SynchronousCompositorFactoryImpl::SetRecordFullDocument( | 361 void SynchronousCompositorFactoryImpl::SetRecordFullDocument( |
354 bool record_full_document) { | 362 bool record_full_document) { |
355 record_full_layer_ = record_full_document; | 363 record_full_layer_ = record_full_document; |
356 } | 364 } |
357 | 365 |
358 void SynchronousCompositorFactoryImpl::SetUseIpcCommandBuffer() { | 366 void SynchronousCompositorFactoryImpl::SetUseIpcCommandBuffer() { |
359 use_ipc_command_buffer_ = true; | 367 use_ipc_command_buffer_ = true; |
360 } | 368 } |
361 | 369 |
362 } // namespace content | 370 } // namespace content |
OLD | NEW |