OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/renderer/media/renderer_gpu_video_accelerator_factories.h" | 5 #include "content/renderer/media/renderer_gpu_video_accelerator_factories.h" |
6 | 6 |
7 #include <GLES2/gl2.h> | 7 #include <GLES2/gl2.h> |
8 #include <GLES2/gl2ext.h> | 8 #include <GLES2/gl2ext.h> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 | 52 |
53 void RendererGpuVideoAcceleratorFactories::BindContext() { | 53 void RendererGpuVideoAcceleratorFactories::BindContext() { |
54 DCHECK(task_runner_->BelongsToCurrentThread()); | 54 DCHECK(task_runner_->BelongsToCurrentThread()); |
55 if (!context_provider_->BindToCurrentThread()) | 55 if (!context_provider_->BindToCurrentThread()) |
56 context_provider_ = NULL; | 56 context_provider_ = NULL; |
57 } | 57 } |
58 | 58 |
59 WebGraphicsContext3DCommandBufferImpl* | 59 WebGraphicsContext3DCommandBufferImpl* |
60 RendererGpuVideoAcceleratorFactories::GetContext3d() { | 60 RendererGpuVideoAcceleratorFactories::GetContext3d() { |
61 DCHECK(task_runner_->BelongsToCurrentThread()); | 61 DCHECK(task_runner_->BelongsToCurrentThread()); |
62 if (!context_provider_) | 62 if (!context_provider_.get()) |
63 return NULL; | 63 return NULL; |
64 if (context_provider_->IsContextLost()) { | 64 if (context_provider_->IsContextLost()) { |
65 context_provider_->VerifyContexts(); | 65 context_provider_->VerifyContexts(); |
66 context_provider_ = NULL; | 66 context_provider_ = NULL; |
67 return NULL; | 67 return NULL; |
68 } | 68 } |
69 return context_provider_->WebContext3D(); | 69 return context_provider_->WebContext3D(); |
70 } | 70 } |
71 | 71 |
72 scoped_ptr<media::VideoDecodeAccelerator> | 72 scoped_ptr<media::VideoDecodeAccelerator> |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 DCHECK(task_runner_->BelongsToCurrentThread()); | 253 DCHECK(task_runner_->BelongsToCurrentThread()); |
254 return ChildThread::AllocateSharedMemory(size, thread_safe_sender_.get()); | 254 return ChildThread::AllocateSharedMemory(size, thread_safe_sender_.get()); |
255 } | 255 } |
256 | 256 |
257 scoped_refptr<base::SingleThreadTaskRunner> | 257 scoped_refptr<base::SingleThreadTaskRunner> |
258 RendererGpuVideoAcceleratorFactories::GetTaskRunner() { | 258 RendererGpuVideoAcceleratorFactories::GetTaskRunner() { |
259 return task_runner_; | 259 return task_runner_; |
260 } | 260 } |
261 | 261 |
262 } // namespace content | 262 } // namespace content |
OLD | NEW |