Index: remoting/client/opengl/draw_tex.frag |
diff --git a/remoting/client/opengl/draw_tex.frag b/remoting/client/opengl/draw_tex.frag |
new file mode 100644 |
index 0000000000000000000000000000000000000000..4dcf78a94e7a00d114a373eb5b97658e8fad66d6 |
--- /dev/null |
+++ b/remoting/client/opengl/draw_tex.frag |
@@ -0,0 +1,17 @@ |
+// Copyright 2016 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+precision mediump float; |
+ |
+// Region on the texture to be used (normally the whole texture). |
+varying vec2 v_texCoord; |
+uniform sampler2D u_texture; |
+void main() |
+{ |
+ // There is some issue with the RGBA decoder (see JniFrameConsumer) so we |
+ // prefer BGRA. However, OpenGL ES doesn't seem to support GL_BGRA when |
+ // uploading the texture, so we solve this by specifying GL_RGBA when |
+ // uploading the pixel and swap b and r in the frag shader. |
+ gl_FragColor = texture2D(u_texture, v_texCoord).bgra; |
+} |