mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-14 20:51:07 +00:00
f848450a70
This allows us to decide when the R and B color channels should be flipped with a much better granularity. For instance, when using GLX_EXT_texture_from_pixmap to create a GL texture from a surface we don't need to swap the R and B channels, as the internal representation of the texture data will already have the appropriate colors. We also don't need to flip color channels when blitting from a texture.
17 lines
340 B
GLSL
17 lines
340 B
GLSL
precision mediump float;
|
|
|
|
uniform sampler2D map;
|
|
uniform int flipColors;
|
|
|
|
varying highp vec2 vUv;
|
|
|
|
void main() {
|
|
vec4 color = texture2D(map, vUv);
|
|
|
|
/* Flip R and B around to match the Cairo convention, if required */
|
|
if (flipColors == 1)
|
|
gl_FragColor = vec4(color.z, color.y, color.x, color.w);
|
|
else
|
|
gl_FragColor = color;
|
|
}
|