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 "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 14 matching lines...) Expand all Loading... | |
| 25 const scoped_refptr<cc::ContextProvider>& context_provider, | 25 const scoped_refptr<cc::ContextProvider>& context_provider, |
| 26 gpu::GLInProcessContext* gl_in_process_context) | 26 gpu::GLInProcessContext* gl_in_process_context) |
| 27 : context_provider_(context_provider), | 27 : context_provider_(context_provider), |
| 28 gl_in_process_context_(gl_in_process_context) {} | 28 gl_in_process_context_(gl_in_process_context) {} |
| 29 | 29 |
| 30 virtual scoped_refptr<gfx::SurfaceTexture> GetSurfaceTexture( | 30 virtual scoped_refptr<gfx::SurfaceTexture> GetSurfaceTexture( |
| 31 uint32 stream_id) OVERRIDE { | 31 uint32 stream_id) OVERRIDE { |
| 32 return gl_in_process_context_->GetSurfaceTexture(stream_id); | 32 return gl_in_process_context_->GetSurfaceTexture(stream_id); |
| 33 } | 33 } |
| 34 | 34 |
| 35 virtual blink::WebGraphicsContext3D* Context3d() OVERRIDE { | 35 virtual gpu::gles2::GLES2Interface* ContextGL() OVERRIDE { |
| 36 return context_provider_->Context3d(); | 36 if (context_provider_->IsContextLost()) |
|
danakj
2014/01/09 21:23:34
It's kinda weird to have a NULL pointer due to con
jamesr
2014/01/10 00:12:34
sievers@ - do you know why StreamTextureFactory us
| |
| 37 return NULL; | |
| 38 return context_provider_->ContextGL(); | |
| 37 } | 39 } |
| 38 | 40 |
| 39 private: | 41 private: |
| 40 friend class base::RefCountedThreadSafe<VideoContextProvider>; | 42 friend class base::RefCountedThreadSafe<VideoContextProvider>; |
| 41 virtual ~VideoContextProvider() {} | 43 virtual ~VideoContextProvider() {} |
| 42 | 44 |
| 43 scoped_refptr<cc::ContextProvider> context_provider_; | 45 scoped_refptr<cc::ContextProvider> context_provider_; |
| 44 gpu::GLInProcessContext* gl_in_process_context_; | 46 gpu::GLInProcessContext* gl_in_process_context_; |
| 45 | 47 |
| 46 DISALLOW_COPY_AND_ASSIGN(VideoContextProvider); | 48 DISALLOW_COPY_AND_ASSIGN(VideoContextProvider); |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 202 wrapped_gl_context_for_main_thread_ = context.get(); | 204 wrapped_gl_context_for_main_thread_ = context.get(); |
| 203 if (!context.get()) | 205 if (!context.get()) |
| 204 return scoped_ptr<WebGraphicsContext3DInProcessCommandBufferImpl>(); | 206 return scoped_ptr<WebGraphicsContext3DInProcessCommandBufferImpl>(); |
| 205 | 207 |
| 206 return scoped_ptr<WebGraphicsContext3DInProcessCommandBufferImpl>( | 208 return scoped_ptr<WebGraphicsContext3DInProcessCommandBufferImpl>( |
| 207 WebGraphicsContext3DInProcessCommandBufferImpl::WrapContext( | 209 WebGraphicsContext3DInProcessCommandBufferImpl::WrapContext( |
| 208 context.Pass(), attributes)); | 210 context.Pass(), attributes)); |
| 209 } | 211 } |
| 210 | 212 |
| 211 } // namespace content | 213 } // namespace content |
| OLD | NEW |