OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "cc/test/test_gpu_memory_buffer_manager.h" | 5 #include "cc/test/test_gpu_memory_buffer_manager.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/numerics/safe_conversions.h" | 8 #include "base/numerics/safe_conversions.h" |
9 #include "ui/gfx/gpu_memory_buffer.h" | 9 #include "ui/gfx/gpu_memory_buffer.h" |
10 | 10 |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 bool IsMapped() const override { return mapped_; } | 126 bool IsMapped() const override { return mapped_; } |
127 gfx::BufferFormat GetFormat() const override { return format_; } | 127 gfx::BufferFormat GetFormat() const override { return format_; } |
128 void GetStride(int* stride) const override { | 128 void GetStride(int* stride) const override { |
129 int num_planes = NumberOfPlanesForGpuMemoryBufferFormat(format_); | 129 int num_planes = NumberOfPlanesForGpuMemoryBufferFormat(format_); |
130 for (int i = 0; i < num_planes; ++i) | 130 for (int i = 0; i < num_planes; ++i) |
131 stride[i] = | 131 stride[i] = |
132 base::checked_cast<int>(StrideInBytes(size_.width(), format_, i)); | 132 base::checked_cast<int>(StrideInBytes(size_.width(), format_, i)); |
133 } | 133 } |
134 gfx::GpuMemoryBufferId GetId() const override { | 134 gfx::GpuMemoryBufferId GetId() const override { |
135 NOTREACHED(); | 135 NOTREACHED(); |
136 return 0; | 136 return gfx::GpuMemoryBufferId(0); |
137 } | 137 } |
138 gfx::GpuMemoryBufferHandle GetHandle() const override { | 138 gfx::GpuMemoryBufferHandle GetHandle() const override { |
139 gfx::GpuMemoryBufferHandle handle; | 139 gfx::GpuMemoryBufferHandle handle; |
140 handle.type = gfx::SHARED_MEMORY_BUFFER; | 140 handle.type = gfx::SHARED_MEMORY_BUFFER; |
141 handle.handle = shared_memory_->handle(); | 141 handle.handle = shared_memory_->handle(); |
142 return handle; | 142 return handle; |
143 } | 143 } |
144 ClientBuffer AsClientBuffer() override { | 144 ClientBuffer AsClientBuffer() override { |
145 return reinterpret_cast<ClientBuffer>(this); | 145 return reinterpret_cast<ClientBuffer>(this); |
146 } | 146 } |
(...skipping 29 matching lines...) Expand all Loading... |
176 ClientBuffer buffer) { | 176 ClientBuffer buffer) { |
177 return reinterpret_cast<gfx::GpuMemoryBuffer*>(buffer); | 177 return reinterpret_cast<gfx::GpuMemoryBuffer*>(buffer); |
178 } | 178 } |
179 | 179 |
180 void TestGpuMemoryBufferManager::SetDestructionSyncPoint( | 180 void TestGpuMemoryBufferManager::SetDestructionSyncPoint( |
181 gfx::GpuMemoryBuffer* buffer, | 181 gfx::GpuMemoryBuffer* buffer, |
182 uint32 sync_point) { | 182 uint32 sync_point) { |
183 } | 183 } |
184 | 184 |
185 } // namespace cc | 185 } // namespace cc |
OLD | NEW |