mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-13 22:10:08 +00:00
Merge branch 'wip/smcv/bug6977' into 'main'
scaling test: Fix intermittent failure with alpha = 0 Closes #6977 See merge request GNOME/gtk!7684
This commit is contained in:
commit
7aeca0512c
@ -896,10 +896,22 @@ create_stipple_texture (GdkMemoryFormat format,
|
||||
}
|
||||
}
|
||||
|
||||
average->red /= average->alpha;
|
||||
average->green /= average->alpha;
|
||||
average->blue /= average->alpha;
|
||||
average->alpha /= 4.0f;
|
||||
if (average->alpha != 0.0f)
|
||||
{
|
||||
average->red /= average->alpha;
|
||||
average->green /= average->alpha;
|
||||
average->blue /= average->alpha;
|
||||
average->alpha /= 4.0f;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Each component of the average has been multiplied by the alpha
|
||||
* already, so if the alpha is zero, all components should also
|
||||
* be zero */
|
||||
g_assert_cmpfloat (average->red, ==, 0.0f);
|
||||
g_assert_cmpfloat (average->green, ==, 0.0f);
|
||||
g_assert_cmpfloat (average->blue, ==, 0.0f);
|
||||
}
|
||||
|
||||
texture_builder_init (&builder, format, width, height);
|
||||
for (y = 0; y < height; y++)
|
||||
|
Loading…
Reference in New Issue
Block a user