summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2021-03-13 10:17:34 -0500
committerMatthias Clasen <mclasen@redhat.com>2021-03-14 16:49:31 -0400
commit19e3a6af5d2d42dc6c18196223aed57b465cdc79 (patch)
tree4f80e4a3ddd7ba4064a3fd39b95a69fb825e169c
parent29501f53981b0be1f458da28ffaf934507c73772 (diff)
downloadgtk+-19e3a6af5d2d42dc6c18196223aed57b465cdc79.tar.gz
ngl: Consistently use gsk_scaled_premultiply
Its not going to make much of a difference, but we can just as well be consistent.
-rw-r--r--gsk/ngl/resources/border.glsl2
-rw-r--r--gsk/ngl/resources/color.glsl2
-rw-r--r--gsk/ngl/resources/color_matrix.glsl4
-rw-r--r--gsk/ngl/resources/coloring.glsl2
-rw-r--r--gsk/ngl/resources/inset_shadow.glsl2
-rw-r--r--gsk/ngl/resources/outset_shadow.glsl2
6 files changed, 6 insertions, 8 deletions
diff --git a/gsk/ngl/resources/border.glsl b/gsk/ngl/resources/border.glsl
index a9c04556a4..4f47ab87dc 100644
--- a/gsk/ngl/resources/border.glsl
+++ b/gsk/ngl/resources/border.glsl
@@ -11,7 +11,7 @@ _OUT_ _GSK_ROUNDED_RECT_UNIFORM_ transformed_inside_outline;
void main() {
gl_Position = u_projection * u_modelview * vec4(aPosition, 0.0, 1.0);
- final_color = gsk_premultiply(aColor) * u_alpha;
+ final_color = gsk_scaled_premultiply(aColor, u_alpha);
GskRoundedRect outside = gsk_create_rect(u_outline_rect);
GskRoundedRect inside = gsk_rounded_rect_shrink (outside, u_widths);
diff --git a/gsk/ngl/resources/color.glsl b/gsk/ngl/resources/color.glsl
index 670b9979a2..ba98b1b170 100644
--- a/gsk/ngl/resources/color.glsl
+++ b/gsk/ngl/resources/color.glsl
@@ -6,7 +6,7 @@ _OUT_ vec4 final_color;
void main() {
gl_Position = u_projection * u_modelview * vec4(aPosition, 0.0, 1.0);
- final_color = gsk_premultiply(aColor) * u_alpha;
+ final_color = gsk_scaled_premultiply(aColor, u_alpha);
}
// FRAGMENT_SHADER:
diff --git a/gsk/ngl/resources/color_matrix.glsl b/gsk/ngl/resources/color_matrix.glsl
index 44dcf9a044..51835f056f 100644
--- a/gsk/ngl/resources/color_matrix.glsl
+++ b/gsk/ngl/resources/color_matrix.glsl
@@ -23,7 +23,5 @@ void main() {
color = u_color_matrix * color + u_color_offset;
color = clamp(color, 0.0, 1.0);
- color.rgb *= color.a;
-
- gskSetOutputColor(color * u_alpha);
+ gskSetOutputColor(gsk_scaled_premultiply(color, u_alpha));
}
diff --git a/gsk/ngl/resources/coloring.glsl b/gsk/ngl/resources/coloring.glsl
index 5b5d46a732..15e8203b8a 100644
--- a/gsk/ngl/resources/coloring.glsl
+++ b/gsk/ngl/resources/coloring.glsl
@@ -17,7 +17,7 @@ void main() {
else
use_color = 1.0;
- final_color = gsk_premultiply(aColor) * u_alpha;
+ final_color = gsk_scaled_premultiply(aColor, u_alpha);
}
// FRAGMENT_SHADER:
diff --git a/gsk/ngl/resources/inset_shadow.glsl b/gsk/ngl/resources/inset_shadow.glsl
index 1c3c955035..8cff1edee1 100644
--- a/gsk/ngl/resources/inset_shadow.glsl
+++ b/gsk/ngl/resources/inset_shadow.glsl
@@ -12,7 +12,7 @@ _OUT_ _GSK_ROUNDED_RECT_UNIFORM_ transformed_inside_outline;
void main() {
gl_Position = u_projection * u_modelview * vec4(aPosition, 0.0, 1.0);
- final_color = gsk_premultiply(aColor) * u_alpha;
+ final_color = gsk_scaled_premultiply(aColor, u_alpha);
GskRoundedRect outside = gsk_create_rect(u_outline_rect);
GskRoundedRect inside = gsk_rounded_rect_shrink(outside, vec4(u_spread));
diff --git a/gsk/ngl/resources/outset_shadow.glsl b/gsk/ngl/resources/outset_shadow.glsl
index 427aee956c..0ab943b070 100644
--- a/gsk/ngl/resources/outset_shadow.glsl
+++ b/gsk/ngl/resources/outset_shadow.glsl
@@ -11,7 +11,7 @@ void main() {
vUv = vec2(aUv.x, aUv.y);
- final_color = gsk_premultiply(aColor) * u_alpha;
+ final_color = gsk_scaled_premultiply(aColor, u_alpha);
GskRoundedRect outline = gsk_create_rect(u_outline_rect);
gsk_rounded_rect_transform(outline, u_modelview);