mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-05 19:18:12 +02:00
clone_similar(): s/device_offset/clone_offset/
A little bit of sleep and reflection suggested that the use of device_offset_[xy] was confusing and clone_offset_[xy] more consistent with the function naming.
This commit is contained in:
parent
95c3c06932
commit
871f683367
14 changed files with 70 additions and 70 deletions
|
|
@ -616,8 +616,8 @@ _cairo_directfb_surface_clone_similar (void *abstract_surface,
|
|||
int src_y,
|
||||
int width,
|
||||
int height,
|
||||
int *device_offset_x,
|
||||
int *device_offset_y,
|
||||
int *clone_offset_x,
|
||||
int *clone_offset_y,
|
||||
cairo_surface_t **clone_out)
|
||||
{
|
||||
cairo_directfb_surface_t *surface = abstract_surface;
|
||||
|
|
@ -627,8 +627,8 @@ _cairo_directfb_surface_clone_similar (void *abstract_surface,
|
|||
"%s( surface=%p, src=%p ).\n", __FUNCTION__, surface, src);
|
||||
|
||||
if (src->backend == surface->base.backend) {
|
||||
*device_offset_x = 0;
|
||||
*device_offset_y = 0;
|
||||
*clone_offset_x = 0;
|
||||
*clone_offset_y = 0;
|
||||
*clone_out = cairo_surface_reference (src);
|
||||
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
|
|
@ -689,8 +689,8 @@ _cairo_directfb_surface_clone_similar (void *abstract_surface,
|
|||
|
||||
clone->dfbsurface->Unlock (clone->dfbsurface);
|
||||
|
||||
*device_offset_x = 0;
|
||||
*device_offset_y = 0;
|
||||
*clone_offset_x = 0;
|
||||
*clone_offset_y = 0;
|
||||
*clone_out = &clone->base;
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -511,8 +511,8 @@ _cairo_glitz_surface_clone_similar (void *abstract_surface,
|
|||
int src_y,
|
||||
int width,
|
||||
int height,
|
||||
int *device_offset_x,
|
||||
int *device_offset_y,
|
||||
int *clone_offset_x,
|
||||
int *clone_offset_y,
|
||||
cairo_surface_t **clone_out)
|
||||
{
|
||||
cairo_glitz_surface_t *surface = abstract_surface;
|
||||
|
|
@ -524,8 +524,8 @@ _cairo_glitz_surface_clone_similar (void *abstract_surface,
|
|||
|
||||
if (src->backend == surface->base.backend)
|
||||
{
|
||||
*device_offset_x = 0;
|
||||
*device_offset_y = 0;
|
||||
*clone_offset_x = 0;
|
||||
*clone_offset_y = 0;
|
||||
*clone_out = cairo_surface_reference (src);
|
||||
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
|
|
@ -2248,7 +2248,7 @@ _cairo_glitz_surface_old_show_glyphs (cairo_scaled_font_t *scaled_font,
|
|||
if (!glyph_private || !glyph_private->area)
|
||||
{
|
||||
int glyph_width, glyph_height;
|
||||
int device_offset_x, device_offset_y;
|
||||
int clone_offset_x, clone_offset_y;
|
||||
|
||||
image = &scaled_glyphs[i]->surface->base;
|
||||
glyph_width = scaled_glyphs[i]->surface->width;
|
||||
|
|
@ -2260,15 +2260,15 @@ _cairo_glitz_surface_old_show_glyphs (cairo_scaled_font_t *scaled_font,
|
|||
0,
|
||||
glyph_width,
|
||||
glyph_height,
|
||||
&device_offset_x,
|
||||
&device_offset_y
|
||||
&clone_offset_x,
|
||||
&clone_offset_y
|
||||
(cairo_surface_t **)
|
||||
&clone);
|
||||
if (status)
|
||||
goto UNLOCK;
|
||||
|
||||
assert (device_offset_x = 0);
|
||||
assert (device_offset_y = 0);
|
||||
assert (clone_offset_x = 0);
|
||||
assert (clone_offset_y = 0);
|
||||
|
||||
x_offset = scaled_glyphs[i]->surface->base.device_transform.x0;
|
||||
y_offset = scaled_glyphs[i]->surface->base.device_transform.y0;
|
||||
|
|
|
|||
|
|
@ -779,14 +779,14 @@ _cairo_image_surface_clone_similar (void *abstract_surface,
|
|||
int src_y,
|
||||
int width,
|
||||
int height,
|
||||
int *device_offset_x,
|
||||
int *device_offset_y,
|
||||
int *clone_offset_x,
|
||||
int *clone_offset_y,
|
||||
cairo_surface_t **clone_out)
|
||||
{
|
||||
cairo_image_surface_t *surface = abstract_surface;
|
||||
|
||||
if (src->backend == surface->base.backend) {
|
||||
*device_offset_x = *device_offset_y = 0;
|
||||
*clone_offset_x = *clone_offset_y = 0;
|
||||
*clone_out = cairo_surface_reference (src);
|
||||
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
|
|
|
|||
|
|
@ -1247,7 +1247,7 @@ _cairo_pattern_acquire_surface_for_gradient (cairo_gradient_pattern_t *pattern,
|
|||
pixman_gradient_stop_t pixman_stops_static[2];
|
||||
pixman_gradient_stop_t *pixman_stops = pixman_stops_static;
|
||||
unsigned int i;
|
||||
int device_offset_x, device_offset_y;
|
||||
int clone_offset_x, clone_offset_y;
|
||||
|
||||
if (pattern->n_stops > ARRAY_LENGTH(pixman_stops_static)) {
|
||||
pixman_stops = _cairo_malloc_ab (pattern->n_stops, sizeof(pixman_gradient_stop_t));
|
||||
|
|
@ -1398,8 +1398,8 @@ _cairo_pattern_acquire_surface_for_gradient (cairo_gradient_pattern_t *pattern,
|
|||
|
||||
status = _cairo_surface_clone_similar (dst, &image->base,
|
||||
0, 0, width, height,
|
||||
&device_offset_x,
|
||||
&device_offset_y,
|
||||
&clone_offset_x,
|
||||
&clone_offset_y,
|
||||
out);
|
||||
|
||||
cairo_surface_destroy (&image->base);
|
||||
|
|
|
|||
|
|
@ -1580,8 +1580,8 @@ _cairo_quartz_surface_clone_similar (void *abstract_surface,
|
|||
int src_y,
|
||||
int width,
|
||||
int height,
|
||||
int *device_offset_x,
|
||||
int *device_offset_y,
|
||||
int *clone_offset_x,
|
||||
int *clone_offset_y,
|
||||
cairo_surface_t **clone_out)
|
||||
{
|
||||
cairo_quartz_surface_t *new_surface = NULL;
|
||||
|
|
@ -1600,8 +1600,8 @@ _cairo_quartz_surface_clone_similar (void *abstract_surface,
|
|||
*clone_out = (cairo_surface_t*)
|
||||
_cairo_quartz_surface_create_internal (NULL, CAIRO_CONTENT_COLOR_ALPHA,
|
||||
width, height);
|
||||
*device_offset_x = 0;
|
||||
*device_offset_y = 0;
|
||||
*clone_offset_x = 0;
|
||||
*clone_offset_y = 0;
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
@ -1612,8 +1612,8 @@ _cairo_quartz_surface_clone_similar (void *abstract_surface,
|
|||
*clone_out = (cairo_surface_t*)
|
||||
_cairo_quartz_surface_create_internal (NULL, CAIRO_CONTENT_COLOR_ALPHA,
|
||||
qsurf->extents.width, qsurf->extents.height);
|
||||
*device_offset_x = 0;
|
||||
*device_offset_y = 0;
|
||||
*clone_offset_x = 0;
|
||||
*clone_offset_y = 0;
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
}
|
||||
}
|
||||
|
|
@ -1653,8 +1653,8 @@ _cairo_quartz_surface_clone_similar (void *abstract_surface,
|
|||
CGImageRelease (quartz_image);
|
||||
|
||||
FINISH:
|
||||
*device_offset_x = src_x;
|
||||
*device_offset_y = src_y;
|
||||
*clone_offset_x = src_x;
|
||||
*clone_offset_y = src_y;
|
||||
*clone_out = (cairo_surface_t*) new_surface;
|
||||
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
|
|
|
|||
|
|
@ -124,8 +124,8 @@ _cairo_surface_fallback_clone_similar (cairo_surface_t *surface,
|
|||
int src_y,
|
||||
int width,
|
||||
int height,
|
||||
int *device_offset_x,
|
||||
int *device_offset_y,
|
||||
int *clone_offset_x,
|
||||
int *clone_offset_y,
|
||||
cairo_surface_t **clone_out);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1249,8 +1249,8 @@ _cairo_surface_fallback_clone_similar (cairo_surface_t *surface,
|
|||
int src_y,
|
||||
int width,
|
||||
int height,
|
||||
int *device_offset_x,
|
||||
int *device_offset_y,
|
||||
int *clone_offset_x,
|
||||
int *clone_offset_y,
|
||||
cairo_surface_t **clone_out)
|
||||
{
|
||||
cairo_status_t status;
|
||||
|
|
@ -1281,8 +1281,8 @@ _cairo_surface_fallback_clone_similar (cairo_surface_t *surface,
|
|||
cairo_destroy (cr);
|
||||
|
||||
if (status == CAIRO_STATUS_SUCCESS) {
|
||||
*device_offset_x = src_x;
|
||||
*device_offset_y = src_y;
|
||||
*clone_offset_x = src_x;
|
||||
*clone_offset_y = src_y;
|
||||
*clone_out = new_surface;
|
||||
} else
|
||||
cairo_surface_destroy (new_surface);
|
||||
|
|
|
|||
|
|
@ -1127,8 +1127,8 @@ _cairo_surface_clone_similar (cairo_surface_t *surface,
|
|||
int src_y,
|
||||
int width,
|
||||
int height,
|
||||
int *device_offset_x,
|
||||
int *device_offset_y,
|
||||
int *clone_offset_x,
|
||||
int *clone_offset_y,
|
||||
cairo_surface_t **clone_out)
|
||||
{
|
||||
cairo_status_t status = CAIRO_INT_STATUS_UNSUPPORTED;
|
||||
|
|
@ -1145,8 +1145,8 @@ _cairo_surface_clone_similar (cairo_surface_t *surface,
|
|||
status = surface->backend->clone_similar (surface, src,
|
||||
src_x, src_y,
|
||||
width, height,
|
||||
device_offset_x,
|
||||
device_offset_y,
|
||||
clone_offset_x,
|
||||
clone_offset_y,
|
||||
clone_out);
|
||||
|
||||
if (status == CAIRO_INT_STATUS_UNSUPPORTED) {
|
||||
|
|
@ -1157,8 +1157,8 @@ _cairo_surface_clone_similar (cairo_surface_t *surface,
|
|||
surface->backend->clone_similar (surface, &image->base,
|
||||
src_x, src_y,
|
||||
width, height,
|
||||
device_offset_x,
|
||||
device_offset_y,
|
||||
clone_offset_x,
|
||||
clone_offset_y,
|
||||
clone_out);
|
||||
|
||||
_cairo_surface_release_source_image (src, image, image_extra);
|
||||
|
|
@ -1172,8 +1172,8 @@ _cairo_surface_clone_similar (cairo_surface_t *surface,
|
|||
_cairo_surface_fallback_clone_similar (surface, src,
|
||||
src_x, src_y,
|
||||
width, height,
|
||||
device_offset_x,
|
||||
device_offset_y,
|
||||
clone_offset_x,
|
||||
clone_offset_y,
|
||||
clone_out);
|
||||
|
||||
/* We should never get UNSUPPORTED here, so if we have an error, bail. */
|
||||
|
|
|
|||
|
|
@ -160,8 +160,8 @@ _cairo_win32_surface_clone_similar (void *abstract_surface,
|
|||
int src_y,
|
||||
int width,
|
||||
int height,
|
||||
int *device_offset_x,
|
||||
int *device_offset_y,
|
||||
int *clone_offset_x,
|
||||
int *clone_offset_y,
|
||||
cairo_surface_t **clone_out);
|
||||
|
||||
static inline void
|
||||
|
|
|
|||
|
|
@ -443,8 +443,8 @@ _cairo_win32_surface_clone_similar (void *abstract_surface,
|
|||
int src_y,
|
||||
int width,
|
||||
int height,
|
||||
int *device_offset_x,
|
||||
int *device_offset_y,
|
||||
int *clone_offset_x,
|
||||
int *clone_offset_y,
|
||||
cairo_surface_t **clone_out)
|
||||
{
|
||||
cairo_content_t src_content;
|
||||
|
|
@ -473,8 +473,8 @@ _cairo_win32_surface_clone_similar (void *abstract_surface,
|
|||
_cairo_pattern_fini (&pattern.base);
|
||||
|
||||
if (status == CAIRO_STATUS_SUCCESS) {
|
||||
*device_offset_x = src_x;
|
||||
*device_offset_y = src_y;
|
||||
*clone_offset_x = src_x;
|
||||
*clone_offset_y = src_y;
|
||||
*clone_out = new_surface;
|
||||
} else
|
||||
cairo_surface_destroy (new_surface);
|
||||
|
|
|
|||
|
|
@ -695,8 +695,8 @@ _cairo_xcb_surface_clone_similar (void *abstract_surface,
|
|||
int src_y,
|
||||
int width,
|
||||
int height,
|
||||
int *device_offset_x,
|
||||
int *device_offset_y,
|
||||
int *clone_offset_x,
|
||||
int *clone_offset_y,
|
||||
cairo_surface_t **clone_out)
|
||||
{
|
||||
cairo_xcb_surface_t *surface = abstract_surface;
|
||||
|
|
@ -706,8 +706,8 @@ _cairo_xcb_surface_clone_similar (void *abstract_surface,
|
|||
cairo_xcb_surface_t *xcb_src = (cairo_xcb_surface_t *)src;
|
||||
|
||||
if (_cairo_xcb_surface_same_screen(surface, xcb_src)) {
|
||||
*device_offset_x = 0;
|
||||
*device_offset_y = 0;
|
||||
*clone_offset_x = 0;
|
||||
*clone_offset_y = 0;
|
||||
*clone_out = cairo_surface_reference (src);
|
||||
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
|
|
@ -732,8 +732,8 @@ _cairo_xcb_surface_clone_similar (void *abstract_surface,
|
|||
return status;
|
||||
}
|
||||
|
||||
*device_offset_x = src_x;
|
||||
*device_offset_y = src_y;
|
||||
*clone_offset_x = src_x;
|
||||
*clone_offset_y = src_y;
|
||||
*clone_out = &clone->base;
|
||||
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
|
|
|
|||
|
|
@ -1134,8 +1134,8 @@ _cairo_xlib_surface_clone_similar (void *abstract_surface,
|
|||
int src_y,
|
||||
int width,
|
||||
int height,
|
||||
int *device_offset_x,
|
||||
int *device_offset_y,
|
||||
int *clone_offset_x,
|
||||
int *clone_offset_y,
|
||||
cairo_surface_t **clone_out)
|
||||
{
|
||||
cairo_xlib_surface_t *surface = abstract_surface;
|
||||
|
|
@ -1148,8 +1148,8 @@ _cairo_xlib_surface_clone_similar (void *abstract_surface,
|
|||
cairo_xlib_surface_t *xlib_src = (cairo_xlib_surface_t *)src;
|
||||
|
||||
if (_cairo_xlib_surface_same_screen (surface, xlib_src)) {
|
||||
*device_offset_x = 0;
|
||||
*device_offset_y = 0;
|
||||
*clone_offset_x = 0;
|
||||
*clone_offset_y = 0;
|
||||
*clone_out = cairo_surface_reference (src);
|
||||
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
|
|
@ -1182,8 +1182,8 @@ _cairo_xlib_surface_clone_similar (void *abstract_surface,
|
|||
return status;
|
||||
}
|
||||
|
||||
*device_offset_x = src_x;
|
||||
*device_offset_y = src_y;
|
||||
*clone_offset_x = src_x;
|
||||
*clone_offset_y = src_y;
|
||||
*clone_out = &clone->base;
|
||||
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
|
|
|
|||
|
|
@ -554,7 +554,7 @@ struct _cairo_surface_backend {
|
|||
* 2. It has the same contents as @src within the given rectangle.
|
||||
*
|
||||
* 3. The offset of the similar surface with respect to the original
|
||||
* surface is returned in the device transform vector.
|
||||
* surface is returned in the clone_offset vector.
|
||||
* - if you clone the entire surface, this vector is zero.
|
||||
* - if you clone (src_x, src_y)x(w, h) the vector is (src_x, src_y);
|
||||
*/
|
||||
|
|
@ -565,8 +565,8 @@ struct _cairo_surface_backend {
|
|||
int src_y,
|
||||
int width,
|
||||
int height,
|
||||
int *device_offset_x,
|
||||
int *device_offset_y,
|
||||
int *clone_offset_x,
|
||||
int *clone_offset_y,
|
||||
cairo_surface_t **clone_out);
|
||||
|
||||
/* XXX: dst should be the first argument for consistency */
|
||||
|
|
@ -1824,8 +1824,8 @@ _cairo_surface_clone_similar (cairo_surface_t *surface,
|
|||
int src_y,
|
||||
int width,
|
||||
int height,
|
||||
int *device_offset_x,
|
||||
int *device_offset_y,
|
||||
int *clone_offset_x,
|
||||
int *clone_offset_y,
|
||||
cairo_surface_t **clone_out);
|
||||
|
||||
cairo_private cairo_surface_t *
|
||||
|
|
|
|||
|
|
@ -176,15 +176,15 @@ _test_fallback_surface_clone_similar (void *abstract_surface,
|
|||
int src_y,
|
||||
int width,
|
||||
int height,
|
||||
int *device_offset_x,
|
||||
int *device_offset_y,
|
||||
int *clone_offset_x,
|
||||
int *clone_offset_y,
|
||||
cairo_surface_t **clone_out)
|
||||
{
|
||||
test_fallback_surface_t *surface = abstract_surface;
|
||||
|
||||
if (src->backend == surface->base.backend) {
|
||||
*device_offset_x = 0;
|
||||
*device_offset_y = 0;
|
||||
*clone_offset_x = 0;
|
||||
*clone_offset_y = 0;
|
||||
*clone_out = cairo_surface_reference (src);
|
||||
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue