| 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 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 | 291 |
| 292 std::unique_ptr<media::GpuVideoAcceleratorFactories::ScopedGLContextLock> | 292 std::unique_ptr<media::GpuVideoAcceleratorFactories::ScopedGLContextLock> |
| 293 RendererGpuVideoAcceleratorFactories::GetGLContextLock() { | 293 RendererGpuVideoAcceleratorFactories::GetGLContextLock() { |
| 294 if (CheckContextLost()) | 294 if (CheckContextLost()) |
| 295 return nullptr; | 295 return nullptr; |
| 296 return base::MakeUnique<ScopedGLContextLockImpl>(context_provider_); | 296 return base::MakeUnique<ScopedGLContextLockImpl>(context_provider_); |
| 297 } | 297 } |
| 298 | 298 |
| 299 std::unique_ptr<base::SharedMemory> | 299 std::unique_ptr<base::SharedMemory> |
| 300 RendererGpuVideoAcceleratorFactories::CreateSharedMemory(size_t size) { | 300 RendererGpuVideoAcceleratorFactories::CreateSharedMemory(size_t size) { |
| 301 std::unique_ptr<base::SharedMemory> mem(ChildThreadImpl::AllocateSharedMemory( | 301 std::unique_ptr<base::SharedMemory> mem( |
| 302 size, thread_safe_sender_.get(), nullptr)); | 302 ChildThreadImpl::AllocateSharedMemory(size)); |
| 303 if (mem && !mem->Map(size)) | 303 if (mem && !mem->Map(size)) |
| 304 return nullptr; | 304 return nullptr; |
| 305 return mem; | 305 return mem; |
| 306 } | 306 } |
| 307 | 307 |
| 308 scoped_refptr<base::SingleThreadTaskRunner> | 308 scoped_refptr<base::SingleThreadTaskRunner> |
| 309 RendererGpuVideoAcceleratorFactories::GetTaskRunner() { | 309 RendererGpuVideoAcceleratorFactories::GetTaskRunner() { |
| 310 return task_runner_; | 310 return task_runner_; |
| 311 } | 311 } |
| 312 | 312 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 331 context_provider_refptr_ = nullptr; | 331 context_provider_refptr_ = nullptr; |
| 332 } | 332 } |
| 333 | 333 |
| 334 scoped_refptr<ContextProviderCommandBuffer> | 334 scoped_refptr<ContextProviderCommandBuffer> |
| 335 RendererGpuVideoAcceleratorFactories::ContextProviderMainThread() { | 335 RendererGpuVideoAcceleratorFactories::ContextProviderMainThread() { |
| 336 DCHECK(main_thread_task_runner_->BelongsToCurrentThread()); | 336 DCHECK(main_thread_task_runner_->BelongsToCurrentThread()); |
| 337 return context_provider_refptr_; | 337 return context_provider_refptr_; |
| 338 } | 338 } |
| 339 | 339 |
| 340 } // namespace content | 340 } // namespace content |
| OLD | NEW |