[cairo-commit] rcairo/src rb_cairo_pattern.c,1.5,1.6
Kouhei Sutou
commit at pdx.freedesktop.org
Tue May 1 06:13:08 PDT 2007
Committed by: kou
Update of /cvs/cairo/rcairo/src
In directory kemper:/tmp/cvs-serv6455/src
Modified Files:
rb_cairo_pattern.c
Log Message:
* src/rb_cairo_pattern.c
(cr_gradient_pattern_get_color_stop_color): cleanup.
Index: rb_cairo_pattern.c
===================================================================
RCS file: /cvs/cairo/rcairo/src/rb_cairo_pattern.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- rb_cairo_pattern.c 1 May 2007 13:06:47 -0000 1.5
+++ rb_cairo_pattern.c 1 May 2007 13:12:58 -0000 1.6
@@ -357,19 +357,13 @@
static VALUE
cr_gradient_pattern_get_color_stop_color (VALUE self, VALUE index)
{
- cairo_status_t status;
- double offset, red, green, blue, alpha;
+ VALUE result, offset, rgba;
- status = cairo_pattern_get_color_stop_rgba (_SELF (self), NUM2INT (index),
- &offset, &red, &green, &blue,
- &alpha);
- rb_cairo_check_status (status);
- return rb_ary_new3 (2, rb_float_new (offset),
- cr_color_parse (rb_ary_new3 (4,
- rb_float_new (red),
- rb_float_new (green),
- rb_float_new (blue),
- rb_float_new (alpha))));
+ result = cr_gradient_pattern_get_color_stop_rgba (self, index);
+ offset = rb_ary_shift (result);
+ rgba = result;
+
+ return rb_ary_new3 (2, offset, cr_color_parse (rgba));
}
static VALUE
More information about the cairo-commit
mailing list