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

Unified Diff: remoting/client/opengl/draw_tex.frag

Issue 2045963004: [Remoting] OpenGL Rendering Layer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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
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;
+}

Powered by Google App Engine
This is Rietveld 408576698