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 "ui/gfx/buffer_format_util.h" | 7 #include "ui/gfx/buffer_format_util.h" |
8 #include "ui/gfx/gpu_memory_buffer.h" | 8 #include "ui/gfx/gpu_memory_buffer.h" |
9 | 9 |
10 namespace media { | 10 namespace media { |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 scoped_ptr<VideoEncodeAccelerator> | 111 scoped_ptr<VideoEncodeAccelerator> |
112 MockGpuVideoAcceleratorFactories::CreateVideoEncodeAccelerator() { | 112 MockGpuVideoAcceleratorFactories::CreateVideoEncodeAccelerator() { |
113 return scoped_ptr<VideoEncodeAccelerator>(DoCreateVideoEncodeAccelerator()); | 113 return scoped_ptr<VideoEncodeAccelerator>(DoCreateVideoEncodeAccelerator()); |
114 } | 114 } |
115 | 115 |
116 bool MockGpuVideoAcceleratorFactories::ShouldUseGpuMemoryBuffersForVideoFrames() | 116 bool MockGpuVideoAcceleratorFactories::ShouldUseGpuMemoryBuffersForVideoFrames() |
117 const { | 117 const { |
118 return false; | 118 return false; |
119 } | 119 } |
120 | 120 |
121 unsigned MockGpuVideoAcceleratorFactories::ImageTextureTarget() { | 121 unsigned MockGpuVideoAcceleratorFactories::ImageTextureTarget( |
| 122 gfx::BufferFormat format) { |
122 return GL_TEXTURE_2D; | 123 return GL_TEXTURE_2D; |
123 } | 124 } |
124 | 125 |
125 namespace { | 126 namespace { |
126 class ScopedGLContextLockImpl | 127 class ScopedGLContextLockImpl |
127 : public GpuVideoAcceleratorFactories::ScopedGLContextLock { | 128 : public GpuVideoAcceleratorFactories::ScopedGLContextLock { |
128 public: | 129 public: |
129 ScopedGLContextLockImpl(MockGpuVideoAcceleratorFactories* gpu_factories) | 130 ScopedGLContextLockImpl(MockGpuVideoAcceleratorFactories* gpu_factories) |
130 : gpu_factories_(gpu_factories) {} | 131 : gpu_factories_(gpu_factories) {} |
131 gpu::gles2::GLES2Interface* ContextGL() override { | 132 gpu::gles2::GLES2Interface* ContextGL() override { |
132 return gpu_factories_->GetGLES2Interface(); | 133 return gpu_factories_->GetGLES2Interface(); |
133 } | 134 } |
134 | 135 |
135 private: | 136 private: |
136 MockGpuVideoAcceleratorFactories* gpu_factories_; | 137 MockGpuVideoAcceleratorFactories* gpu_factories_; |
137 }; | 138 }; |
138 } // namespace | 139 } // namespace |
139 | 140 |
140 scoped_ptr<GpuVideoAcceleratorFactories::ScopedGLContextLock> | 141 scoped_ptr<GpuVideoAcceleratorFactories::ScopedGLContextLock> |
141 MockGpuVideoAcceleratorFactories::GetGLContextLock() { | 142 MockGpuVideoAcceleratorFactories::GetGLContextLock() { |
142 DCHECK(gles2_); | 143 DCHECK(gles2_); |
143 return make_scoped_ptr(new ScopedGLContextLockImpl(this)); | 144 return make_scoped_ptr(new ScopedGLContextLockImpl(this)); |
144 } | 145 } |
145 | 146 |
146 } // namespace media | 147 } // namespace media |
OLD | NEW |