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

Unified Diff: webkit/gpu/webgraphicscontext3d_in_process_impl.cc

Issue 8460001: Expose gles2 bgra extensions when GL_EXT_bgra is supported (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: move comment back to wher it belongs 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/gpu/webgraphicscontext3d_in_process_impl.cc
diff --git a/webkit/gpu/webgraphicscontext3d_in_process_impl.cc b/webkit/gpu/webgraphicscontext3d_in_process_impl.cc
index 93af088a96aaef96896cf454b2ab05012a6df7d4..e76f9da4626d07b424c7858c9ffa83b9275bc3ab 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());
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698