| 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 "media/renderers/mock_gpu_video_accelerator_factories.h" | 5 #include "media/renderers/mock_gpu_video_accelerator_factories.h" |
| 6 | 6 |
| 7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
| 8 #include "ui/gfx/buffer_format_util.h" | 8 #include "ui/gfx/buffer_format_util.h" |
| 9 #include "ui/gfx/gpu_memory_buffer.h" | 9 #include "ui/gfx/gpu_memory_buffer.h" |
| 10 | 10 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 return &bytes_[plane][0]; | 45 return &bytes_[plane][0]; |
| 46 } | 46 } |
| 47 void Unmap() override { | 47 void Unmap() override { |
| 48 DCHECK(mapped_); | 48 DCHECK(mapped_); |
| 49 mapped_ = false; | 49 mapped_ = false; |
| 50 } | 50 } |
| 51 gfx::Size GetSize() const override { return size_; } | 51 gfx::Size GetSize() const override { return size_; } |
| 52 gfx::BufferFormat GetFormat() const override { | 52 gfx::BufferFormat GetFormat() const override { |
| 53 return format_; | 53 return format_; |
| 54 } | 54 } |
| 55 int stride(size_t plane) const override { | 55 uint32_t stride(size_t plane) const override { |
| 56 DCHECK_LT(plane, num_planes_); | 56 DCHECK_LT(plane, num_planes_); |
| 57 return static_cast<int>(gfx::RowSizeForBufferFormat( | 57 return static_cast<uint32_t>(gfx::RowSizeForBufferFormat( |
| 58 size_.width(), format_, static_cast<int>(plane))); | 58 size_.width(), format_, static_cast<int>(plane))); |
| 59 } | 59 } |
| 60 gfx::GpuMemoryBufferId GetId() const override { return id_; } | 60 gfx::GpuMemoryBufferId GetId() const override { return id_; } |
| 61 gfx::GpuMemoryBufferHandle GetHandle() const override { | 61 gfx::GpuMemoryBufferHandle GetHandle() const override { |
| 62 NOTREACHED(); | 62 NOTREACHED(); |
| 63 return gfx::GpuMemoryBufferHandle(); | 63 return gfx::GpuMemoryBufferHandle(); |
| 64 } | 64 } |
| 65 ClientBuffer AsClientBuffer() override { | 65 ClientBuffer AsClientBuffer() override { |
| 66 return reinterpret_cast<ClientBuffer>(this); | 66 return reinterpret_cast<ClientBuffer>(this); |
| 67 } | 67 } |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 }; | 142 }; |
| 143 } // namespace | 143 } // namespace |
| 144 | 144 |
| 145 std::unique_ptr<GpuVideoAcceleratorFactories::ScopedGLContextLock> | 145 std::unique_ptr<GpuVideoAcceleratorFactories::ScopedGLContextLock> |
| 146 MockGpuVideoAcceleratorFactories::GetGLContextLock() { | 146 MockGpuVideoAcceleratorFactories::GetGLContextLock() { |
| 147 DCHECK(gles2_); | 147 DCHECK(gles2_); |
| 148 return base::MakeUnique<ScopedGLContextLockImpl>(this); | 148 return base::MakeUnique<ScopedGLContextLockImpl>(this); |
| 149 } | 149 } |
| 150 | 150 |
| 151 } // namespace media | 151 } // namespace media |
| OLD | NEW |