diff options
author | Felix Riemann <[email protected]> | 2017-04-22 12:41:09 +0200 |
---|---|---|
committer | raveit65 <[email protected]> | 2017-04-23 11:58:13 +0200 |
commit | 196ecd455fb85454f9e8351d0ee885bd23f16250 (patch) | |
tree | 67ee3f80a63d33503c4c5707e8393f8d868faea8 /src | |
parent | b119e91fe61ccc243857c6a70a3ef1029cab7c6b (diff) | |
download | eom-196ecd455fb85454f9e8351d0ee885bd23f16250.tar.bz2 eom-196ecd455fb85454f9e8351d0ee885bd23f16250.tar.xz |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/eom-print-preview.c | 7 |
1 files changed, 2 insertions, 5 deletions
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, |