mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-08 17:50:10 +00:00
Merge branch 'wip/otte/for-main' into 'main'
gpu: Draw proper shadows again Closes #6888 See merge request GNOME/gtk!7518
This commit is contained in:
commit
bdcfcfa5b9
@ -2445,8 +2445,8 @@ gsk_gl_render_job_visit_blurred_outset_shadow_node (GskGLRenderJob *job,
|
||||
const GskRenderNode *node)
|
||||
{
|
||||
const GskRoundedRect *outline = gsk_outset_shadow_node_get_outline (node);
|
||||
float scale_x = job->scale_x;
|
||||
float scale_y = job->scale_y;
|
||||
float scale_x = fabsf (job->scale_x);
|
||||
float scale_y = fabsf (job->scale_y);
|
||||
float blur_radius = gsk_outset_shadow_node_get_blur_radius (node);
|
||||
float blur_extra = blur_radius * 2.0f; /* 2.0 = shader radius_multiplier */
|
||||
float half_blur_extra = blur_extra / 2.0f;
|
||||
@ -2577,8 +2577,8 @@ gsk_gl_render_job_visit_blurred_outset_shadow_node (GskGLRenderJob *job,
|
||||
&offscreen,
|
||||
texture_width,
|
||||
texture_height,
|
||||
blur_radius * fabsf (scale_x),
|
||||
blur_radius * fabsf (scale_y));
|
||||
blur_radius * scale_x,
|
||||
blur_radius * scale_y);
|
||||
|
||||
gsk_gl_shadow_library_insert (job->driver->shadows_library,
|
||||
&scaled_outline,
|
||||
|
@ -2104,7 +2104,7 @@ gsk_gpu_node_processor_add_inset_shadow_node (GskGpuNodeProcessor *self,
|
||||
spread = gsk_inset_shadow_node_get_spread (node);
|
||||
blur_radius = gsk_inset_shadow_node_get_blur_radius (node);
|
||||
|
||||
if (blur_radius == 0)
|
||||
if (blur_radius < 0.01)
|
||||
{
|
||||
float color[4];
|
||||
|
||||
@ -2156,7 +2156,7 @@ gsk_gpu_node_processor_add_outset_shadow_node (GskGpuNodeProcessor *self,
|
||||
dx = gsk_outset_shadow_node_get_dx (node);
|
||||
dy = gsk_outset_shadow_node_get_dy (node);
|
||||
|
||||
if (blur_radius == 0)
|
||||
if (blur_radius < 0.01)
|
||||
{
|
||||
GskRoundedRect outline;
|
||||
float color[4];
|
||||
|
@ -111,14 +111,18 @@ blur_corner (vec2 p,
|
||||
if (min (r.x, r.y) <= 0.0)
|
||||
return 0.0;
|
||||
|
||||
p /= _sigma;
|
||||
r /= _sigma;
|
||||
float result = 0.0;
|
||||
float step = max (1.0, r.y / 8.0);
|
||||
for (float y = 0.5 * step; y <= r.y; y += step)
|
||||
float start = max (p.y - 3.0, 0.0);
|
||||
float end = min (p.y + 3.0, r.y);
|
||||
float step = (end - start) / 7.0;
|
||||
for (float y = start; y <= end; y += step)
|
||||
{
|
||||
float x = r.x - ellipse_x (r, r.y - y);
|
||||
result -= gauss (p.y - y, _sigma.y) * erf_range (vec2 (- p.x, x - p.x), _sigma.x);
|
||||
result -= gauss (p.y - y, 1.0) * erf_range (vec2 (- p.x, x - p.x), 1.0);
|
||||
}
|
||||
return result;
|
||||
return step * result;
|
||||
}
|
||||
|
||||
float
|
||||
|
@ -0,0 +1,10 @@
|
||||
clip {
|
||||
clip: 1400 1400 20 20;
|
||||
child: color-matrix {
|
||||
matrix: matrix3d(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255);
|
||||
child: outset-shadow {
|
||||
blur: 1000;
|
||||
outline: 0 0 1000 1000 / 1000 0 1000 0;
|
||||
}
|
||||
}
|
||||
}
|
Binary file not shown.
After Width: | Height: | Size: 112 B |
11
testsuite/gsk/compare/outset-shadow-corner-blur-tiny.node
Normal file
11
testsuite/gsk/compare/outset-shadow-corner-blur-tiny.node
Normal file
@ -0,0 +1,11 @@
|
||||
color {
|
||||
bounds: 0 0 100 100;
|
||||
color: rgba(0,0,0,0);
|
||||
}
|
||||
clip {
|
||||
clip: 10 10 20 20;
|
||||
child: outset-shadow {
|
||||
blur: 0.00001;
|
||||
outline: 0 0 100 100 / 100 0 100 0;
|
||||
}
|
||||
}
|
BIN
testsuite/gsk/compare/outset-shadow-corner-blur-tiny.png
Normal file
BIN
testsuite/gsk/compare/outset-shadow-corner-blur-tiny.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 133 B |
7
testsuite/gsk/compare/outset-shadow-corner-blur.node
Normal file
7
testsuite/gsk/compare/outset-shadow-corner-blur.node
Normal file
@ -0,0 +1,7 @@
|
||||
clip {
|
||||
clip: 0 0 15 15;
|
||||
child: outset-shadow {
|
||||
blur: 10;
|
||||
outline: 0 0 100 100 / 100 0 100 0;
|
||||
}
|
||||
}
|
BIN
testsuite/gsk/compare/outset-shadow-corner-blur.png
Normal file
BIN
testsuite/gsk/compare/outset-shadow-corner-blur.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.1 KiB |
@ -119,6 +119,9 @@ compare_render_tests = [
|
||||
'opacity-colormatrix-combinations',
|
||||
'opacity-overdraw',
|
||||
'opacity-overlapping-children',
|
||||
'outset-shadow-corner-blur',
|
||||
'outset-shadow-corner-blur-huge-nocairo-nogl',
|
||||
'outset-shadow-corner-blur-tiny',
|
||||
'outset_shadow_offset_both',
|
||||
'outset_shadow_offset_x',
|
||||
'outset_shadow_offset_y',
|
||||
|
Loading…
Reference in New Issue
Block a user