| 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 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 | 261 |
| 262 private: | 262 private: |
| 263 cc::ContextProvider::ScopedContextLock lock_; | 263 cc::ContextProvider::ScopedContextLock lock_; |
| 264 }; | 264 }; |
| 265 } // namespace | 265 } // namespace |
| 266 | 266 |
| 267 std::unique_ptr<media::GpuVideoAcceleratorFactories::ScopedGLContextLock> | 267 std::unique_ptr<media::GpuVideoAcceleratorFactories::ScopedGLContextLock> |
| 268 RendererGpuVideoAcceleratorFactories::GetGLContextLock() { | 268 RendererGpuVideoAcceleratorFactories::GetGLContextLock() { |
| 269 if (CheckContextLost()) | 269 if (CheckContextLost()) |
| 270 return nullptr; | 270 return nullptr; |
| 271 return base::WrapUnique(new ScopedGLContextLockImpl(context_provider_)); | 271 return base::MakeUnique<ScopedGLContextLockImpl>(context_provider_); |
| 272 } | 272 } |
| 273 | 273 |
| 274 std::unique_ptr<base::SharedMemory> | 274 std::unique_ptr<base::SharedMemory> |
| 275 RendererGpuVideoAcceleratorFactories::CreateSharedMemory(size_t size) { | 275 RendererGpuVideoAcceleratorFactories::CreateSharedMemory(size_t size) { |
| 276 std::unique_ptr<base::SharedMemory> mem(ChildThreadImpl::AllocateSharedMemory( | 276 std::unique_ptr<base::SharedMemory> mem(ChildThreadImpl::AllocateSharedMemory( |
| 277 size, thread_safe_sender_.get(), nullptr)); | 277 size, thread_safe_sender_.get(), nullptr)); |
| 278 if (mem && !mem->Map(size)) | 278 if (mem && !mem->Map(size)) |
| 279 return nullptr; | 279 return nullptr; |
| 280 return mem; | 280 return mem; |
| 281 } | 281 } |
| (...skipping 24 matching lines...) Expand all Loading... |
| 306 context_provider_refptr_ = nullptr; | 306 context_provider_refptr_ = nullptr; |
| 307 } | 307 } |
| 308 | 308 |
| 309 scoped_refptr<ContextProviderCommandBuffer> | 309 scoped_refptr<ContextProviderCommandBuffer> |
| 310 RendererGpuVideoAcceleratorFactories::ContextProviderMainThread() { | 310 RendererGpuVideoAcceleratorFactories::ContextProviderMainThread() { |
| 311 DCHECK(main_thread_task_runner_->BelongsToCurrentThread()); | 311 DCHECK(main_thread_task_runner_->BelongsToCurrentThread()); |
| 312 return context_provider_refptr_; | 312 return context_provider_refptr_; |
| 313 } | 313 } |
| 314 | 314 |
| 315 } // namespace content | 315 } // namespace content |
| OLD | NEW |