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

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: Final patch to be committed 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 112101)
+++ 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"
@@ -16,6 +17,7 @@
#include "third_party/npapi/bindings/npruntime.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebBindings.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h"
+#include "ui/base/ui_base_switches.h"
#include "ui/gfx/gl/gl_implementation.h"
#include "ui/gfx/gl/gl_surface.h"
#include "webkit/glue/webkit_glue.h"
@@ -71,6 +73,11 @@
}
return (implementation == gfx::kGLImplementationDesktopGL);
}
+
+static bool UsingCompositedCoreAnimationPlugins() {
+ return !CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kDisableCompositedCoreAnimationPlugins);
+}
#endif
PluginHost::PluginHost() {
@@ -826,8 +833,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 +912,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