Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(432)

Side by Side Diff: content/browser/android/in_process/synchronous_compositor_factory_impl.cc

Issue 1317743002: cc: Implement shared worker contexts. (v1) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add missing context3d_task_runner_ check Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 }
176 184
177 return make_scoped_ptr(new SynchronousCompositorOutputSurface( 185 return make_scoped_ptr(new SynchronousCompositorOutputSurface(
178 onscreen_context, worker_context, routing_id, frame_swap_message_queue)); 186 onscreen_context, worker_context, routing_id, frame_swap_message_queue));
179 } 187 }
180 188
181 InputHandlerManagerClient* 189 InputHandlerManagerClient*
182 SynchronousCompositorFactoryImpl::GetInputHandlerManagerClient() { 190 SynchronousCompositorFactoryImpl::GetInputHandlerManagerClient() {
183 return synchronous_input_event_filter(); 191 return synchronous_input_event_filter();
184 } 192 }
185 193
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 void SynchronousCompositorFactoryImpl::SetRecordFullDocument( 357 void SynchronousCompositorFactoryImpl::SetRecordFullDocument(
350 bool record_full_document) { 358 bool record_full_document) {
351 record_full_layer_ = record_full_document; 359 record_full_layer_ = record_full_document;
352 } 360 }
353 361
354 void SynchronousCompositorFactoryImpl::SetUseIpcCommandBuffer() { 362 void SynchronousCompositorFactoryImpl::SetUseIpcCommandBuffer() {
355 use_ipc_command_buffer_ = true; 363 use_ipc_command_buffer_ = true;
356 } 364 }
357 365
358 } // namespace content 366 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698