summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2010-04-29 17:29:13 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2010-04-30 10:16:06 +0100
commit3940b0e91c274de0cf2fca4b34d4025b92965c19 (patch)
tree6417b838ef6e920fcf0ac50bc6769bdb693bc7f4 /util
parent4b6fa8d5a78731aca80f3c8c6320e7edc845c5b5 (diff)
subsurface: s/region/rectangle/
After a renewed discussion, it was pointed out that the API in Cairo was not restrictive and by using doubles we would be consisted with the rest of the API. Thus prompting the name change to cairo_surface_create_for_rectangle() similar to cairo_rectangle(). And document the public API.
Diffstat (limited to 'util')
-rw-r--r--util/cairo-script/cairo-script-operators.c12
-rw-r--r--util/cairo-trace/trace.c10
2 files changed, 11 insertions, 11 deletions
diff --git a/util/cairo-script/cairo-script-operators.c b/util/cairo-script/cairo-script-operators.c
index d1685e58..754a27e0 100644
--- a/util/cairo-script/cairo-script-operators.c
+++ b/util/cairo-script/cairo-script-operators.c
@@ -5277,22 +5277,22 @@ static csi_status_t
_subsurface (csi_t *ctx)
{
csi_object_t obj;
- long x, y, width, height;
+ double x, y, width, height;
cairo_surface_t *target;
csi_status_t status;
check (5);
- status = _csi_ostack_get_integer (ctx, 0, &height);
+ status = _csi_ostack_get_number (ctx, 0, &height);
if (_csi_unlikely (status))
return status;
- status = _csi_ostack_get_integer (ctx, 1, &width);
+ status = _csi_ostack_get_number (ctx, 1, &width);
if (_csi_unlikely (status))
return status;
- status = _csi_ostack_get_integer (ctx, 2, &y);
+ status = _csi_ostack_get_number (ctx, 2, &y);
if (_csi_unlikely (status))
return status;
- status = _csi_ostack_get_integer (ctx, 3, &x);
+ status = _csi_ostack_get_number (ctx, 3, &x);
if (_csi_unlikely (status))
return status;
status = _csi_ostack_get_surface (ctx, 4, &target);
@@ -5300,7 +5300,7 @@ _subsurface (csi_t *ctx)
return status;
obj.type = CSI_OBJECT_TYPE_SURFACE;
- obj.datum.surface = cairo_surface_create_for_region (target, x, y, width, height);
+ obj.datum.surface = cairo_surface_create_for_rectangle (target, x, y, width, height);
pop (5);
return push (&obj);
}
diff --git a/util/cairo-trace/trace.c b/util/cairo-trace/trace.c
index 01eadf4d..5a0a44a8 100644
--- a/util/cairo-trace/trace.c
+++ b/util/cairo-trace/trace.c
@@ -3495,16 +3495,16 @@ cairo_surface_create_similar (cairo_surface_t *other,
}
cairo_surface_t *
-cairo_surface_create_for_region (cairo_surface_t *target,
- int x, int y,
- int width, int height)
+cairo_surface_create_for_rectangle (cairo_surface_t *target,
+ double x, double y,
+ double width, double height)
{
cairo_surface_t *ret;
long surface_id;
_enter_trace ();
- ret = DLCALL (cairo_surface_create_for_region, target, x, y, width, height);
+ ret = DLCALL (cairo_surface_create_for_rectangle, target, x, y, width, height);
surface_id = _create_surface_id (ret);
_emit_line_info ();
@@ -3518,7 +3518,7 @@ cairo_surface_create_for_region (cairo_surface_t *target,
_trace_printf ("dup ");
else
_trace_printf ("%d index ", current_stack_depth - obj->operand - 1);
- _trace_printf ("%d %d %d %d subsurface %% s%ld\n",
+ _trace_printf ("%f %f %f %f subsurface %% s%ld\n",
x, y, width, height,
surface_id);