diff options
author | Timm Bäder <mail@baedert.org> | 2020-05-17 08:53:47 +0200 |
---|---|---|
committer | Timm Bäder <mail@baedert.org> | 2020-05-17 15:30:28 +0200 |
commit | 01c0acb707e2ac86b8b96a5cb077a94723b9a55e (patch) | |
tree | bfec35a1c814e3c4fc62c65949832cbd37a4f9a6 /gsk | |
parent | afbc1d5b66fc816a0eb31722464e6e19faf9ed52 (diff) | |
download | gtk+-01c0acb707e2ac86b8b96a5cb077a94723b9a55e.tar.gz |
gl renderer: Apply scaled clip when rendering offscreen clipped child
Diffstat (limited to 'gsk')
-rw-r--r-- | gsk/gl/gskglrenderer.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/gsk/gl/gskglrenderer.c b/gsk/gl/gskglrenderer.c index ea2c4d9243..2061a12fec 100644 --- a/gsk/gl/gskglrenderer.c +++ b/gsk/gl/gskglrenderer.c @@ -1177,20 +1177,27 @@ render_clipped_child (GskGLRenderer *self, &transformed_clip)) { /* well fuck */ + const float scale = ops_get_scale (builder); gboolean is_offscreen; TextureRegion region; + GskRoundedRect scaled_clip; - gsk_rounded_rect_init_from_rect (&child_clip, &transformed_clip, 0.0f); + memset (&scaled_clip, 0, sizeof (GskRoundedRect)); - ops_push_clip (builder, &child_clip); + scaled_clip.bounds.origin.x = clip->origin.x * scale; + scaled_clip.bounds.origin.y = clip->origin.y * scale; + scaled_clip.bounds.size.width = clip->size.width * scale; + scaled_clip.bounds.size.height = clip->size.height * scale; + + ops_push_clip (builder, &scaled_clip); if (!add_offscreen_ops (self, builder, &child->bounds, child, ®ion, &is_offscreen, - RESET_OPACITY | RESET_CLIP)) + RESET_OPACITY | FORCE_OFFSCREEN)) g_assert_not_reached (); - ops_pop_clip (builder); + ops_set_program (builder, &self->programs->blit_program); ops_set_texture (builder, region.texture_id); |