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

Unified Diff: cc/test/test_gpu_memory_buffer_manager.cc

Issue 2298353002: gfx: Use unsigned strides for gpu memory buffers. (Closed)
Patch Set: . Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: cc/test/test_gpu_memory_buffer_manager.cc
diff --git a/cc/test/test_gpu_memory_buffer_manager.cc b/cc/test/test_gpu_memory_buffer_manager.cc
index fdf073e56ff4da02a855312541f28c1472a2e976..a947c474937e25c184d187cfef5c34288dc3d4b2 100644
--- a/cc/test/test_gpu_memory_buffer_manager.cc
+++ b/cc/test/test_gpu_memory_buffer_manager.cc
@@ -59,9 +59,9 @@ class GpuMemoryBufferImpl : public gfx::GpuMemoryBuffer {
}
gfx::Size GetSize() const override { return size_; }
gfx::BufferFormat GetFormat() const override { return format_; }
- int stride(size_t plane) const override {
+ uint32_t stride(size_t plane) const override {
DCHECK_LT(plane, gfx::NumberOfPlanesForBufferFormat(format_));
- return base::checked_cast<int>(gfx::RowSizeForBufferFormat(
+ return base::checked_cast<uint32_t>(gfx::RowSizeForBufferFormat(
size_.width(), format_, static_cast<int>(plane)));
}
gfx::GpuMemoryBufferId GetId() const override { return id_; }
@@ -70,7 +70,7 @@ class GpuMemoryBufferImpl : public gfx::GpuMemoryBuffer {
handle.type = gfx::SHARED_MEMORY_BUFFER;
handle.handle = shared_memory_->handle();
handle.offset = base::checked_cast<uint32_t>(offset_);
- handle.stride = base::checked_cast<int32_t>(stride_);
+ handle.stride = base::checked_cast<uint32_t>(stride_);
return handle;
}
ClientBuffer AsClientBuffer() override {
@@ -106,7 +106,7 @@ class GpuMemoryBufferFromClient : public gfx::GpuMemoryBuffer {
gfx::BufferFormat GetFormat() const override {
return client_buffer_->GetFormat();
}
- int stride(size_t plane) const override {
+ uint32_t stride(size_t plane) const override {
return client_buffer_->stride(plane);
}
gfx::GpuMemoryBufferId GetId() const override { return id_; }
« no previous file with comments | « cc/raster/zero_copy_raster_buffer_provider.cc ('k') | components/display_compositor/buffer_queue_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698