mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-27 14:10:30 +00:00
gl: Tweak the swizzle for GLES texture fragments
Cairo surfaces are in BGRA format, but we upload them as RGBA buffers on GLES; this means that the R and B channels are flipped in the texture data. Instead of doing a costly channel flip before putting them on the GPU, we can flip the values inside the GLSL shader we use specifically for GLES.
This commit is contained in:
parent
a942e96c8f
commit
fe25ba3c5f
@ -5,5 +5,8 @@ uniform sampler2D map;
|
||||
varying highp vec2 vUv;
|
||||
|
||||
void main() {
|
||||
gl_FragColor = texture2D(map, vUv);
|
||||
vec4 color = texture2D(map, vUv);
|
||||
|
||||
/* Flip R and B around to match the Cairo convention */
|
||||
gl_FragColor = vec4(color.z, color.y, color.x, color.w);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user