From 196ecd455fb85454f9e8351d0ee885bd23f16250 Mon Sep 17 00:00:00 2001 From: Felix Riemann Date: Sat, 22 Apr 2017 12:41:09 +0200 Subject: EomPrintPreview: Avoid unnecessary color parsing The RGB values of black and white are known and thus can be set directly without parsing them with GdkRGBA first. taken from: https://git.gnome.org/browse/eog/commit/?id=b06f858 --- src/eom-print-preview.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/eom-print-preview.c b/src/eom-print-preview.c index 4ede318..383b633 100644 --- a/src/eom-print-preview.c +++ b/src/eom-print-preview.c @@ -982,7 +982,6 @@ eom_print_preview_draw (EomPrintPreview *preview, cairo_t *cr) GtkWidget *area; GtkAllocation allocation; gint x0, y0; - GdkRGBA color; gboolean has_focus; priv = preview->priv; @@ -993,14 +992,12 @@ eom_print_preview_draw (EomPrintPreview *preview, cairo_t *cr) gtk_widget_get_allocation (area, &allocation); /* draw the page */ - gdk_rgba_parse (&color, "white"); - gdk_cairo_set_source_rgba (cr, &color); + cairo_set_source_rgb (cr, 1., 1., 1.); cairo_rectangle (cr, 0, 0, allocation.width, allocation.height); cairo_fill (cr); /* draw the page margins */ - gdk_rgba_parse (&color, "black"); - gdk_cairo_set_source_rgba (cr, &color); + cairo_set_source_rgb (cr, 0., 0., 0.); cairo_set_line_width (cr, 0.1); cairo_rectangle (cr, priv->l_rmargin, priv->t_rmargin, -- cgit v1.2.1