| 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 "content/browser/android/in_process/synchronous_compositor_output_surfa
ce.h" | 7 #include "content/browser/android/in_process/synchronous_compositor_output_surfa
ce.h" |
| 8 #include "content/public/browser/browser_thread.h" | 8 #include "content/public/browser/browser_thread.h" |
| 9 #include "gpu/command_buffer/client/gl_in_process_context.h" | 9 #include "gpu/command_buffer/client/gl_in_process_context.h" |
| 10 #include "ui/gl/android/surface_texture.h" | 10 #include "ui/gl/android/surface_texture.h" |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 DCHECK(service_); | 183 DCHECK(service_); |
| 184 | 184 |
| 185 if (!share_context_.get()) | 185 if (!share_context_.get()) |
| 186 share_context_ = CreateContext(NULL, service_, NULL); | 186 share_context_ = CreateContext(NULL, service_, NULL); |
| 187 return webkit::gpu::ContextProviderInProcess::Create( | 187 return webkit::gpu::ContextProviderInProcess::Create( |
| 188 WrapContext(CreateContext(surface, service_, share_context_.get())), | 188 WrapContext(CreateContext(surface, service_, share_context_.get())), |
| 189 "Compositor-Onscreen"); | 189 "Compositor-Onscreen"); |
| 190 } | 190 } |
| 191 | 191 |
| 192 scoped_refptr<StreamTextureFactory> | 192 scoped_refptr<StreamTextureFactory> |
| 193 SynchronousCompositorFactoryImpl::CreateStreamTextureFactory(int view_id) { | 193 SynchronousCompositorFactoryImpl::CreateStreamTextureFactory(int frame_id) { |
| 194 scoped_refptr<StreamTextureFactorySynchronousImpl> factory( | 194 scoped_refptr<StreamTextureFactorySynchronousImpl> factory( |
| 195 StreamTextureFactorySynchronousImpl::Create( | 195 StreamTextureFactorySynchronousImpl::Create( |
| 196 base::Bind( | 196 base::Bind( |
| 197 &SynchronousCompositorFactoryImpl::TryCreateStreamTextureFactory, | 197 &SynchronousCompositorFactoryImpl::TryCreateStreamTextureFactory, |
| 198 base::Unretained(this)), | 198 base::Unretained(this)), |
| 199 view_id)); | 199 frame_id)); |
| 200 return factory; | 200 return factory; |
| 201 } | 201 } |
| 202 | 202 |
| 203 blink::WebGraphicsContext3D* | 203 blink::WebGraphicsContext3D* |
| 204 SynchronousCompositorFactoryImpl::CreateOffscreenGraphicsContext3D( | 204 SynchronousCompositorFactoryImpl::CreateOffscreenGraphicsContext3D( |
| 205 const blink::WebGraphicsContext3D::Attributes& attributes) { | 205 const blink::WebGraphicsContext3D::Attributes& attributes) { |
| 206 return WrapContext(CreateOffscreenContext(attributes)).release(); | 206 return WrapContext(CreateOffscreenContext(attributes)).release(); |
| 207 } | 207 } |
| 208 | 208 |
| 209 void SynchronousCompositorFactoryImpl::CompositorInitializedHardwareDraw() { | 209 void SynchronousCompositorFactoryImpl::CompositorInitializedHardwareDraw() { |
| (...skipping 30 matching lines...) Expand all Loading... |
| 240 return video_context_provider_; | 240 return video_context_provider_; |
| 241 } | 241 } |
| 242 | 242 |
| 243 void SynchronousCompositorFactoryImpl::SetDeferredGpuService( | 243 void SynchronousCompositorFactoryImpl::SetDeferredGpuService( |
| 244 scoped_refptr<gpu::InProcessCommandBuffer::Service> service) { | 244 scoped_refptr<gpu::InProcessCommandBuffer::Service> service) { |
| 245 DCHECK(!service_); | 245 DCHECK(!service_); |
| 246 service_ = service; | 246 service_ = service; |
| 247 } | 247 } |
| 248 | 248 |
| 249 } // namespace content | 249 } // namespace content |
| OLD | NEW |