Chromium Code Reviews| 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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 120 return base::UnguessableToken(); | 120 return base::UnguessableToken(); |
| 121 | 121 |
| 122 if (channel_token_.is_empty()) { | 122 if (channel_token_.is_empty()) { |
| 123 context_provider_->GetCommandBufferProxy()->channel()->Send( | 123 context_provider_->GetCommandBufferProxy()->channel()->Send( |
| 124 new GpuCommandBufferMsg_GetChannelToken(&channel_token_)); | 124 new GpuCommandBufferMsg_GetChannelToken(&channel_token_)); |
| 125 } | 125 } |
| 126 | 126 |
| 127 return channel_token_; | 127 return channel_token_; |
| 128 } | 128 } |
| 129 | 129 |
| 130 int32_t RendererGpuVideoAcceleratorFactories::GetCommandBufferRouteId() { | |
| 131 DCHECK(task_runner_->BelongsToCurrentThread()); | |
| 132 if (!context_provider_) | |
|
dcheng
2017/01/10 06:03:42
How come most other things use CheckContextLost()?
sandersd (OOO until July 31)
2017/01/10 23:54:14
I don't care if the returned route_id is invalid,
| |
| 133 return 0; | |
| 134 return context_provider_->GetCommandBufferProxy()->route_id(); | |
| 135 } | |
| 136 | |
| 130 std::unique_ptr<media::VideoDecodeAccelerator> | 137 std::unique_ptr<media::VideoDecodeAccelerator> |
| 131 RendererGpuVideoAcceleratorFactories::CreateVideoDecodeAccelerator() { | 138 RendererGpuVideoAcceleratorFactories::CreateVideoDecodeAccelerator() { |
| 132 DCHECK(video_accelerator_enabled_); | 139 DCHECK(video_accelerator_enabled_); |
| 133 DCHECK(task_runner_->BelongsToCurrentThread()); | 140 DCHECK(task_runner_->BelongsToCurrentThread()); |
| 134 if (CheckContextLost()) | 141 if (CheckContextLost()) |
| 135 return nullptr; | 142 return nullptr; |
| 136 | 143 |
| 137 return std::unique_ptr<media::VideoDecodeAccelerator>( | 144 return std::unique_ptr<media::VideoDecodeAccelerator>( |
| 138 new media::GpuVideoDecodeAcceleratorHost( | 145 new media::GpuVideoDecodeAcceleratorHost( |
| 139 context_provider_->GetCommandBufferProxy())); | 146 context_provider_->GetCommandBufferProxy())); |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 330 context_provider_refptr_ = nullptr; | 337 context_provider_refptr_ = nullptr; |
| 331 } | 338 } |
| 332 | 339 |
| 333 scoped_refptr<ui::ContextProviderCommandBuffer> | 340 scoped_refptr<ui::ContextProviderCommandBuffer> |
| 334 RendererGpuVideoAcceleratorFactories::ContextProviderMainThread() { | 341 RendererGpuVideoAcceleratorFactories::ContextProviderMainThread() { |
| 335 DCHECK(main_thread_task_runner_->BelongsToCurrentThread()); | 342 DCHECK(main_thread_task_runner_->BelongsToCurrentThread()); |
| 336 return context_provider_refptr_; | 343 return context_provider_refptr_; |
| 337 } | 344 } |
| 338 | 345 |
| 339 } // namespace content | 346 } // namespace content |
| OLD | NEW |