From dc51d1ccc18135493f01464e38ed462825ae8e35 Mon Sep 17 00:00:00 2001 From: "kbr@chromium.org" Date: Wed, 30 Nov 2011 04:42:21 +0000 Subject: Render Core Animation plugins through WebKit's compositor rather than directly to the screen in the browser process. The new composited code path is now the default, though the old code path has been left in place under a command line flag while we gain confidence. Issue 105344 has been filed about removing the old code path. The new code path does not currently support 10.5. The consequence is that plugins using the InvalidatingCoreAnimation rendering model will not work on this version of Mac OS. Pepper 3D is not affected; it now uses a different rendering path. Changed the type of IOSurfaces' IDs from uint64 to uint32 in a few places throughout the code to match the IOSurfaceID typedef in the system header. This was necessary in order to simplify integration with Chrome's OpenGL code. There is a known problem in the new code path with garbage occasionally being drawn to the plugin's area during live resizing of Core Animation plugins. Issue 105346 has been filed to track this. It is unclear whether the additional complexity of the fix that is likely needed is worth it. Tested manually with the following content, with and without the --disable-composited-core-animation-plugins flag: - YouTube (does not trigger this code path) - Google+ Hangouts - http://unity3d.com/gallery/demos/live-demos (Unity 3D) - http://www.erain.com/labs/molehill/ (Stage 3D in Flash 11) - http://www.nissan-stagejuk3d.com/ (Stage 3D in Flash 11, live resizing; web site is flaky, sometimes fails to start) BUG=38967 TEST=manual testing with above test cases Review URL: http://codereview.chromium.org/8678037 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@112126 0039d316-1c4b-4281-b951-d872f2087c98 --- content/plugin/webplugin_proxy.h | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'content/plugin/webplugin_proxy.h') diff --git a/content/plugin/webplugin_proxy.h b/content/plugin/webplugin_proxy.h index ddd32fa..2c44c94 100644 --- a/content/plugin/webplugin_proxy.h +++ b/content/plugin/webplugin_proxy.h @@ -136,11 +136,14 @@ class WebPluginProxy : public webkit::npapi::WebPlugin { virtual void StartIme() OVERRIDE; - virtual void BindFakePluginWindowHandle(bool opaque) OVERRIDE; - virtual webkit::npapi::WebPluginAcceleratedSurface* GetAcceleratedSurface(gfx::GpuPreference gpu_preference) OVERRIDE; + //---------------------------------------------------------------------- + // Legacy Core Animation plugin implementation rendering directly to screen. + + virtual void BindFakePluginWindowHandle(bool opaque) OVERRIDE; + // Tell the browser (via the renderer) to invalidate because the // accelerated buffers have changed. virtual void AcceleratedFrameBuffersDidSwap( @@ -168,6 +171,20 @@ class WebPluginProxy : public webkit::npapi::WebPlugin { virtual void AllocSurfaceDIB(const size_t size, TransportDIB::Handle* dib_handle); virtual void FreeSurfaceDIB(TransportDIB::Id dib_id); + + //---------------------------------------------------------------------- + // New accelerated plugin implementation which renders via the compositor. + + // Tells the renderer, and from there the GPU process, that the plugin + // is using accelerated rather than software rendering. + virtual void AcceleratedPluginEnabledRendering() OVERRIDE; + + // Tells the renderer, and from there the GPU process, that the plugin + // allocated the given IOSurface to be used as its backing store. + virtual void AcceleratedPluginAllocatedIOSurface(int32 width, + int32 height, + uint32 surface_id) OVERRIDE; + virtual void AcceleratedPluginSwappedIOSurface() OVERRIDE; #endif virtual void URLRedirectResponse(bool allow, int resource_id) OVERRIDE; -- cgit v1.1