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

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
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
+ // constant in content/ here.
+ return !CommandLine::ForCurrentProcess()->HasSwitch(
+ "disable-composited-core-animation-plugins");
+}
#endif
PluginHost::PluginHost() {
@@ -826,8 +834,13 @@
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 ?
stuartmorgan 2011/11/28 10:09:04 Bring this up to the previous line?
Ken Russell (switch to Gerrit) 2011/11/28 23:40:15 Done.
+ webkit::npapi::SupportsSharingAcceleratedSurfaces() : true;
rv = NPERR_NO_ERROR;
break;
}
@@ -901,7 +914,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));

Powered by Google App Engine
This is Rietveld 408576698