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

Unified Diff: content/common/gpu/gpu_memory_buffer_factory_io_surface.cc

Issue 793693003: Tile Compression (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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: 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

Powered by Google App Engine
This is Rietveld 408576698