OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 precision mediump float; |
| 6 |
| 7 // Region on the texture to be used (normally the whole texture). |
| 8 varying vec2 v_texCoord; |
| 9 uniform sampler2D u_texture; |
| 10 void main() |
| 11 { |
| 12 // There is some issue with the RGBA decoder (see JniFrameConsumer) so we |
| 13 // prefer BGRA. However, OpenGL ES doesn't seem to support GL_BGRA when |
| 14 // uploading the texture, so we solve this by specifying GL_RGBA when |
| 15 // uploading the pixel and swap b and r in the frag shader. |
| 16 gl_FragColor = texture2D(u_texture, v_texCoord).bgra; |
| 17 } |
OLD | NEW |