[gthumb: 11/129] image rotator: no need to create a pixbuf here



commit c413f9762988cdb955f19ffb473b1f836b5a1283
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Thu Apr 14 19:26:22 2011 +0200

    image rotator: no need to create a pixbuf here

 extensions/file_tools/gth-image-rotator.c |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)
---
diff --git a/extensions/file_tools/gth-image-rotator.c b/extensions/file_tools/gth-image-rotator.c
index 9f81a4a..fcb1780 100644
--- a/extensions/file_tools/gth-image-rotator.c
+++ b/extensions/file_tools/gth-image-rotator.c
@@ -588,7 +588,6 @@ gth_image_rotator_set_background (GthImageRotator *self,
 GdkPixbuf *
 gth_image_rotator_get_result (GthImageRotator *self)
 {
-	cairo_surface_t *input;
 	double           tx, ty;
 	cairo_matrix_t   matrix;
 	GdkRectangle     image_area;
@@ -597,8 +596,6 @@ gth_image_rotator_get_result (GthImageRotator *self)
 	cairo_t         *cr;
 	GdkPixbuf       *pixbuf;
 
-	input = _cairo_image_surface_create_from_pixbuf (gth_image_viewer_get_current_pixbuf (GTH_IMAGE_VIEWER (self->priv->viewer)));
-
 	/* compute the transformation matrix and the clip area */
 
 	tx = self->priv->center.x;
@@ -640,7 +637,7 @@ gth_image_rotator_get_result (GthImageRotator *self)
   	/* paint the rotated image */
 
 	cairo_set_matrix (cr, &matrix);
-	cairo_set_source_surface (cr, input, image_area.x, image_area.y);
+	cairo_set_source_surface (cr, gth_image_viewer_get_current_image (GTH_IMAGE_VIEWER (self->priv->viewer)), image_area.x, image_area.y);
   	cairo_rectangle (cr, image_area.x, image_area.y, image_area.width, image_area.height);
   	cairo_fill (cr);
 
@@ -648,7 +645,6 @@ gth_image_rotator_get_result (GthImageRotator *self)
 
 	cairo_destroy (cr);
 	cairo_surface_destroy (output);
-	cairo_surface_destroy (input);
 
 	return pixbuf;
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]