summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
authorkbr@google.com <kbr@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-10 18:17:47 +0000
committerkbr@google.com <kbr@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-10 18:17:47 +0000
commit6dcacafda1083ecab6d5415369ae30a1b2124758 (patch)
tree644efd7b7f8a72a52a5760324edad58c690ab5b8 /webkit
parent813a6446c3efaeedc8cf5fcf73715e5188ae39d1 (diff)
downloadchromium_src-6dcacafda1083ecab6d5415369ae30a1b2124758.zip
chromium_src-6dcacafda1083ecab6d5415369ae30a1b2124758.tar.gz
chromium_src-6dcacafda1083ecab6d5415369ae30a1b2124758.tar.bz2
Make accelerated plugin support aware of the requirement to use the
real OpenGL implementation rather than the Mesa software renderer. If not using desktop GL, then do not advertise Core Animation support, and make accelerated surface initialization fail. BUG=68751 TEST=none (ran reliability_tests with these changes) Review URL: http://codereview.chromium.org/6166003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70909 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r--webkit/plugins/npapi/plugin_host.cc18
1 files changed, 17 insertions, 1 deletions
diff --git a/webkit/plugins/npapi/plugin_host.cc b/webkit/plugins/npapi/plugin_host.cc
index 7bea68b..7e502da 100644
--- a/webkit/plugins/npapi/plugin_host.cc
+++ b/webkit/plugins/npapi/plugin_host.cc
@@ -4,6 +4,8 @@
#include "webkit/plugins/npapi/plugin_host.h"
+#include "app/gfx/gl/gl_context.h"
+#include "app/gfx/gl/gl_implementation.h"
#include "base/file_util.h"
#include "base/logging.h"
#include "base/scoped_ptr.h"
@@ -51,7 +53,21 @@ static PluginInstance* FindInstance(NPP id) {
static bool SupportsSharingAcceleratedSurfaces() {
int32 major, minor, bugfix;
base::SysInfo::OperatingSystemVersionNumbers(&major, &minor, &bugfix);
- return major > 10 || (major == 10 && minor > 5);
+ bool isSnowLeopardOrLater = major > 10 || (major == 10 && minor > 5);
+ if (!isSnowLeopardOrLater)
+ return false;
+ // We also need to be running with desktop GL and not the software
+ // OSMesa renderer in order to share accelerated surfaces between
+ // processes.
+ gfx::GLImplementation implementation = gfx::GetGLImplementation();
+ if (implementation == gfx::kGLImplementationNone) {
+ // Not initialized yet.
+ if (!gfx::GLContext::InitializeOneOff()) {
+ return false;
+ }
+ implementation = gfx::GetGLImplementation();
+ }
+ return (implementation == gfx::kGLImplementationDesktopGL);
}
#endif