| 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 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 cc::ContextProvider::ScopedContextLock lock(context_provider_); | 231 cc::ContextProvider::ScopedContextLock lock(context_provider_); |
| 232 gpu::gles2::GLES2Interface* gles2 = lock.ContextGL(); | 232 gpu::gles2::GLES2Interface* gles2 = lock.ContextGL(); |
| 233 gles2->WaitSyncTokenCHROMIUM(sync_token.GetConstData()); | 233 gles2->WaitSyncTokenCHROMIUM(sync_token.GetConstData()); |
| 234 | 234 |
| 235 // Callers expect the WaitSyncToken to affect the next IPCs. Make sure to | 235 // Callers expect the WaitSyncToken to affect the next IPCs. Make sure to |
| 236 // flush the command buffers to ensure that. | 236 // flush the command buffers to ensure that. |
| 237 gles2->ShallowFlushCHROMIUM(); | 237 gles2->ShallowFlushCHROMIUM(); |
| 238 } | 238 } |
| 239 | 239 |
| 240 std::unique_ptr<gfx::GpuMemoryBuffer> | 240 std::unique_ptr<gfx::GpuMemoryBuffer> |
| 241 RendererGpuVideoAcceleratorFactories::AllocateGpuMemoryBuffer( | 241 RendererGpuVideoAcceleratorFactories::CreateGpuMemoryBuffer( |
| 242 const gfx::Size& size, | 242 const gfx::Size& size, |
| 243 gfx::BufferFormat format, | 243 gfx::BufferFormat format, |
| 244 gfx::BufferUsage usage) { | 244 gfx::BufferUsage usage) { |
| 245 std::unique_ptr<gfx::GpuMemoryBuffer> buffer = | 245 std::unique_ptr<gfx::GpuMemoryBuffer> buffer = |
| 246 gpu_memory_buffer_manager_->AllocateGpuMemoryBuffer( | 246 gpu_memory_buffer_manager_->CreateGpuMemoryBuffer( |
| 247 size, format, usage, gpu::kNullSurfaceHandle); | 247 size, format, usage, gpu::kNullSurfaceHandle); |
| 248 return buffer; | 248 return buffer; |
| 249 } | 249 } |
| 250 bool RendererGpuVideoAcceleratorFactories:: | 250 bool RendererGpuVideoAcceleratorFactories:: |
| 251 ShouldUseGpuMemoryBuffersForVideoFrames() const { | 251 ShouldUseGpuMemoryBuffersForVideoFrames() const { |
| 252 return enable_gpu_memory_buffer_video_frames_; | 252 return enable_gpu_memory_buffer_video_frames_; |
| 253 } | 253 } |
| 254 | 254 |
| 255 unsigned RendererGpuVideoAcceleratorFactories::ImageTextureTarget( | 255 unsigned RendererGpuVideoAcceleratorFactories::ImageTextureTarget( |
| 256 gfx::BufferFormat format) { | 256 gfx::BufferFormat format) { |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after 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 |