diff options
author | Timm Bäder <mail@baedert.org> | 2020-01-20 11:06:56 +0100 |
---|---|---|
committer | Timm Bäder <mail@baedert.org> | 2020-01-24 06:08:39 +0100 |
commit | 7855a98fd1faf855869687e84027174f859306d8 (patch) | |
tree | 71310e47b86a5f9f440f700daa4404ba9e05d58c /gtk/gtkcssimageicontheme.c | |
parent | aea27b86c1b8f24981952b621dc93fd4b0d8232a (diff) | |
download | gtk+-7855a98fd1faf855869687e84027174f859306d8.tar.gz |
cssimageicontheme: Avoid copying colors
Diffstat (limited to 'gtk/gtkcssimageicontheme.c')
-rw-r--r-- | gtk/gtkcssimageicontheme.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/gtk/gtkcssimageicontheme.c b/gtk/gtkcssimageicontheme.c index c2a21c41b9..508c90d435 100644 --- a/gtk/gtkcssimageicontheme.c +++ b/gtk/gtkcssimageicontheme.c @@ -94,21 +94,22 @@ gtk_css_image_icon_theme_snapshot (GtkCssImage *image, if (symbolic) { + const GdkRGBA *fg = &icon_theme->color; + const GdkRGBA *sc = &icon_theme->success; + const GdkRGBA *wc = &icon_theme->warning; + const GdkRGBA *ec = &icon_theme->error; graphene_matrix_t matrix; graphene_vec4_t offset; - GdkRGBA fg = icon_theme->color; - GdkRGBA sc = icon_theme->success; - GdkRGBA wc = icon_theme->warning; - GdkRGBA ec = icon_theme->error; + graphene_matrix_init_from_float (&matrix, (float[16]) { - sc.red - fg.red, sc.green - fg.green, sc.blue - fg.blue, 0, - wc.red - fg.red, wc.green - fg.green, wc.blue - fg.blue, 0, - ec.red - fg.red, ec.green - fg.green, ec.blue - fg.blue, 0, - 0, 0, 0, fg.alpha + sc->red - fg->red, sc->green - fg->green, sc->blue - fg->blue, 0, + wc->red - fg->red, wc->green - fg->green, wc->blue - fg->blue, 0, + ec->red - fg->red, ec->green - fg->green, ec->blue - fg->blue, 0, + 0, 0, 0, fg->alpha }); - graphene_vec4_init (&offset, fg.red, fg.green, fg.blue, 0); + graphene_vec4_init (&offset, fg->red, fg->green, fg->blue, 0); gtk_snapshot_push_color_matrix (snapshot, &matrix, &offset); } |