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

Unified Diff: gpu/ipc/client/gpu_memory_buffer_impl_shared_memory.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: gpu/ipc/client/gpu_memory_buffer_impl_shared_memory.cc
diff --git a/gpu/ipc/client/gpu_memory_buffer_impl_shared_memory.cc b/gpu/ipc/client/gpu_memory_buffer_impl_shared_memory.cc
index e867917160d6e696aee714fa0c85b7309decee80..897bd6c278f7140b64337ac4e66c9f42f92b4ea5 100644
--- a/gpu/ipc/client/gpu_memory_buffer_impl_shared_memory.cc
+++ b/gpu/ipc/client/gpu_memory_buffer_impl_shared_memory.cc
@@ -28,7 +28,7 @@ GpuMemoryBufferImplSharedMemory::GpuMemoryBufferImplSharedMemory(
const DestructionCallback& callback,
std::unique_ptr<base::SharedMemory> shared_memory,
size_t offset,
- int stride)
+ uint32_t stride)
: GpuMemoryBufferImpl(id, size, format, callback),
shared_memory_(std::move(shared_memory)),
offset_(offset),
@@ -76,7 +76,7 @@ GpuMemoryBufferImplSharedMemory::AllocateForChildProcess(
handle.type = gfx::SHARED_MEMORY_BUFFER;
handle.id = id;
handle.offset = 0;
- handle.stride = static_cast<int32_t>(
+ handle.stride = static_cast<uint32_t>(
gfx::RowSizeForBufferFormat(size.width(), format, 0));
shared_memory.GiveToProcess(child_process, &handle.handle);
return handle;
@@ -170,7 +170,7 @@ base::Closure GpuMemoryBufferImplSharedMemory::AllocateForTesting(
DCHECK(rv);
handle->type = gfx::SHARED_MEMORY_BUFFER;
handle->offset = 0;
- handle->stride = static_cast<int32_t>(
+ handle->stride = static_cast<uint32_t>(
gfx::RowSizeForBufferFormat(size.width(), format, 0));
handle->handle = base::SharedMemory::DuplicateHandle(shared_memory.handle());
return base::Bind(&Noop);
@@ -207,7 +207,7 @@ void GpuMemoryBufferImplSharedMemory::Unmap() {
mapped_ = false;
}
-int GpuMemoryBufferImplSharedMemory::stride(size_t plane) const {
+uint32_t GpuMemoryBufferImplSharedMemory::stride(size_t plane) const {
DCHECK_LT(plane, gfx::NumberOfPlanesForBufferFormat(format_));
return gfx::RowSizeForBufferFormat(size_.width(), format_, plane);
}
« no previous file with comments | « gpu/ipc/client/gpu_memory_buffer_impl_shared_memory.h ('k') | gpu/ipc/client/gpu_memory_buffer_impl_surface_texture.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698