[gtk/wip/baedert/gl-rework: 24/47] gl renderer: Don't invert offset value twice



commit 5ff620a6b9d0abde679e42585804d9c3cf735402
Author: Timm Bäder <mail baedert org>
Date:   Tue Dec 17 16:24:17 2019 +0100

    gl renderer: Don't invert offset value twice

 gsk/gl/gskglrenderer.c                          | 4 ++--
 gsk/resources/glsl/inset_shadow.glsl            | 3 +--
 gsk/resources/glsl/unblurred_outset_shadow.glsl | 3 +--
 3 files changed, 4 insertions(+), 6 deletions(-)
---
diff --git a/gsk/gl/gskglrenderer.c b/gsk/gl/gskglrenderer.c
index e7f4234576..68fcdf6ddb 100644
--- a/gsk/gl/gskglrenderer.c
+++ b/gsk/gl/gskglrenderer.c
@@ -1555,7 +1555,7 @@ render_unblurred_inset_shadow_node (GskGLRenderer   *self,
   op->outline = transform_rect (self, builder, gsk_inset_shadow_node_peek_outline (node));
   op->spread = spread * scale;
   op->offset[0] = dx * scale;
-  op->offset[1] = -dy * scale;
+  op->offset[1] = dy * scale;
 
   load_vertex_data (vertex_data, node, builder);
 
@@ -1737,7 +1737,7 @@ render_unblurred_outset_shadow_node (GskGLRenderer   *self,
   op->outline = transform_rect (self, builder, outline);
   op->spread = spread * scale;
   op->offset[0] = dx * scale;
-  op->offset[1] = - dy * scale;
+  op->offset[1] = dy * scale;
 
   load_vertex_data (vertex_data, node, builder);
   ops_draw (builder, vertex_data);
diff --git a/gsk/resources/glsl/inset_shadow.glsl b/gsk/resources/glsl/inset_shadow.glsl
index 1658559536..1549800363 100644
--- a/gsk/resources/glsl/inset_shadow.glsl
+++ b/gsk/resources/glsl/inset_shadow.glsl
@@ -17,10 +17,9 @@ void main() {
 
   RoundedRect outside = create_rect(u_outline_rect);
   RoundedRect inside = rounded_rect_shrink(outside, vec4(u_spread));
-  vec2 offset = vec2(u_offset.x, - u_offset.y);
   vec4 color = vec4(u_color.rgb * u_color.a, u_color.a);
   color = color * clamp (rounded_rect_coverage (outside, f.xy) -
-                         rounded_rect_coverage (inside, f.xy - offset),
+                         rounded_rect_coverage (inside, f.xy - u_offset),
                          0.0, 1.0);
   setOutputColor(color * u_alpha);
 }
diff --git a/gsk/resources/glsl/unblurred_outset_shadow.glsl b/gsk/resources/glsl/unblurred_outset_shadow.glsl
index 876ee9eb1e..27606f1476 100644
--- a/gsk/resources/glsl/unblurred_outset_shadow.glsl
+++ b/gsk/resources/glsl/unblurred_outset_shadow.glsl
@@ -19,9 +19,8 @@ void main() {
   RoundedRect inside = create_rect(u_outline_rect);
   RoundedRect outside = rounded_rect_shrink(inside, vec4(- u_spread));
 
-  vec2 offset = vec2(u_offset.x, - u_offset.y);
   vec4 color = vec4(u_color.rgb * u_color.a, u_color.a);
-  color = color * clamp (rounded_rect_coverage (outside, f.xy - offset) -
+  color = color * clamp (rounded_rect_coverage (outside, f.xy - u_offset) -
                          rounded_rect_coverage (inside, f.xy),
                          0.0, 1.0);
   setOutputColor(color * u_alpha);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]