Index: content/common/gpu/gpu_memory_buffer_factory_shared_memory.cc |
diff --git a/content/common/gpu/gpu_memory_buffer_factory_shared_memory.cc b/content/common/gpu/gpu_memory_buffer_factory_shared_memory.cc |
index b10fd00dfbc98f756bbb68ba087dd49dc8d1f0fa..9a4bdcf538cab2132266fe8de6202c1f1e7be133 100644 |
--- a/content/common/gpu/gpu_memory_buffer_factory_shared_memory.cc |
+++ b/content/common/gpu/gpu_memory_buffer_factory_shared_memory.cc |
@@ -38,18 +38,8 @@ |
int client_id, |
gfx::PluginWindowHandle surface_handle) { |
base::SharedMemory shared_memory; |
- |
- size_t stride_in_bytes = 0; |
- if (!GpuMemoryBufferImpl::StrideInBytes( |
- size.width(), format, &stride_in_bytes)) |
- return gfx::GpuMemoryBufferHandle(); |
- |
- base::CheckedNumeric<size_t> size_in_bytes = stride_in_bytes; |
- size_in_bytes *= size.height(); |
- if (!size_in_bytes.IsValid()) |
- return gfx::GpuMemoryBufferHandle(); |
- |
- if (!shared_memory.CreateAnonymous(size_in_bytes.ValueOrDie())) |
+ if (!shared_memory.CreateAnonymous( |
+ size.GetArea() * GpuMemoryBufferImpl::BytesPerPixel(format))) |
return gfx::GpuMemoryBufferHandle(); |
gfx::GpuMemoryBufferHandle handle; |