Make cross-process CALayers work on Mac
commitba2a3366f2f3029913177d9e6526eb0181b36402
authorccameron@chromium.org <ccameron@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Mon, 23 Jun 2014 22:26:47 +0000 (23 22:26 +0000)
committerccameron@chromium.org <ccameron@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Mon, 23 Jun 2014 22:26:47 +0000 (23 22:26 +0000)
tree5972b2258cd887c8fb3c91d740a077db9adf7237
parent59c4c2d1d830a216e56e039ab489d479f69eb1c5
Make cross-process CALayers work on Mac

Add a header file for the remote layer API and a helper function to
determine if it is supported at runtime.

Add a mechanism for disambiguating if a "surface handle" refers to an
IOSurfaceID or a CAContextID (the thing that is passed across processes
to do cross-process CALayer drawing).

Add support in RenderWidgetHostViewMac to put in a CALayerHost from
another process's CAContextID. In the process of this, make the root
CALayer hanging off of the RenderWidgetHostViewMac have flipped
geometry, and update LayoutLayers to take this into account.

This is working surprisingly well, but needs a bit more work before it
can be turned on. We still need to:
* exert GPU back-pressure from the GPU process'
  -[ImageTransportLayer drawInCGLContext] function (it's an open loop
  now).
* use the isAsynchronous property to make 60fps animation not jerky.
* ensure that these resources' lifetimes are being managed reasonably
  and aren't eating tons of GPU
* ensure that not rounding texture sizes to the nearest 64 pixels (as is
  done for the IOSurface scheme) isn't causing fragmentation.

BUG=312462

Review URL: https://codereview.chromium.org/347653005

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@279200 0039d316-1c4b-4281-b951-d872f2087c98
16 files changed:
content/browser/renderer_host/render_widget_helper_mac.mm
content/browser/renderer_host/render_widget_host_view_mac.h
content/browser/renderer_host/render_widget_host_view_mac.mm
content/common/gpu/image_transport_surface_calayer_mac.h [new file with mode: 0644]
content/common/gpu/image_transport_surface_calayer_mac.mm [new file with mode: 0644]
content/common/gpu/image_transport_surface_fbo_mac.cc
content/common/gpu/image_transport_surface_fbo_mac.h
content/common/gpu/image_transport_surface_iosurface_mac.cc
content/common/gpu/image_transport_surface_iosurface_mac.h
content/common/gpu/image_transport_surface_mac.mm
content/common/gpu/surface_handle_types_mac.cc [new file with mode: 0644]
content/common/gpu/surface_handle_types_mac.h [new file with mode: 0644]
content/content_common.gypi
ui/base/cocoa/remote_layer_api.h [new file with mode: 0644]
ui/base/cocoa/remote_layer_api.mm [new file with mode: 0644]
ui/base/ui_base.gyp