From 5e81761ad0262f507cbbd7bf43c6819a05d0cad2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Wed, 11 Apr 2018 18:09:30 +0200 Subject: [PATCH] gl renderer: Slightly change ops_offset behavior Add the given delta to the current one instead of replacing it. --- gsk/gl/gskglrenderer.c | 9 ++------- gsk/gl/gskglrenderops.c | 4 ++-- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/gsk/gl/gskglrenderer.c b/gsk/gl/gskglrenderer.c index bde136b75e..9a9ae2ea61 100644 --- a/gsk/gl/gskglrenderer.c +++ b/gsk/gl/gskglrenderer.c @@ -1357,8 +1357,6 @@ render_shadow_node (GskGLRenderer *self, const float dy = shadow->dy; int texture_id; gboolean is_offscreen; - float prev_dx; - float prev_dy; g_assert (shadow->radius <= 0); @@ -1367,14 +1365,11 @@ render_shadow_node (GskGLRenderer *self, max_x = min_x + shadow_child->bounds.size.width; max_y = min_y + shadow_child->bounds.size.height; - prev_dx = builder->dx; - prev_dy = builder->dy; - if (gsk_render_node_get_node_type (shadow_child) == GSK_TEXT_NODE) { ops_offset (builder, dx, dy); render_text_node (self, shadow_child, builder, &shadow->color, TRUE); - ops_offset (builder, prev_dx, prev_dy); + ops_offset (builder, - dx, - dy); continue; } @@ -1416,7 +1411,7 @@ render_shadow_node (GskGLRenderer *self, ops_draw (builder, vertex_data); } - ops_offset (builder, prev_dx, prev_dy); + ops_offset (builder, - dx, - dy); } /* Now draw the child normally */ diff --git a/gsk/gl/gskglrenderops.c b/gsk/gl/gskglrenderops.c index ea5c525635..d05ec61a0f 100644 --- a/gsk/gl/gskglrenderops.c +++ b/gsk/gl/gskglrenderops.c @@ -429,8 +429,8 @@ ops_offset (RenderOpBuilder *builder, float x, float y) { - builder->dx = x; - builder->dy = y; + builder->dx += x; + builder->dy += y; } void