Index: content/common/gpu/gpu_memory_buffer_factory_io_surface.cc |
diff --git a/content/common/gpu/gpu_memory_buffer_factory_io_surface.cc b/content/common/gpu/gpu_memory_buffer_factory_io_surface.cc |
index ba00ea2553a2600002baee58b12b5ee9cdb9a4c0..5b0174f4064e03e7a26ac9cbe4f48d71d5889991 100644 |
--- a/content/common/gpu/gpu_memory_buffer_factory_io_surface.cc |
+++ b/content/common/gpu/gpu_memory_buffer_factory_io_surface.cc |
@@ -94,6 +94,9 @@ GpuMemoryBufferFactoryIOSurface::CreateGpuMemoryBuffer( |
gfx::GpuMemoryBuffer::Usage usage, |
int client_id, |
gfx::PluginWindowHandle surface_handle) { |
+ size_t width_in_bytes = |
+ GpuMemoryBufferImpl::StrideInBytes(size.width(), format); |
+ DCHECK_EQ(width_in_bytes % size.width(), 0u); |
base::ScopedCFTypeRef<CFMutableDictionaryRef> properties; |
properties.reset(CFDictionaryCreateMutable(kCFAllocatorDefault, |
0, |
@@ -101,7 +104,8 @@ GpuMemoryBufferFactoryIOSurface::CreateGpuMemoryBuffer( |
&kCFTypeDictionaryValueCallBacks)); |
AddIntegerValue(properties, kIOSurfaceWidth, size.width()); |
AddIntegerValue(properties, kIOSurfaceHeight, size.height()); |
- AddIntegerValue(properties, kIOSurfaceBytesPerElement, BytesPerPixel(format)); |
+ AddIntegerValue(properties, kIOSurfaceBytesPerElement, |
+ width_in_bytes / size.width()); |
reveman
2014/12/18 18:49:57
nit: Please keep using BytesPerPixel here instead.
christiank
2015/01/12 10:35:22
Alright, I missed that this file actually had its
|
AddIntegerValue(properties, kIOSurfacePixelFormat, PixelFormat(format)); |
// TODO(reveman): Remove this when using a mach_port_t to transfer |
// IOSurface to browser and renderer process. crbug.com/323304 |