[gtk/wip/baedert/for-master: 2/2] gskpango: Don't copy fg color
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/baedert/for-master: 2/2] gskpango: Don't copy fg color
- Date: Mon, 21 Dec 2020 14:23:54 +0000 (UTC)
commit e90f5e8a2085ba39c102244c28bffa19bfb67d95
Author: Timm Bäder <mail baedert org>
Date: Mon Dec 21 15:23:25 2020 +0100
gskpango: Don't copy fg color
No need to do that here, we copy it in to the individual render nodes
anyway.
gtk/gskpango.c | 6 +++---
gtk/gskpango.h | 2 +-
gtk/gtktextlayout.c | 2 +-
3 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/gtk/gskpango.c b/gtk/gskpango.c
index 6803f7528a..cfe868cb7a 100644
--- a/gtk/gskpango.c
+++ b/gtk/gskpango.c
@@ -66,11 +66,11 @@ get_color (GskPangoRenderer *crenderer,
rgba->red = color->red / 65535.;
rgba->green = color->green / 65535.;
rgba->blue = color->blue / 65535.;
- rgba->alpha = a ? a / 65535. : crenderer->fg_color.alpha;
+ rgba->alpha = a ? a / 65535. : crenderer->fg_color->alpha;
}
else
{
- *rgba = crenderer->fg_color;
+ *rgba = *crenderer->fg_color;
if (a)
rgba->alpha = a / 65535.;
}
@@ -502,7 +502,7 @@ gtk_snapshot_append_layout (GtkSnapshot *snapshot,
crenderer = gsk_pango_renderer_acquire ();
crenderer->snapshot = snapshot;
- crenderer->fg_color = *color;
+ crenderer->fg_color = color;
pango_renderer_draw_layout (PANGO_RENDERER (crenderer), layout, 0, 0);
diff --git a/gtk/gskpango.h b/gtk/gskpango.h
index 37052a1c0e..672128d1c1 100644
--- a/gtk/gskpango.h
+++ b/gtk/gskpango.h
@@ -58,7 +58,7 @@ struct _GskPangoRenderer
GtkWidget *widget;
GtkSnapshot *snapshot;
- GdkRGBA fg_color;
+ const GdkRGBA *fg_color;
/* Error underline color for this widget */
GdkRGBA *error_color;
diff --git a/gtk/gtktextlayout.c b/gtk/gtktextlayout.c
index ecbd2d3a08..9c994137ae 100644
--- a/gtk/gtktextlayout.c
+++ b/gtk/gtktextlayout.c
@@ -4164,7 +4164,7 @@ gtk_text_layout_snapshot (GtkTextLayout *layout,
crenderer->widget = widget;
crenderer->snapshot = snapshot;
- crenderer->fg_color = color;
+ crenderer->fg_color = &color;
gtk_text_layout_wrap_loop_start (layout);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]