summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
authorpiman@chromium.org <piman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-04 21:06:17 +0000
committerpiman@chromium.org <piman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-04 21:06:17 +0000
commite3e41ab59f4016eda8df85bb184a6c9ff5d1986d (patch)
treeeb6f0b111cc0d17baea72cfc167b0d2ef039c77d /webkit
parentdc912ae1f6424b7312439d11174c07d54a784f61 (diff)
downloadchromium_src-e3e41ab59f4016eda8df85bb184a6c9ff5d1986d.zip
chromium_src-e3e41ab59f4016eda8df85bb184a6c9ff5d1986d.tar.gz
chromium_src-e3e41ab59f4016eda8df85bb184a6c9ff5d1986d.tar.bz2
Expose gles2 bgra extensions when GL_EXT_bgra is supported
BUG=None TEST=Aura + Webkit compositor + accelerated painting Review URL: http://codereview.chromium.org/8460001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@108711 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r--webkit/gpu/webgraphicscontext3d_in_process_impl.cc17
1 files changed, 13 insertions, 4 deletions
diff --git a/webkit/gpu/webgraphicscontext3d_in_process_impl.cc b/webkit/gpu/webgraphicscontext3d_in_process_impl.cc
index 93af088..e76f9da 100644
--- a/webkit/gpu/webgraphicscontext3d_in_process_impl.cc
+++ b/webkit/gpu/webgraphicscontext3d_in_process_impl.cc
@@ -10,6 +10,7 @@
#include <string>
#include "base/logging.h"
+#include "base/string_split.h"
#include "base/memory/scoped_ptr.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h"
@@ -1245,11 +1246,19 @@ WebString WebGraphicsContext3DInProcessImpl::getString(WGC3Denum name) {
makeContextCurrent();
std::string result(reinterpret_cast<const char*>(glGetString(name)));
if (name == GL_EXTENSIONS) {
- // GL_CHROMIUM_copy_texture_to_parent_texture requires the
- // desktopGL-only function glGetTexLevelParameteriv (GLES2
- // doesn't support it).
- if (!is_gles2_)
+ if (!is_gles2_) {
+ std::vector<std::string> split;
+ base::SplitString(result, ' ', &split);
+ if (std::find(split.begin(), split.end(), "GL_EXT_bgra") != split.end()) {
+ // If we support GL_EXT_bgra, pretend we support a couple of GLES2
+ // extension that are a subset of it.
+ result += " GL_EXT_texture_format_BGRA8888 GL_EXT_read_format_bgra";
+ }
+ // GL_CHROMIUM_copy_texture_to_parent_texture requires the
+ // desktopGL-only function glGetTexLevelParameteriv (GLES2
+ // doesn't support it).
result += " GL_CHROMIUM_copy_texture_to_parent_texture";
+ }
}
return WebString::fromUTF8(result.c_str());
}