[perl-Cairo] Cairo::Pattern: make set_filter and get_filter available to all types



commit f48dd047de404673044db950675737df4222286b
Author: Torsten Schönfeld <kaffeetisch gmx de>
Date:   Sun May 16 16:02:06 2010 +0200

    Cairo::Pattern: make set_filter and get_filter available to all types
    
    Similarly to the previous commit, cairo_pattern_set_filter and
    cairo_pattern_get_filter are applicable to all pattern types.

 CairoPattern.xs  |    8 ++++----
 t/CairoPattern.t |   13 +++++++++++--
 2 files changed, 15 insertions(+), 6 deletions(-)
---
diff --git a/CairoPattern.xs b/CairoPattern.xs
index 24a0791..3303e0d 100644
--- a/CairoPattern.xs
+++ b/CairoPattern.xs
@@ -81,6 +81,10 @@ cairo_status_t cairo_pattern_status (cairo_pattern_t *pattern);
 
 void cairo_pattern_set_extend (cairo_pattern_t * pattern, cairo_extend_t extend);
 
+void cairo_pattern_set_filter (cairo_pattern_t * pattern, cairo_filter_t filter);
+
+cairo_filter_t cairo_pattern_get_filter (cairo_pattern_t * pattern);
+
 cairo_extend_t cairo_pattern_get_extend (cairo_pattern_t * pattern);
 
 #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 2, 0)
@@ -148,10 +152,6 @@ cairo_pattern_t_noinc * create (class, cairo_surface_t * surface);
     OUTPUT:
 	RETVAL
 
-void cairo_pattern_set_filter (cairo_pattern_t * pattern, cairo_filter_t filter);
-
-cairo_filter_t cairo_pattern_get_filter (cairo_pattern_t * pattern);
-
 #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 4, 0)
 
 ## cairo_status_t cairo_pattern_get_surface (cairo_pattern_t *pattern, cairo_surface_t **surface);
diff --git a/t/CairoPattern.t b/t/CairoPattern.t
index f8b4951..709308c 100644
--- a/t/CairoPattern.t
+++ b/t/CairoPattern.t
@@ -10,7 +10,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 28;
+use Test::More tests => 31;
 
 unless (eval 'use Test::Number::Delta; 1;') {
 	my $reason = 'Test::Number::Delta not available';
@@ -33,6 +33,9 @@ isa_ok ($pat, 'Cairo::Pattern');
 $pat->set_extend ('pad');
 is ($pat->get_extend, 'pad', 'Cairo::SolidPattern set|get_extend');
 
+$pat->set_filter ('good');
+is ($pat->get_filter, 'good', 'Cairo::SolidPattern set|get_filter');
+
 my $surf = Cairo::ImageSurface->create ('rgb24', IMG_WIDTH, IMG_HEIGHT);
 $pat = Cairo::SurfacePattern->create ($surf);
 isa_ok ($pat, 'Cairo::SurfacePattern');
@@ -42,7 +45,7 @@ $pat->set_extend ('none');
 is ($pat->get_extend, 'none', 'Cairo::SurfacePattern set|get_extend');
 
 $pat->set_filter ('fast');
-is ($pat->get_filter, 'fast', '$pat->set|get_filter');
+is ($pat->get_filter, 'fast', 'Cairo::SurfacePattern set|get_filter');
 
 $pat = Cairo::LinearGradient->create (1, 2, 3, 4);
 isa_ok ($pat, 'Cairo::LinearGradient');
@@ -52,6 +55,9 @@ isa_ok ($pat, 'Cairo::Pattern');
 $pat->set_extend ('repeat');
 is ($pat->get_extend, 'repeat', 'Cairo::LinearGradient set|get_extend');
 
+$pat->set_filter ('best');
+is ($pat->get_filter, 'best', 'Cairo::LinearGradient set|get_filter');
+
 $pat = Cairo::RadialGradient->create (1, 2, 3, 4, 5, 6);
 isa_ok ($pat, 'Cairo::RadialGradient');
 isa_ok ($pat, 'Cairo::Gradient');
@@ -60,6 +66,9 @@ isa_ok ($pat, 'Cairo::Pattern');
 $pat->set_extend ('reflect');
 is ($pat->get_extend, 'reflect', 'Cairo::RadialGradient set|get_extend');
 
+$pat->set_filter ('nearest');
+is ($pat->get_filter, 'nearest', 'Cairo::RadialGradient set|get_filter');
+
 $pat->add_color_stop_rgb (1, 0.5, 0.6, 0.7);
 $pat->add_color_stop_rgba (1, 0.5, 0.6, 0.7, 0.8);
 



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