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

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

Issue 2298353002: gfx: Use unsigned strides for gpu memory buffers. (Closed)
Patch Set: . Created 4 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 "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
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
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
OLDNEW
« no previous file with comments | « gpu/ipc/client/gpu_memory_buffer_impl_surface_texture.cc ('k') | services/ui/common/gpu_type_converters_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698