| 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 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 | 257 |
| 258 std::unique_ptr<media::GpuVideoAcceleratorFactories::ScopedGLContextLock> | 258 std::unique_ptr<media::GpuVideoAcceleratorFactories::ScopedGLContextLock> |
| 259 RendererGpuVideoAcceleratorFactories::GetGLContextLock() { | 259 RendererGpuVideoAcceleratorFactories::GetGLContextLock() { |
| 260 if (CheckContextLost()) | 260 if (CheckContextLost()) |
| 261 return nullptr; | 261 return nullptr; |
| 262 return base::WrapUnique(new ScopedGLContextLockImpl(context_provider_)); | 262 return base::WrapUnique(new ScopedGLContextLockImpl(context_provider_)); |
| 263 } | 263 } |
| 264 | 264 |
| 265 std::unique_ptr<base::SharedMemory> | 265 std::unique_ptr<base::SharedMemory> |
| 266 RendererGpuVideoAcceleratorFactories::CreateSharedMemory(size_t size) { | 266 RendererGpuVideoAcceleratorFactories::CreateSharedMemory(size_t size) { |
| 267 std::unique_ptr<base::SharedMemory> mem( | 267 std::unique_ptr<base::SharedMemory> mem(ChildThreadImpl::AllocateSharedMemory( |
| 268 ChildThreadImpl::AllocateSharedMemory(size, thread_safe_sender_.get())); | 268 size, thread_safe_sender_.get(), nullptr)); |
| 269 if (mem && !mem->Map(size)) | 269 if (mem && !mem->Map(size)) |
| 270 return nullptr; | 270 return nullptr; |
| 271 return mem; | 271 return mem; |
| 272 } | 272 } |
| 273 | 273 |
| 274 scoped_refptr<base::SingleThreadTaskRunner> | 274 scoped_refptr<base::SingleThreadTaskRunner> |
| 275 RendererGpuVideoAcceleratorFactories::GetTaskRunner() { | 275 RendererGpuVideoAcceleratorFactories::GetTaskRunner() { |
| 276 return task_runner_; | 276 return task_runner_; |
| 277 } | 277 } |
| 278 | 278 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 297 context_provider_refptr_ = nullptr; | 297 context_provider_refptr_ = nullptr; |
| 298 } | 298 } |
| 299 | 299 |
| 300 scoped_refptr<ContextProviderCommandBuffer> | 300 scoped_refptr<ContextProviderCommandBuffer> |
| 301 RendererGpuVideoAcceleratorFactories::ContextProviderMainThread() { | 301 RendererGpuVideoAcceleratorFactories::ContextProviderMainThread() { |
| 302 DCHECK(main_thread_task_runner_->BelongsToCurrentThread()); | 302 DCHECK(main_thread_task_runner_->BelongsToCurrentThread()); |
| 303 return context_provider_refptr_; | 303 return context_provider_refptr_; |
| 304 } | 304 } |
| 305 | 305 |
| 306 } // namespace content | 306 } // namespace content |
| OLD | NEW |