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

Unified Diff: services/ui/public/cpp/mojo_gpu_memory_buffer.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: services/ui/public/cpp/mojo_gpu_memory_buffer.cc
diff --git a/services/ui/public/cpp/mojo_gpu_memory_buffer.cc b/services/ui/public/cpp/mojo_gpu_memory_buffer.cc
index c0d776b567487378ccd1469d8b4cb33a800c2359..88ed1f6165dea6f9b42a8ce34a28ab3140173f08 100644
--- a/services/ui/public/cpp/mojo_gpu_memory_buffer.cc
+++ b/services/ui/public/cpp/mojo_gpu_memory_buffer.cc
@@ -43,7 +43,7 @@ std::unique_ptr<gfx::GpuMemoryBuffer> MojoGpuMemoryBufferImpl::Create(
auto shared_memory =
base::MakeUnique<base::SharedMemory>(platform_handle, readonly);
- const int stride = base::checked_cast<int>(
+ const uint32_t stride = base::checked_cast<uint32_t>(
gfx::RowSizeForBufferFormat(size.width(), format, 0));
return base::WrapUnique(new MojoGpuMemoryBufferImpl(
size, format, std::move(shared_memory), 0, stride));
@@ -98,9 +98,9 @@ void MojoGpuMemoryBufferImpl::Unmap() {
mapped_ = false;
}
-int MojoGpuMemoryBufferImpl::stride(size_t plane) const {
+uint32_t MojoGpuMemoryBufferImpl::stride(size_t plane) const {
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)));
}
@@ -123,7 +123,7 @@ MojoGpuMemoryBufferImpl::MojoGpuMemoryBufferImpl(
gfx::BufferFormat format,
std::unique_ptr<base::SharedMemory> shared_memory,
uint32_t offset,
- int32_t stride)
+ uint32_t stride)
: GpuMemoryBufferImpl(gfx::GenericSharedMemoryId(0), size, format),
shared_memory_(std::move(shared_memory)),
offset_(offset),
« no previous file with comments | « services/ui/public/cpp/mojo_gpu_memory_buffer.h ('k') | services/ui/public/interfaces/gpu_memory_buffer.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698