From 3c29f968998edc5aca9f8b228196b29268938deb Mon Sep 17 00:00:00 2001 From: ccameron Date: Mon, 26 Oct 2015 14:35:12 -0700 Subject: Mac: Remove lots of AcceleratedWidget code In the non-remote-CALayer model, we render to an IOSurface and pass it to the browser process, where we draw that into a CAOpenGLLayer. Delete all of the code to do that, and just set the contents of a CALayer to be that IOSurface. While we're in the neighborhood, change the software path to render into an IOSurface, and use that same path to draw it. Double-buffer the software output surface in SoftwareOutputDeviceMac, to avoid writing the next frame with the CPU while the WindowServer is drawing it (it appears that the WindowServer does not respect the IOSurface locks). BUG=546691 Review URL: https://codereview.chromium.org/1420533005 Cr-Commit-Position: refs/heads/master@{#356129} --- content/common/gpu/image_transport_surface_iosurface_mac.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'content/common') diff --git a/content/common/gpu/image_transport_surface_iosurface_mac.cc b/content/common/gpu/image_transport_surface_iosurface_mac.cc index 42e8300..1008a5b 100644 --- a/content/common/gpu/image_transport_surface_iosurface_mac.cc +++ b/content/common/gpu/image_transport_surface_iosurface_mac.cc @@ -12,7 +12,7 @@ namespace { // IOSurface dimensions will be rounded up to a multiple of this value in order // to reduce memory thrashing during resize. This must be a power of 2. -const uint32 kIOSurfaceDimensionRoundup = 64; +const uint32 kIOSurfaceDimensionRoundup = 1; int RoundUpSurfaceDimension(int number) { DCHECK(number >= 0); @@ -59,11 +59,13 @@ bool IOSurfaceStorageProvider::AllocateColorBufferStorage( GLuint texture, gfx::Size pixel_size, float scale_factor) { // Allocate a new IOSurface, which is the GPU resource that can be // shared across processes. + unsigned pixel_format = 'BGRA'; base::ScopedCFTypeRef properties; properties.reset(CFDictionaryCreateMutable(kCFAllocatorDefault, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks)); + AddIntegerValue(properties, kIOSurfacePixelFormat, pixel_format); AddIntegerValue(properties, kIOSurfaceWidth, pixel_size.width()); -- cgit v1.1