From 23607ccf23fce3ea302ba779a41e102fc3462dea Mon Sep 17 00:00:00 2001 From: "stuartmorgan@chromium.org" Date: Thu, 3 Jun 2010 23:15:33 +0000 Subject: Fix a bug in NPDrawingModelInvalidatingCoreAnimation, and make it more efficient Fixes a conditional mistake introduced with the new drawing model. Skips unnecessary work when a NPDrawingModelInvalidatingCoreAnimation plugin calls invalidate. Removes some obsolete comments (the renaming in question already happened) BUG=None TEST=Core Animation plugins still work Review URL: http://codereview.chromium.org/2578004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48891 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/plugin/webplugin_proxy.cc | 9 ++++++--- webkit/glue/plugins/webplugin_delegate_impl_mac.mm | 3 +-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/chrome/plugin/webplugin_proxy.cc b/chrome/plugin/webplugin_proxy.cc index 3bf1332..66f65fc 100644 --- a/chrome/plugin/webplugin_proxy.cc +++ b/chrome/plugin/webplugin_proxy.cc @@ -112,7 +112,12 @@ void WebPluginProxy::Invalidate() { void WebPluginProxy::InvalidateRect(const gfx::Rect& rect) { #if defined(OS_MACOSX) - delegate_->PluginDidInvalidate(); + // If this is a Core Animation plugin, all we need to do is inform the + // delegate. + if (!windowless_context_.get()) { + delegate_->PluginDidInvalidate(); + return; + } // Some plugins will send invalidates larger than their own rect when // offscreen, so constrain invalidates to the plugin rect. @@ -588,7 +593,6 @@ void WebPluginProxy::BindFakePluginWindowHandle(bool opaque) { void WebPluginProxy::AcceleratedFrameBuffersDidSwap( gfx::PluginWindowHandle window) { - // TODO(pinkerton): Rename this message. Send(new PluginHostMsg_AcceleratedSurfaceBuffersSwapped(route_id_, window)); } @@ -596,7 +600,6 @@ void WebPluginProxy::SetAcceleratedSurface(gfx::PluginWindowHandle window, int32 width, int32 height, uint64 accelerated_surface_identifier) { - // TODO(pinkerton): Rename this message. Send(new PluginHostMsg_AcceleratedSurfaceSetIOSurface( route_id_, window, width, height, accelerated_surface_identifier)); } diff --git a/webkit/glue/plugins/webplugin_delegate_impl_mac.mm b/webkit/glue/plugins/webplugin_delegate_impl_mac.mm index 9664534..5d85208 100644 --- a/webkit/glue/plugins/webplugin_delegate_impl_mac.mm +++ b/webkit/glue/plugins/webplugin_delegate_impl_mac.mm @@ -394,8 +394,7 @@ bool WebPluginDelegateImpl::PlatformInitialize() { // Let the WebPlugin know that we are windowless (unless this is a // Core Animation plugin, in which case BindFakePluginWindowHandle will take // care of setting up the appropriate window handle). - if (drawing_model != NPDrawingModelCoreAnimation || - drawing_model != NPDrawingModelInvalidatingCoreAnimation) + if (!layer_) plugin_->SetWindow(NULL); #ifndef NP_NO_CARBON -- cgit v1.1