| 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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 | 166 |
| 167 scoped_ptr<cc::OutputSurface> | 167 scoped_ptr<cc::OutputSurface> |
| 168 SynchronousCompositorFactoryImpl::CreateOutputSurface( | 168 SynchronousCompositorFactoryImpl::CreateOutputSurface( |
| 169 int routing_id, | 169 int routing_id, |
| 170 int surface_id, | 170 int surface_id, |
| 171 scoped_refptr<content::FrameSwapMessageQueue> frame_swap_message_queue) { | 171 scoped_refptr<content::FrameSwapMessageQueue> frame_swap_message_queue) { |
| 172 scoped_refptr<cc::ContextProvider> onscreen_context = | 172 scoped_refptr<cc::ContextProvider> onscreen_context = |
| 173 CreateContextProviderForCompositor(surface_id, RENDER_COMPOSITOR_CONTEXT); | 173 CreateContextProviderForCompositor(surface_id, RENDER_COMPOSITOR_CONTEXT); |
| 174 scoped_refptr<cc::ContextProvider> worker_context = | 174 scoped_refptr<cc::ContextProvider> worker_context = |
| 175 CreateContextProviderForCompositor(0, RENDER_WORKER_CONTEXT); | 175 CreateContextProviderForCompositor(0, RENDER_WORKER_CONTEXT); |
| 176 if (!worker_context->BindToCurrentThread()) | |
| 177 worker_context = nullptr; | |
| 178 if (worker_context) { | |
| 179 worker_context->SetupLock(); | |
| 180 // Detach from thread to allow context to be destroyed on a | |
| 181 // different thread without being used. | |
| 182 worker_context->DetachFromThread(); | |
| 183 } | |
| 184 | 176 |
| 185 return make_scoped_ptr(new SynchronousCompositorOutputSurface( | 177 return make_scoped_ptr(new SynchronousCompositorOutputSurface( |
| 186 onscreen_context, worker_context, routing_id, frame_swap_message_queue)); | 178 onscreen_context, worker_context, routing_id, frame_swap_message_queue)); |
| 187 } | 179 } |
| 188 | 180 |
| 189 InputHandlerManagerClient* | 181 InputHandlerManagerClient* |
| 190 SynchronousCompositorFactoryImpl::GetInputHandlerManagerClient() { | 182 SynchronousCompositorFactoryImpl::GetInputHandlerManagerClient() { |
| 191 return synchronous_input_event_filter(); | 183 return synchronous_input_event_filter(); |
| 192 } | 184 } |
| 193 | 185 |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 357 void SynchronousCompositorFactoryImpl::SetRecordFullDocument( | 349 void SynchronousCompositorFactoryImpl::SetRecordFullDocument( |
| 358 bool record_full_document) { | 350 bool record_full_document) { |
| 359 record_full_layer_ = record_full_document; | 351 record_full_layer_ = record_full_document; |
| 360 } | 352 } |
| 361 | 353 |
| 362 void SynchronousCompositorFactoryImpl::SetUseIpcCommandBuffer() { | 354 void SynchronousCompositorFactoryImpl::SetUseIpcCommandBuffer() { |
| 363 use_ipc_command_buffer_ = true; | 355 use_ipc_command_buffer_ = true; |
| 364 } | 356 } |
| 365 | 357 |
| 366 } // namespace content | 358 } // namespace content |
| OLD | NEW |