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 std::vector<unsigned> MockGpuVideoAcceleratorFactories::ImageTextureTargets() { |
122 return GL_TEXTURE_2D; | 122 std::vector<unsigned> image_targets( |
| 123 static_cast<size_t>(gfx::BufferFormat::LAST) + 1, GL_TEXTURE_2D); |
| 124 return image_targets; |
123 } | 125 } |
124 | 126 |
125 namespace { | 127 namespace { |
126 class ScopedGLContextLockImpl | 128 class ScopedGLContextLockImpl |
127 : public GpuVideoAcceleratorFactories::ScopedGLContextLock { | 129 : public GpuVideoAcceleratorFactories::ScopedGLContextLock { |
128 public: | 130 public: |
129 ScopedGLContextLockImpl(MockGpuVideoAcceleratorFactories* gpu_factories) | 131 ScopedGLContextLockImpl(MockGpuVideoAcceleratorFactories* gpu_factories) |
130 : gpu_factories_(gpu_factories) {} | 132 : gpu_factories_(gpu_factories) {} |
131 gpu::gles2::GLES2Interface* ContextGL() override { | 133 gpu::gles2::GLES2Interface* ContextGL() override { |
132 return gpu_factories_->GetGLES2Interface(); | 134 return gpu_factories_->GetGLES2Interface(); |
133 } | 135 } |
134 | 136 |
135 private: | 137 private: |
136 MockGpuVideoAcceleratorFactories* gpu_factories_; | 138 MockGpuVideoAcceleratorFactories* gpu_factories_; |
137 }; | 139 }; |
138 } // namespace | 140 } // namespace |
139 | 141 |
140 scoped_ptr<GpuVideoAcceleratorFactories::ScopedGLContextLock> | 142 scoped_ptr<GpuVideoAcceleratorFactories::ScopedGLContextLock> |
141 MockGpuVideoAcceleratorFactories::GetGLContextLock() { | 143 MockGpuVideoAcceleratorFactories::GetGLContextLock() { |
142 DCHECK(gles2_); | 144 DCHECK(gles2_); |
143 return make_scoped_ptr(new ScopedGLContextLockImpl(this)); | 145 return make_scoped_ptr(new ScopedGLContextLockImpl(this)); |
144 } | 146 } |
145 | 147 |
146 } // namespace media | 148 } // namespace media |
OLD | NEW |