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

Unified Diff: webkit/plugins/npapi/plugin_host.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
« no previous file with comments | « ui/gfx/surface/accelerated_surface_mac.cc ('k') | webkit/plugins/npapi/webplugin.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/plugins/npapi/plugin_host.cc
===================================================================
--- webkit/plugins/npapi/plugin_host.cc (revision 111400)
+++ webkit/plugins/npapi/plugin_host.cc (working copy)
@@ -4,6 +4,7 @@
#include "webkit/plugins/npapi/plugin_host.h"
+#include "base/command_line.h"
#include "base/file_util.h"
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
@@ -71,6 +72,13 @@
}
return (implementation == gfx::kGLImplementationDesktopGL);
}
+
+static bool UsingCompositedCoreAnimationPlugins() {
+ // We can't reference the kDisableCompositedCoreAnimationPlugins
jam 2011/11/29 18:56:21 duplicating the switch seems unfortunate. perhaps
Ken Russell (switch to Gerrit) 2011/11/30 00:23:32 Thanks for the suggestion. Ended up putting it in
+ // constant in content/ here.
+ return !CommandLine::ForCurrentProcess()->HasSwitch(
+ "disable-composited-core-animation-plugins");
+}
#endif
PluginHost::PluginHost() {
@@ -826,8 +834,12 @@
break;
}
case NPNVsupportsInvalidatingCoreAnimationBool: {
+ // The composited code path for this model only works on 10.6 and higher.
+ // The old direct-to-screen code path supports 10.5.
NPBool* supports_model = reinterpret_cast<NPBool*>(value);
- *supports_model = true;
+ bool composited = webkit::npapi::UsingCompositedCoreAnimationPlugins();
+ *supports_model = composited ?
+ webkit::npapi::SupportsSharingAcceleratedSurfaces() : true;
rv = NPERR_NO_ERROR;
break;
}
@@ -901,7 +913,9 @@
case NPPVpluginDrawingModel: {
int model = reinterpret_cast<int>(value);
if (model == NPDrawingModelCoreGraphics ||
- model == NPDrawingModelInvalidatingCoreAnimation ||
+ (model == NPDrawingModelInvalidatingCoreAnimation &&
+ (webkit::npapi::SupportsSharingAcceleratedSurfaces() ||
+ !webkit::npapi::UsingCompositedCoreAnimationPlugins())) ||
(model == NPDrawingModelCoreAnimation &&
webkit::npapi::SupportsSharingAcceleratedSurfaces())) {
plugin->set_drawing_model(static_cast<NPDrawingModel>(model));
« no previous file with comments | « ui/gfx/surface/accelerated_surface_mac.cc ('k') | webkit/plugins/npapi/webplugin.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698