From: Benjamin Otte Date: Thu, 7 Sep 2023 21:02:37 +0000 (+0200) Subject: glrenderer: Shadows without offset do exist X-Git-Tag: archive/raspbian/4.12.4+ds-3+rpi1^2~21^2~2^2~16 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=a0bd59e76d9bf4cec9f3914af844156a432c88ac;p=gtk4.git glrenderer: Shadows without offset do exist Not for opaque contents, but stuff can be semi-transparent. Testcase included. --- diff --git a/gsk/gl/gskglrenderjob.c b/gsk/gl/gskglrenderjob.c index c862cb50a3..6f3db87c24 100644 --- a/gsk/gl/gskglrenderjob.c +++ b/gsk/gl/gskglrenderjob.c @@ -3153,10 +3153,6 @@ gsk_gl_render_job_visit_shadow_node (GskGLRenderJob *job, offscreen.was_offscreen = TRUE; } - else if (dx == 0 && dy == 0) - { - continue; /* Invisible anyway */ - } else { offscreen.bounds = &shadow_child->bounds; diff --git a/testsuite/gsk/compare/shadow-behind.node b/testsuite/gsk/compare/shadow-behind.node new file mode 100644 index 0000000000..2ab2225ee0 --- /dev/null +++ b/testsuite/gsk/compare/shadow-behind.node @@ -0,0 +1,7 @@ +shadow { + shadows: rgb(255,0,0) 0 0; + child: color { + bounds: 0 0 50 50; + color: rgba(0,0,255,0.6); + } +} diff --git a/testsuite/gsk/compare/shadow-behind.png b/testsuite/gsk/compare/shadow-behind.png new file mode 100644 index 0000000000..1fd035d962 Binary files /dev/null and b/testsuite/gsk/compare/shadow-behind.png differ diff --git a/testsuite/gsk/meson.build b/testsuite/gsk/meson.build index 944d4f8f99..53da9d1dcc 100644 --- a/testsuite/gsk/meson.build +++ b/testsuite/gsk/meson.build @@ -89,6 +89,7 @@ compare_render_tests = [ 'scale-up-down', 'scaled-cairo', 'scaled-texture', + 'shadow-behind', 'shadow-in-opacity', 'shadow-opacity', 'texture-scale-magnify-10000x',