[sapwood] properly extract the cairo_paint() calls
- From: Sven Herzberg <herzi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [sapwood] properly extract the cairo_paint() calls
- Date: Fri, 13 Aug 2010 11:40:21 +0000 (UTC)
commit 0e252bf6ca87ac89ccfb9f51310d25a1b53920e4
Author: Sven Herzberg <herzi gnome-de org>
Date: Thu Aug 12 12:30:25 2010 +0200
properly extract the cairo_paint() calls
* engine/sapwood-pixmap.c: some more code simplification
engine/sapwood-pixmap.c | 22 ++++++++--------------
1 files changed, 8 insertions(+), 14 deletions(-)
---
diff --git a/engine/sapwood-pixmap.c b/engine/sapwood-pixmap.c
index a55af68..f911ea6 100644
--- a/engine/sapwood-pixmap.c
+++ b/engine/sapwood-pixmap.c
@@ -409,16 +409,13 @@ sapwood_crop_pixmap (cairo_surface_t* surface,
cairo_set_source_surface (cr, surface, -(original_width - requested_width), 0);
cairo_rectangle (cr, left, 0, right, MAX (original_height, requested_height));
cairo_clip (cr);
- if (!mask)
- {
- cairo_paint (cr);
- }
- else
+
+ cairo_paint (cr);
+
+ if (mask)
{
cairo_t* tmp_cr = gdk_cairo_create (mask);
- cairo_paint (cr);
-
/* adjust the bitmap */
cairo_set_source_surface (tmp_cr, cairo_get_target (tmp_cr), -(original_width - requested_width), 0);
cairo_set_operator (tmp_cr, CAIRO_OPERATOR_SOURCE);
@@ -442,16 +439,13 @@ sapwood_crop_pixmap (cairo_surface_t* surface,
cairo_set_source_surface (cr, surface, 0, -(original_height - requested_height));
cairo_rectangle (cr, 0, top, MAX (original_width, requested_width), bottom);
cairo_clip (cr);
- if (!mask)
- {
- cairo_paint (cr);
- }
- else
+
+ cairo_paint (cr);
+
+ if (mask)
{
cairo_t* tmp_cr = gdk_cairo_create (mask);
- cairo_paint (cr);
-
/* adjust the bitmap */
cairo_set_source_surface (tmp_cr, cairo_get_target (tmp_cr), 0, -(original_height - requested_height));
cairo_set_operator (tmp_cr, CAIRO_OPERATOR_SOURCE);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]