Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(913)

Side by Side Diff: media/renderers/mock_gpu_video_accelerator_factories.cc

Issue 1304843005: Deal with AllocateGpuMemoryBuffer returning null. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add "ForTesting" suffix. Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 76
77 bool MockGpuVideoAcceleratorFactories::IsGpuVideoAcceleratorEnabled() { 77 bool MockGpuVideoAcceleratorFactories::IsGpuVideoAcceleratorEnabled() {
78 return true; 78 return true;
79 } 79 }
80 80
81 scoped_ptr<gfx::GpuMemoryBuffer> 81 scoped_ptr<gfx::GpuMemoryBuffer>
82 MockGpuVideoAcceleratorFactories::AllocateGpuMemoryBuffer( 82 MockGpuVideoAcceleratorFactories::AllocateGpuMemoryBuffer(
83 const gfx::Size& size, 83 const gfx::Size& size,
84 gfx::BufferFormat format, 84 gfx::BufferFormat format,
85 gfx::BufferUsage usage) { 85 gfx::BufferUsage usage) {
86 if (fail_to_allocate_gpu_memory_buffer_)
87 return nullptr;
86 return make_scoped_ptr<gfx::GpuMemoryBuffer>( 88 return make_scoped_ptr<gfx::GpuMemoryBuffer>(
87 new GpuMemoryBufferImpl(size, format)); 89 new GpuMemoryBufferImpl(size, format));
88 } 90 }
89 91
90 scoped_ptr<base::SharedMemory> 92 scoped_ptr<base::SharedMemory>
91 MockGpuVideoAcceleratorFactories::CreateSharedMemory(size_t size) { 93 MockGpuVideoAcceleratorFactories::CreateSharedMemory(size_t size) {
92 return nullptr; 94 return nullptr;
93 } 95 }
94 96
95 scoped_ptr<VideoDecodeAccelerator> 97 scoped_ptr<VideoDecodeAccelerator>
96 MockGpuVideoAcceleratorFactories::CreateVideoDecodeAccelerator() { 98 MockGpuVideoAcceleratorFactories::CreateVideoDecodeAccelerator() {
97 return scoped_ptr<VideoDecodeAccelerator>(DoCreateVideoDecodeAccelerator()); 99 return scoped_ptr<VideoDecodeAccelerator>(DoCreateVideoDecodeAccelerator());
98 } 100 }
99 101
100 scoped_ptr<VideoEncodeAccelerator> 102 scoped_ptr<VideoEncodeAccelerator>
101 MockGpuVideoAcceleratorFactories::CreateVideoEncodeAccelerator() { 103 MockGpuVideoAcceleratorFactories::CreateVideoEncodeAccelerator() {
102 return scoped_ptr<VideoEncodeAccelerator>(DoCreateVideoEncodeAccelerator()); 104 return scoped_ptr<VideoEncodeAccelerator>(DoCreateVideoEncodeAccelerator());
103 } 105 }
104 106
105 bool MockGpuVideoAcceleratorFactories::ShouldUseGpuMemoryBuffersForVideoFrames() 107 bool MockGpuVideoAcceleratorFactories::ShouldUseGpuMemoryBuffersForVideoFrames()
106 const { 108 const {
107 return false; 109 return false;
108 } 110 }
109 111
110 unsigned MockGpuVideoAcceleratorFactories::ImageTextureTarget() { 112 unsigned MockGpuVideoAcceleratorFactories::ImageTextureTarget() {
111 return GL_TEXTURE_2D; 113 return GL_TEXTURE_2D;
112 } 114 }
113 115
114 } // namespace media 116 } // namespace media
OLDNEW
« no previous file with comments | « media/renderers/mock_gpu_video_accelerator_factories.h ('k') | media/video/gpu_memory_buffer_video_frame_pool.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698