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 RendererGpuVideoAcceleratorFactories::RendererGpuVideoAcceleratorFactories() | 52 RendererGpuVideoAcceleratorFactories::RendererGpuVideoAcceleratorFactories() |
53 : aborted_waiter_(true, false), | 53 : aborted_waiter_(true, false), |
54 task_runner_async_waiter_(false, false) {} | 54 task_runner_async_waiter_(false, false) {} |
55 | 55 |
56 WebGraphicsContext3DCommandBufferImpl* | 56 WebGraphicsContext3DCommandBufferImpl* |
57 RendererGpuVideoAcceleratorFactories::GetContext3d() { | 57 RendererGpuVideoAcceleratorFactories::GetContext3d() { |
58 DCHECK(task_runner_->BelongsToCurrentThread()); | 58 DCHECK(task_runner_->BelongsToCurrentThread()); |
59 if (!context_provider_) | 59 if (!context_provider_) |
60 return NULL; | 60 return NULL; |
61 WebGraphicsContext3DCommandBufferImpl* context = | 61 WebGraphicsContext3DCommandBufferImpl* context = |
62 context_provider_->Context3d(); | 62 static_cast<WebGraphicsContext3DCommandBufferImpl*>( |
| 63 context_provider_->WebContext3D()); |
63 if (context->isContextLost()) { | 64 if (context->isContextLost()) { |
64 context_provider_->VerifyContexts(); | 65 context_provider_->VerifyContexts(); |
65 context_provider_ = NULL; | 66 context_provider_ = NULL; |
66 return NULL; | 67 return NULL; |
67 } | 68 } |
68 return context; | 69 return context; |
69 } | 70 } |
70 | 71 |
71 void RendererGpuVideoAcceleratorFactories::AsyncBindContext() { | 72 void RendererGpuVideoAcceleratorFactories::AsyncBindContext() { |
72 DCHECK(task_runner_->BelongsToCurrentThread()); | 73 DCHECK(task_runner_->BelongsToCurrentThread()); |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 } | 313 } |
313 | 314 |
314 void | 315 void |
315 RendererGpuVideoAcceleratorFactories::AsyncDestroyVideoDecodeAccelerator() { | 316 RendererGpuVideoAcceleratorFactories::AsyncDestroyVideoDecodeAccelerator() { |
316 // OK to release because Destroy() will delete the VDA instance. | 317 // OK to release because Destroy() will delete the VDA instance. |
317 if (vda_) | 318 if (vda_) |
318 vda_.release()->Destroy(); | 319 vda_.release()->Destroy(); |
319 } | 320 } |
320 | 321 |
321 } // namespace content | 322 } // namespace content |
OLD | NEW |