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

Unified Diff: webkit/gpu/webgraphicscontext3d_in_process_impl.cc

Issue 8202019: Properly support BGRA textures on desktop GL (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 9 years, 2 months 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 909cabe2737ce8aef5efae2d2d0433c67f508a4b..38567cd9bbc613ee97e9c6dace88a8db691ce38b 100644
--- a/webkit/gpu/webgraphicscontext3d_in_process_impl.cc
+++ b/webkit/gpu/webgraphicscontext3d_in_process_impl.cc
@@ -1330,6 +1330,17 @@ void WebGraphicsContext3DInProcessImpl::texImage2D(
WGC3Dsizei width, WGC3Dsizei height, WGC3Dint border,
WGC3Denum format, WGC3Denum type, const void* pixels) {
makeContextCurrent();
+ if (gfx::GetGLImplementation() != gfx::kGLImplementationEGLGLES2) {
+ if (format == GL_BGRA_EXT && internalFormat == GL_BGRA_EXT) {
+ internalFormat = GL_RGBA;
+ } else if (type == GL_FLOAT) {
+ if (format == GL_RGBA) {
+ internalFormat = GL_RGBA32F_ARB;
+ } else if (format == GL_RGB) {
+ internalFormat = GL_RGB32F_ARB;
+ }
+ }
+ }
glTexImage2D(target, level, internalFormat,
width, height, border, format, type, pixels);
}
« 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