Merge branch 'matthiasc/for-main' into 'main'

colorstate: Avoid a memcpy

See merge request GNOME/gtk!7599
This commit is contained in:
Matthias Clasen
2024-08-11 22:00:03 +00:00
3 changed files with 8 additions and 2 deletions

View File

@@ -449,7 +449,6 @@ TRANSFORM(gdk_cicp_from_rec2100_linear, NONE, cicp->from_rec2020, cicp->o
#undef cicp
/* }}} */
/* }}} */
/* {{{ Vfuncs */

View File

@@ -176,7 +176,10 @@ gdk_color_state_convert_color (GdkColorState *src_cs,
GdkFloatColorConvert convert = NULL;
GdkFloatColorConvert convert2 = NULL;
memcpy (dest, src, sizeof (float) * 4);
dest[0] = src[0];
dest[1] = src[1];
dest[2] = src[2];
dest[3] = src[3];
if (gdk_color_state_equal (src_cs, dest_cs))
return;

View File

@@ -74,6 +74,10 @@ gsk_gpu_color_states_is_alt_premultiplied (GskGpuColorStates self)
return !!(self & COLOR_SPACE_ALT_PREMULTIPLIED);
}
/* Note: this function should only return a colorstate other than
* color->color_state *only* if the shaders can't handle the conversion
* from color->color_state to ccs.
*/
static inline GdkColorState *
gsk_gpu_color_states_find (GdkColorState *ccs,
const GdkColor *color)