Chromium Code Reviews| 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/observer_list.h" | 7 #include "base/observer_list.h" |
| 8 #include "cc/scheduler/begin_frame_source.h" | |
| 9 #include "content/browser/android/in_process/synchronous_compositor_impl.h" | |
| 8 #include "content/browser/android/in_process/synchronous_compositor_output_surfa ce.h" | 10 #include "content/browser/android/in_process/synchronous_compositor_output_surfa ce.h" |
| 9 #include "content/public/browser/browser_thread.h" | 11 #include "content/public/browser/browser_thread.h" |
| 10 #include "content/renderer/gpu/frame_swap_message_queue.h" | 12 #include "content/renderer/gpu/frame_swap_message_queue.h" |
| 11 #include "gpu/command_buffer/client/gl_in_process_context.h" | 13 #include "gpu/command_buffer/client/gl_in_process_context.h" |
| 12 #include "gpu/command_buffer/common/gles2_cmd_utils.h" | 14 #include "gpu/command_buffer/common/gles2_cmd_utils.h" |
| 13 #include "ui/gl/android/surface_texture.h" | 15 #include "ui/gl/android/surface_texture.h" |
| 14 #include "ui/gl/gl_surface.h" | 16 #include "ui/gl/gl_surface.h" |
| 15 #include "ui/gl/gl_surface_stub.h" | 17 #include "ui/gl/gl_surface_stub.h" |
| 16 #include "webkit/common/gpu/context_provider_in_process.h" | 18 #include "webkit/common/gpu/context_provider_in_process.h" |
| 17 #include "webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl. h" | 19 #include "webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl. h" |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 182 new SynchronousCompositorOutputSurface(routing_id, | 184 new SynchronousCompositorOutputSurface(routing_id, |
| 183 frame_swap_message_queue)); | 185 frame_swap_message_queue)); |
| 184 return output_surface.PassAs<cc::OutputSurface>(); | 186 return output_surface.PassAs<cc::OutputSurface>(); |
| 185 } | 187 } |
| 186 | 188 |
| 187 InputHandlerManagerClient* | 189 InputHandlerManagerClient* |
| 188 SynchronousCompositorFactoryImpl::GetInputHandlerManagerClient() { | 190 SynchronousCompositorFactoryImpl::GetInputHandlerManagerClient() { |
| 189 return synchronous_input_event_filter(); | 191 return synchronous_input_event_filter(); |
| 190 } | 192 } |
| 191 | 193 |
| 194 scoped_ptr<cc::BeginFrameSource> | |
| 195 SynchronousCompositorFactoryImpl::GetExternalBeginFrameSource(int routing_id) { | |
| 196 SynchronousCompositorImpl* compositor = | |
| 197 SynchronousCompositorImpl::FromRoutingID(routing_id); | |
| 198 return compositor->GetExternalBeginFrameSource(); | |
|
boliu
2014/10/18 00:49:38
This is not thread safe.
Maybe follow the OutputS
simonhong
2014/10/23 01:03:08
Done.
| |
| 199 } | |
| 200 | |
| 192 scoped_refptr<ContextProviderWebContext> | 201 scoped_refptr<ContextProviderWebContext> |
| 193 SynchronousCompositorFactoryImpl::CreateOffscreenContextProvider( | 202 SynchronousCompositorFactoryImpl::CreateOffscreenContextProvider( |
| 194 const blink::WebGraphicsContext3D::Attributes& attributes, | 203 const blink::WebGraphicsContext3D::Attributes& attributes, |
| 195 const std::string& debug_name) { | 204 const std::string& debug_name) { |
| 196 scoped_ptr<gpu::GLInProcessContext> context = | 205 scoped_ptr<gpu::GLInProcessContext> context = |
| 197 CreateOffscreenContext(attributes); | 206 CreateOffscreenContext(attributes); |
| 198 return webkit::gpu::ContextProviderInProcess::Create( | 207 return webkit::gpu::ContextProviderInProcess::Create( |
| 199 WrapContext(context.Pass()), debug_name); | 208 WrapContext(context.Pass()), debug_name); |
| 200 } | 209 } |
| 201 | 210 |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 289 DCHECK(!service_.get()); | 298 DCHECK(!service_.get()); |
| 290 service_ = service; | 299 service_ = service; |
| 291 } | 300 } |
| 292 | 301 |
| 293 void SynchronousCompositorFactoryImpl::SetRecordFullDocument( | 302 void SynchronousCompositorFactoryImpl::SetRecordFullDocument( |
| 294 bool record_full_document) { | 303 bool record_full_document) { |
| 295 record_full_layer_ = record_full_document; | 304 record_full_layer_ = record_full_document; |
| 296 } | 305 } |
| 297 | 306 |
| 298 } // namespace content | 307 } // namespace content |
| OLD | NEW |