source: trunk/src/opengl/util/painter.glsl@ 440

Last change on this file since 440 was 2, checked in by Dmitry A. Kuminov, 16 years ago

Initially imported qt-all-opensource-src-4.5.1 from Trolltech.

File size: 522 bytes
Line 
1uniform sampler2D dst_texture;
2uniform sampler2D mask_texture;
3uniform vec2 inv_mask_size;
4uniform vec2 inv_dst_size;
5uniform vec2 mask_offset;
6uniform vec4 mask_channel;
7
8float mask()
9{
10 return dot(mask_channel, texture2D(mask_texture, (gl_FragCoord.xy + mask_offset) * inv_mask_size));
11}
12
13void main()
14{
15 vec4 dst = texture2D(dst_texture, gl_FragCoord.xy * inv_dst_size);
16
17 // combine clip and coverage channels
18 float mask_alpha = mask();
19
20 gl_FragColor = mix(dst, composite(brush(), dst), mask_alpha);
21}
Note: See TracBrowser for help on using the repository browser.