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

Unified Diff: webkit/plugins/npapi/webplugin_impl.cc

Issue 8678037: Render Core Animation plugins through WebKit's compositor rather than (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 1 month 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: webkit/plugins/npapi/webplugin_impl.cc
===================================================================
--- webkit/plugins/npapi/webplugin_impl.cc (revision 111400)
+++ webkit/plugins/npapi/webplugin_impl.cc (working copy)
@@ -489,38 +489,31 @@
}
void WebPluginImpl::SetWindow(gfx::PluginWindowHandle window) {
+ if (window) {
+ DCHECK(!windowless_);
+ window_ = window;
#if defined(OS_MACOSX)
- // The only time this is called twice, and the second time with a
- // non-zero PluginWindowHandle, is the case when this WebPluginImpl
- // is created on behalf of the GPU plugin. This entire code path
- // will go away soon, as soon as the GPU plugin becomes the GPU
- // process, so it is being separated out for easy deletion.
+ // TODO(kbr): remove. http://crbug.com/105344
- // The logic we want here is: if (window) DCHECK(!window_);
- DCHECK(!(window_ && window));
- window_ = window;
- // Lie to ourselves about being windowless even if we got a fake
- // plugin window handle, so we continue to get input events.
- windowless_ = true;
- accepts_input_events_ = true;
- // We do not really need to notify the page delegate that a plugin
- // window was created -- so don't.
+ // Lie to ourselves about being windowless even if we got a fake
+ // plugin window handle, so we continue to get input events.
+ windowless_ = true;
+ accepts_input_events_ = true;
+ // We do not really need to notify the page delegate that a plugin
+ // window was created -- so don't.
#else
- if (window) {
- DCHECK(!windowless_);
- window_ = window;
accepts_input_events_ = false;
if (page_delegate_) {
// Tell the view delegate that the plugin window was created, so that it
// can create necessary container widgets.
page_delegate_->CreatedPluginWindow(window);
}
+#endif
} else {
DCHECK(!window_); // Make sure not called twice.
windowless_ = true;
accepts_input_events_ = true;
}
-#endif
}
void WebPluginImpl::SetAcceptsInputEvents(bool accepts) {
@@ -754,6 +747,39 @@
}
}
+#if defined(OS_MACOSX)
+void WebPluginImpl::AcceleratedPluginEnabledRendering() {
+}
+
+void WebPluginImpl::AcceleratedPluginAllocatedIOSurface(int32 width,
+ int32 height,
+ uint32 surface_id) {
+ next_io_surface_allocated_ = true;
+ next_io_surface_width_ = width;
+ next_io_surface_height_ = height;
+ next_io_surface_id_ = surface_id;
+}
+
+void WebPluginImpl::AcceleratedPluginSwappedIOSurface() {
+ if (container_) {
+ // Deferring the call to setBackingIOSurfaceId is an attempt to
+ // work around garbage occasionally showing up in the plugin's
+ // area during live resizing of Core Animation plugins. The
+ // assumption was that by the time this was called, the plugin
+ // process would have populated the newly allocated IOSurface. It
+ // is not 100% clear at this point why any garbage is getting
+ // through. More investigation is needed. http://crbug.com/105346
+ if (next_io_surface_allocated_) {
+ container_->setBackingIOSurfaceId(next_io_surface_width_,
+ next_io_surface_height_,
+ next_io_surface_id_);
+ next_io_surface_allocated_ = false;
+ }
+ container_->commitBackingTexture();
+ }
+}
+#endif
+
void WebPluginImpl::Invalidate() {
if (container_)
container_->invalidate();
« webkit/plugins/npapi/plugin_host.cc ('K') | « webkit/plugins/npapi/webplugin_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698