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..ca1661614b95b744f8d7afc33f5c9a401966c85c 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,7 @@ GpuMemoryBufferFactoryIOSurface::CreateGpuMemoryBuffer( |
gfx::GpuMemoryBuffer::Usage usage, |
int client_id, |
gfx::PluginWindowHandle surface_handle) { |
+ size_t bits_per_pixel = GpuMemoryBufferImpl::BitsPerPixel(format); |
base::ScopedCFTypeRef<CFMutableDictionaryRef> properties; |
properties.reset(CFDictionaryCreateMutable(kCFAllocatorDefault, |
0, |
@@ -101,7 +102,8 @@ GpuMemoryBufferFactoryIOSurface::CreateGpuMemoryBuffer( |
&kCFTypeDictionaryValueCallBacks)); |
AddIntegerValue(properties, kIOSurfaceWidth, size.width()); |
AddIntegerValue(properties, kIOSurfaceHeight, size.height()); |
- AddIntegerValue(properties, kIOSurfaceBytesPerElement, BytesPerPixel(format)); |
+ AddIntegerValue(properties, kIOSurfaceBytesPerElement, |
+ BitsPerPixel(format) / 8); |
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 |