mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-05 06:28:01 +02:00
Removed surface backend functions set_matrix, set_filter and set_repeat
This commit is contained in:
parent
36b69fc7f4
commit
a97f4cce5e
15 changed files with 83 additions and 298 deletions
13
ChangeLog
13
ChangeLog
|
|
@ -1,5 +1,18 @@
|
|||
2005-03-04 David Reveman <davidr@novell.com>
|
||||
|
||||
* src/cairoint.h:
|
||||
* src/cairo_xlib_surface.c:
|
||||
(_cairo_xlib_surface_set_matrix): Setting identity transform should
|
||||
always be successful.
|
||||
|
||||
* src/cairo_surface.c:
|
||||
* src/cairo_ps_surface.c:
|
||||
* src/cairo_png_surface.c:
|
||||
* src/cairo_pdf_surface.c:
|
||||
* src/cairo_image_surface.c:
|
||||
* src/cairo_glitz_surface.c: Removed surface backend functions
|
||||
set_matrix, set_filter, set_repeat.
|
||||
|
||||
* configure.in: Enabled glitz backend.
|
||||
|
||||
* src/cairo_glitz_surface.c: Major update to glitz backend. The output
|
||||
|
|
|
|||
|
|
@ -396,11 +396,10 @@ _cairo_glitz_surface_clone_similar (void *abstract_surface,
|
|||
return CAIRO_INT_STATUS_UNSUPPORTED;
|
||||
}
|
||||
|
||||
static cairo_status_t
|
||||
_cairo_glitz_surface_set_matrix (void *abstract_surface,
|
||||
cairo_matrix_t *matrix)
|
||||
static void
|
||||
_cairo_glitz_surface_set_matrix (cairo_glitz_surface_t *surface,
|
||||
cairo_matrix_t *matrix)
|
||||
{
|
||||
cairo_glitz_surface_t *surface = abstract_surface;
|
||||
glitz_transform_t transform;
|
||||
|
||||
transform.matrix[0][0] = _cairo_fixed_from_double (matrix->m[0][0]);
|
||||
|
|
@ -416,20 +415,6 @@ _cairo_glitz_surface_set_matrix (void *abstract_surface,
|
|||
transform.matrix[2][2] = 1 << 16;
|
||||
|
||||
glitz_surface_set_transform (surface->surface, &transform);
|
||||
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static cairo_status_t
|
||||
_cairo_glitz_surface_set_filter (void *abstract_surface, cairo_filter_t filter)
|
||||
{
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static cairo_status_t
|
||||
_cairo_glitz_surface_set_repeat (void *abstract_surface, int repeat)
|
||||
{
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static glitz_operator_t
|
||||
|
|
@ -1128,9 +1113,6 @@ static const cairo_surface_backend_t cairo_glitz_surface_backend = {
|
|||
_cairo_glitz_surface_acquire_dest_image,
|
||||
_cairo_glitz_surface_release_dest_image,
|
||||
_cairo_glitz_surface_clone_similar,
|
||||
_cairo_glitz_surface_set_matrix,
|
||||
_cairo_glitz_surface_set_filter,
|
||||
_cairo_glitz_surface_set_repeat,
|
||||
_cairo_glitz_surface_composite,
|
||||
_cairo_glitz_surface_fill_rectangles,
|
||||
_cairo_glitz_surface_composite_trapezoids,
|
||||
|
|
|
|||
|
|
@ -325,14 +325,6 @@ _cairo_image_surface_clone_similar (void *abstract_surface,
|
|||
return CAIRO_INT_STATUS_UNSUPPORTED;
|
||||
}
|
||||
|
||||
static cairo_status_t
|
||||
_cairo_image_abstract_surface_set_matrix (void *abstract_surface,
|
||||
cairo_matrix_t *matrix)
|
||||
{
|
||||
cairo_image_surface_t *surface = abstract_surface;
|
||||
return _cairo_image_surface_set_matrix (surface, matrix);
|
||||
}
|
||||
|
||||
cairo_status_t
|
||||
_cairo_image_surface_set_matrix (cairo_image_surface_t *surface,
|
||||
cairo_matrix_t *matrix)
|
||||
|
|
@ -356,14 +348,6 @@ _cairo_image_surface_set_matrix (cairo_image_surface_t *surface,
|
|||
return CAIRO_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static cairo_status_t
|
||||
_cairo_image_abstract_surface_set_filter (void *abstract_surface, cairo_filter_t filter)
|
||||
{
|
||||
cairo_image_surface_t *surface = abstract_surface;
|
||||
|
||||
return _cairo_image_surface_set_filter (surface, filter);
|
||||
}
|
||||
|
||||
cairo_status_t
|
||||
_cairo_image_surface_set_filter (cairo_image_surface_t *surface, cairo_filter_t filter)
|
||||
{
|
||||
|
|
@ -394,13 +378,6 @@ _cairo_image_surface_set_filter (cairo_image_surface_t *surface, cairo_filter_t
|
|||
return CAIRO_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static cairo_status_t
|
||||
_cairo_image_abstract_surface_set_repeat (void *abstract_surface, int repeat)
|
||||
{
|
||||
cairo_image_surface_t *surface = abstract_surface;
|
||||
return _cairo_image_surface_set_repeat (surface, repeat);
|
||||
}
|
||||
|
||||
cairo_status_t
|
||||
_cairo_image_surface_set_repeat (cairo_image_surface_t *surface, int repeat)
|
||||
{
|
||||
|
|
@ -678,9 +655,6 @@ static const cairo_surface_backend_t cairo_image_surface_backend = {
|
|||
_cairo_image_surface_acquire_dest_image,
|
||||
_cairo_image_surface_release_dest_image,
|
||||
_cairo_image_surface_clone_similar,
|
||||
_cairo_image_abstract_surface_set_matrix,
|
||||
_cairo_image_abstract_surface_set_filter,
|
||||
_cairo_image_abstract_surface_set_repeat,
|
||||
_cairo_image_surface_composite,
|
||||
_cairo_image_surface_fill_rectangles,
|
||||
_cairo_image_surface_composite_trapezoids,
|
||||
|
|
|
|||
|
|
@ -1138,27 +1138,6 @@ _cairo_pdf_surface_clone_similar (void *abstract_surface,
|
|||
return CAIRO_INT_STATUS_UNSUPPORTED;
|
||||
}
|
||||
|
||||
static cairo_status_t
|
||||
_cairo_pdf_surface_set_matrix (void *abstract_surface,
|
||||
cairo_matrix_t *matrix)
|
||||
{
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static cairo_status_t
|
||||
_cairo_pdf_surface_set_filter (void *abstract_surface,
|
||||
cairo_filter_t filter)
|
||||
{
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static cairo_status_t
|
||||
_cairo_pdf_surface_set_repeat (void *abstract_surface,
|
||||
int repeat)
|
||||
{
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static void *
|
||||
compress_dup (const void *data, unsigned long data_size,
|
||||
unsigned long *compressed_size)
|
||||
|
|
@ -1818,9 +1797,6 @@ static const cairo_surface_backend_t cairo_pdf_surface_backend = {
|
|||
_cairo_pdf_surface_acquire_dest_image,
|
||||
_cairo_pdf_surface_release_dest_image,
|
||||
_cairo_pdf_surface_clone_similar,
|
||||
_cairo_pdf_surface_set_matrix,
|
||||
_cairo_pdf_surface_set_filter,
|
||||
_cairo_pdf_surface_set_repeat,
|
||||
_cairo_pdf_surface_composite,
|
||||
_cairo_pdf_surface_fill_rectangles,
|
||||
_cairo_pdf_surface_composite_trapezoids,
|
||||
|
|
|
|||
|
|
@ -263,33 +263,6 @@ _cairo_ps_surface_clone_similar (void *abstract_surface,
|
|||
return CAIRO_INT_STATUS_UNSUPPORTED;
|
||||
}
|
||||
|
||||
static cairo_status_t
|
||||
_cairo_ps_surface_set_matrix (void *abstract_surface,
|
||||
cairo_matrix_t *matrix)
|
||||
{
|
||||
cairo_ps_surface_t *surface = abstract_surface;
|
||||
|
||||
return _cairo_image_surface_set_matrix (surface->image, matrix);
|
||||
}
|
||||
|
||||
static cairo_status_t
|
||||
_cairo_ps_surface_set_filter (void *abstract_surface,
|
||||
cairo_filter_t filter)
|
||||
{
|
||||
cairo_ps_surface_t *surface = abstract_surface;
|
||||
|
||||
return _cairo_image_surface_set_filter (surface->image, filter);
|
||||
}
|
||||
|
||||
static cairo_status_t
|
||||
_cairo_ps_surface_set_repeat (void *abstract_surface,
|
||||
int repeat)
|
||||
{
|
||||
cairo_ps_surface_t *surface = abstract_surface;
|
||||
|
||||
return _cairo_image_surface_set_repeat (surface->image, repeat);
|
||||
}
|
||||
|
||||
static cairo_int_status_t
|
||||
_cairo_ps_surface_composite (cairo_operator_t operator,
|
||||
cairo_pattern_t *src,
|
||||
|
|
@ -460,9 +433,6 @@ static const cairo_surface_backend_t cairo_ps_surface_backend = {
|
|||
_cairo_ps_surface_acquire_dest_image,
|
||||
_cairo_ps_surface_release_dest_image,
|
||||
_cairo_ps_surface_clone_similar,
|
||||
_cairo_ps_surface_set_matrix,
|
||||
_cairo_ps_surface_set_filter,
|
||||
_cairo_ps_surface_set_repeat,
|
||||
_cairo_ps_surface_composite,
|
||||
_cairo_ps_surface_fill_rectangles,
|
||||
_cairo_ps_surface_composite_trapezoids,
|
||||
|
|
|
|||
|
|
@ -304,9 +304,7 @@ cairo_surface_set_matrix (cairo_surface_t *surface, cairo_matrix_t *matrix)
|
|||
if (surface == NULL)
|
||||
return CAIRO_STATUS_NULL_POINTER;
|
||||
|
||||
cairo_matrix_copy (&surface->matrix, matrix);
|
||||
|
||||
return surface->backend->set_matrix (surface, matrix);
|
||||
return cairo_matrix_copy (&surface->matrix, matrix);
|
||||
}
|
||||
slim_hidden_def(cairo_surface_set_matrix);
|
||||
|
||||
|
|
@ -327,7 +325,7 @@ cairo_surface_set_filter (cairo_surface_t *surface, cairo_filter_t filter)
|
|||
return CAIRO_STATUS_NULL_POINTER;
|
||||
|
||||
surface->filter = filter;
|
||||
return surface->backend->set_filter (surface, filter);
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
cairo_filter_t
|
||||
|
|
@ -359,7 +357,7 @@ cairo_surface_set_repeat (cairo_surface_t *surface, int repeat)
|
|||
|
||||
surface->repeat = repeat;
|
||||
|
||||
return surface->backend->set_repeat (surface, repeat);
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
}
|
||||
slim_hidden_def(cairo_surface_set_repeat);
|
||||
|
||||
|
|
|
|||
|
|
@ -442,10 +442,6 @@ _cairo_xlib_surface_clone_similar (void *abstract_surface,
|
|||
|
||||
_draw_image_surface (clone, image_src, 0, 0);
|
||||
|
||||
cairo_surface_set_filter (&clone->base, src->filter);
|
||||
cairo_surface_set_matrix (&clone->base, &src->matrix);
|
||||
cairo_surface_set_repeat (&clone->base, src->repeat);
|
||||
|
||||
*clone_out = &clone->base;
|
||||
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
|
|
@ -455,14 +451,14 @@ _cairo_xlib_surface_clone_similar (void *abstract_surface,
|
|||
}
|
||||
|
||||
static cairo_status_t
|
||||
_cairo_xlib_surface_set_matrix (void *abstract_surface, cairo_matrix_t *matrix)
|
||||
_cairo_xlib_surface_set_matrix (cairo_xlib_surface_t *surface,
|
||||
cairo_matrix_t *matrix)
|
||||
{
|
||||
cairo_xlib_surface_t *surface = abstract_surface;
|
||||
XTransform xtransform;
|
||||
|
||||
if (!surface->picture)
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
|
||||
|
||||
xtransform.matrix[0][0] = _cairo_fixed_from_double (matrix->m[0][0]);
|
||||
xtransform.matrix[0][1] = _cairo_fixed_from_double (matrix->m[1][0]);
|
||||
xtransform.matrix[0][2] = _cairo_fixed_from_double (matrix->m[2][0]);
|
||||
|
|
@ -475,26 +471,41 @@ _cairo_xlib_surface_set_matrix (void *abstract_surface, cairo_matrix_t *matrix)
|
|||
xtransform.matrix[2][1] = 0;
|
||||
xtransform.matrix[2][2] = _cairo_fixed_from_double (1);
|
||||
|
||||
if (CAIRO_SURFACE_RENDER_HAS_PICTURE_TRANSFORM (surface))
|
||||
if (!CAIRO_SURFACE_RENDER_HAS_PICTURE_TRANSFORM (surface))
|
||||
{
|
||||
XRenderSetPictureTransform (surface->dpy, surface->picture, &xtransform);
|
||||
} else {
|
||||
/* XXX: Need support here if using an old RENDER without support
|
||||
for SetPictureTransform */
|
||||
static const XTransform identity = { {
|
||||
{ 1 << 16, 0x00000, 0x00000 },
|
||||
{ 0x00000, 1 << 16, 0x00000 },
|
||||
{ 0x00000, 0x00000, 1 << 16 },
|
||||
} };
|
||||
|
||||
if (memcmp (&xtransform, &identity, sizeof (XTransform)) == 0)
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
|
||||
return CAIRO_INT_STATUS_UNSUPPORTED;
|
||||
}
|
||||
|
||||
XRenderSetPictureTransform (surface->dpy, surface->picture, &xtransform);
|
||||
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static cairo_status_t
|
||||
_cairo_xlib_surface_set_filter (void *abstract_surface, cairo_filter_t filter)
|
||||
_cairo_xlib_surface_set_filter (cairo_xlib_surface_t *surface,
|
||||
cairo_filter_t filter)
|
||||
{
|
||||
cairo_xlib_surface_t *surface = abstract_surface;
|
||||
char *render_filter;
|
||||
|
||||
if (!(surface->picture
|
||||
&& CAIRO_SURFACE_RENDER_HAS_FILTERS(surface)))
|
||||
if (!surface->picture)
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
|
||||
if (!CAIRO_SURFACE_RENDER_HAS_FILTERS (surface))
|
||||
{
|
||||
if (filter == CAIRO_FILTER_FAST || filter == CAIRO_FILTER_NEAREST)
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
|
||||
return CAIRO_INT_STATUS_UNSUPPORTED;
|
||||
}
|
||||
|
||||
switch (filter) {
|
||||
case CAIRO_FILTER_FAST:
|
||||
|
|
@ -524,11 +535,10 @@ _cairo_xlib_surface_set_filter (void *abstract_surface, cairo_filter_t filter)
|
|||
}
|
||||
|
||||
static cairo_status_t
|
||||
_cairo_xlib_surface_set_repeat (void *abstract_surface, int repeat)
|
||||
_cairo_xlib_surface_set_repeat (cairo_xlib_surface_t *surface, int repeat)
|
||||
{
|
||||
cairo_xlib_surface_t *surface = abstract_surface;
|
||||
unsigned long mask;
|
||||
XRenderPictureAttributes pa;
|
||||
unsigned long mask;
|
||||
|
||||
if (!surface->picture)
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
|
|
@ -857,9 +867,6 @@ static const cairo_surface_backend_t cairo_xlib_surface_backend = {
|
|||
_cairo_xlib_surface_acquire_dest_image,
|
||||
_cairo_xlib_surface_release_dest_image,
|
||||
_cairo_xlib_surface_clone_similar,
|
||||
_cairo_xlib_surface_set_matrix,
|
||||
_cairo_xlib_surface_set_filter,
|
||||
_cairo_xlib_surface_set_repeat,
|
||||
_cairo_xlib_surface_composite,
|
||||
_cairo_xlib_surface_fill_rectangles,
|
||||
_cairo_xlib_surface_composite_trapezoids,
|
||||
|
|
|
|||
|
|
@ -396,11 +396,10 @@ _cairo_glitz_surface_clone_similar (void *abstract_surface,
|
|||
return CAIRO_INT_STATUS_UNSUPPORTED;
|
||||
}
|
||||
|
||||
static cairo_status_t
|
||||
_cairo_glitz_surface_set_matrix (void *abstract_surface,
|
||||
cairo_matrix_t *matrix)
|
||||
static void
|
||||
_cairo_glitz_surface_set_matrix (cairo_glitz_surface_t *surface,
|
||||
cairo_matrix_t *matrix)
|
||||
{
|
||||
cairo_glitz_surface_t *surface = abstract_surface;
|
||||
glitz_transform_t transform;
|
||||
|
||||
transform.matrix[0][0] = _cairo_fixed_from_double (matrix->m[0][0]);
|
||||
|
|
@ -416,20 +415,6 @@ _cairo_glitz_surface_set_matrix (void *abstract_surface,
|
|||
transform.matrix[2][2] = 1 << 16;
|
||||
|
||||
glitz_surface_set_transform (surface->surface, &transform);
|
||||
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static cairo_status_t
|
||||
_cairo_glitz_surface_set_filter (void *abstract_surface, cairo_filter_t filter)
|
||||
{
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static cairo_status_t
|
||||
_cairo_glitz_surface_set_repeat (void *abstract_surface, int repeat)
|
||||
{
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static glitz_operator_t
|
||||
|
|
@ -1128,9 +1113,6 @@ static const cairo_surface_backend_t cairo_glitz_surface_backend = {
|
|||
_cairo_glitz_surface_acquire_dest_image,
|
||||
_cairo_glitz_surface_release_dest_image,
|
||||
_cairo_glitz_surface_clone_similar,
|
||||
_cairo_glitz_surface_set_matrix,
|
||||
_cairo_glitz_surface_set_filter,
|
||||
_cairo_glitz_surface_set_repeat,
|
||||
_cairo_glitz_surface_composite,
|
||||
_cairo_glitz_surface_fill_rectangles,
|
||||
_cairo_glitz_surface_composite_trapezoids,
|
||||
|
|
|
|||
|
|
@ -325,14 +325,6 @@ _cairo_image_surface_clone_similar (void *abstract_surface,
|
|||
return CAIRO_INT_STATUS_UNSUPPORTED;
|
||||
}
|
||||
|
||||
static cairo_status_t
|
||||
_cairo_image_abstract_surface_set_matrix (void *abstract_surface,
|
||||
cairo_matrix_t *matrix)
|
||||
{
|
||||
cairo_image_surface_t *surface = abstract_surface;
|
||||
return _cairo_image_surface_set_matrix (surface, matrix);
|
||||
}
|
||||
|
||||
cairo_status_t
|
||||
_cairo_image_surface_set_matrix (cairo_image_surface_t *surface,
|
||||
cairo_matrix_t *matrix)
|
||||
|
|
@ -356,14 +348,6 @@ _cairo_image_surface_set_matrix (cairo_image_surface_t *surface,
|
|||
return CAIRO_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static cairo_status_t
|
||||
_cairo_image_abstract_surface_set_filter (void *abstract_surface, cairo_filter_t filter)
|
||||
{
|
||||
cairo_image_surface_t *surface = abstract_surface;
|
||||
|
||||
return _cairo_image_surface_set_filter (surface, filter);
|
||||
}
|
||||
|
||||
cairo_status_t
|
||||
_cairo_image_surface_set_filter (cairo_image_surface_t *surface, cairo_filter_t filter)
|
||||
{
|
||||
|
|
@ -394,13 +378,6 @@ _cairo_image_surface_set_filter (cairo_image_surface_t *surface, cairo_filter_t
|
|||
return CAIRO_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static cairo_status_t
|
||||
_cairo_image_abstract_surface_set_repeat (void *abstract_surface, int repeat)
|
||||
{
|
||||
cairo_image_surface_t *surface = abstract_surface;
|
||||
return _cairo_image_surface_set_repeat (surface, repeat);
|
||||
}
|
||||
|
||||
cairo_status_t
|
||||
_cairo_image_surface_set_repeat (cairo_image_surface_t *surface, int repeat)
|
||||
{
|
||||
|
|
@ -678,9 +655,6 @@ static const cairo_surface_backend_t cairo_image_surface_backend = {
|
|||
_cairo_image_surface_acquire_dest_image,
|
||||
_cairo_image_surface_release_dest_image,
|
||||
_cairo_image_surface_clone_similar,
|
||||
_cairo_image_abstract_surface_set_matrix,
|
||||
_cairo_image_abstract_surface_set_filter,
|
||||
_cairo_image_abstract_surface_set_repeat,
|
||||
_cairo_image_surface_composite,
|
||||
_cairo_image_surface_fill_rectangles,
|
||||
_cairo_image_surface_composite_trapezoids,
|
||||
|
|
|
|||
|
|
@ -1138,27 +1138,6 @@ _cairo_pdf_surface_clone_similar (void *abstract_surface,
|
|||
return CAIRO_INT_STATUS_UNSUPPORTED;
|
||||
}
|
||||
|
||||
static cairo_status_t
|
||||
_cairo_pdf_surface_set_matrix (void *abstract_surface,
|
||||
cairo_matrix_t *matrix)
|
||||
{
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static cairo_status_t
|
||||
_cairo_pdf_surface_set_filter (void *abstract_surface,
|
||||
cairo_filter_t filter)
|
||||
{
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static cairo_status_t
|
||||
_cairo_pdf_surface_set_repeat (void *abstract_surface,
|
||||
int repeat)
|
||||
{
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static void *
|
||||
compress_dup (const void *data, unsigned long data_size,
|
||||
unsigned long *compressed_size)
|
||||
|
|
@ -1818,9 +1797,6 @@ static const cairo_surface_backend_t cairo_pdf_surface_backend = {
|
|||
_cairo_pdf_surface_acquire_dest_image,
|
||||
_cairo_pdf_surface_release_dest_image,
|
||||
_cairo_pdf_surface_clone_similar,
|
||||
_cairo_pdf_surface_set_matrix,
|
||||
_cairo_pdf_surface_set_filter,
|
||||
_cairo_pdf_surface_set_repeat,
|
||||
_cairo_pdf_surface_composite,
|
||||
_cairo_pdf_surface_fill_rectangles,
|
||||
_cairo_pdf_surface_composite_trapezoids,
|
||||
|
|
|
|||
|
|
@ -240,33 +240,6 @@ _cairo_png_surface_clone_similar (void *abstract_surface,
|
|||
return CAIRO_INT_STATUS_UNSUPPORTED;
|
||||
}
|
||||
|
||||
static cairo_status_t
|
||||
_cairo_png_surface_set_matrix (void *abstract_surface,
|
||||
cairo_matrix_t *matrix)
|
||||
{
|
||||
cairo_png_surface_t *surface = abstract_surface;
|
||||
|
||||
return _cairo_image_surface_set_matrix (surface->image, matrix);
|
||||
}
|
||||
|
||||
static cairo_status_t
|
||||
_cairo_png_surface_set_filter (void *abstract_surface,
|
||||
cairo_filter_t filter)
|
||||
{
|
||||
cairo_png_surface_t *surface = abstract_surface;
|
||||
|
||||
return _cairo_image_surface_set_filter (surface->image, filter);
|
||||
}
|
||||
|
||||
static cairo_status_t
|
||||
_cairo_png_surface_set_repeat (void *abstract_surface,
|
||||
int repeat)
|
||||
{
|
||||
cairo_png_surface_t *surface = abstract_surface;
|
||||
|
||||
return _cairo_image_surface_set_repeat (surface->image, repeat);
|
||||
}
|
||||
|
||||
static cairo_int_status_t
|
||||
_cairo_png_surface_composite (cairo_operator_t operator,
|
||||
cairo_pattern_t *pattern,
|
||||
|
|
@ -442,9 +415,6 @@ static const cairo_surface_backend_t cairo_png_surface_backend = {
|
|||
_cairo_png_surface_acquire_dest_image,
|
||||
_cairo_png_surface_release_dest_image,
|
||||
_cairo_png_surface_clone_similar,
|
||||
_cairo_png_surface_set_matrix,
|
||||
_cairo_png_surface_set_filter,
|
||||
_cairo_png_surface_set_repeat,
|
||||
_cairo_png_surface_composite,
|
||||
_cairo_png_surface_fill_rectangles,
|
||||
_cairo_png_surface_composite_trapezoids,
|
||||
|
|
|
|||
|
|
@ -263,33 +263,6 @@ _cairo_ps_surface_clone_similar (void *abstract_surface,
|
|||
return CAIRO_INT_STATUS_UNSUPPORTED;
|
||||
}
|
||||
|
||||
static cairo_status_t
|
||||
_cairo_ps_surface_set_matrix (void *abstract_surface,
|
||||
cairo_matrix_t *matrix)
|
||||
{
|
||||
cairo_ps_surface_t *surface = abstract_surface;
|
||||
|
||||
return _cairo_image_surface_set_matrix (surface->image, matrix);
|
||||
}
|
||||
|
||||
static cairo_status_t
|
||||
_cairo_ps_surface_set_filter (void *abstract_surface,
|
||||
cairo_filter_t filter)
|
||||
{
|
||||
cairo_ps_surface_t *surface = abstract_surface;
|
||||
|
||||
return _cairo_image_surface_set_filter (surface->image, filter);
|
||||
}
|
||||
|
||||
static cairo_status_t
|
||||
_cairo_ps_surface_set_repeat (void *abstract_surface,
|
||||
int repeat)
|
||||
{
|
||||
cairo_ps_surface_t *surface = abstract_surface;
|
||||
|
||||
return _cairo_image_surface_set_repeat (surface->image, repeat);
|
||||
}
|
||||
|
||||
static cairo_int_status_t
|
||||
_cairo_ps_surface_composite (cairo_operator_t operator,
|
||||
cairo_pattern_t *src,
|
||||
|
|
@ -460,9 +433,6 @@ static const cairo_surface_backend_t cairo_ps_surface_backend = {
|
|||
_cairo_ps_surface_acquire_dest_image,
|
||||
_cairo_ps_surface_release_dest_image,
|
||||
_cairo_ps_surface_clone_similar,
|
||||
_cairo_ps_surface_set_matrix,
|
||||
_cairo_ps_surface_set_filter,
|
||||
_cairo_ps_surface_set_repeat,
|
||||
_cairo_ps_surface_composite,
|
||||
_cairo_ps_surface_fill_rectangles,
|
||||
_cairo_ps_surface_composite_trapezoids,
|
||||
|
|
|
|||
|
|
@ -304,9 +304,7 @@ cairo_surface_set_matrix (cairo_surface_t *surface, cairo_matrix_t *matrix)
|
|||
if (surface == NULL)
|
||||
return CAIRO_STATUS_NULL_POINTER;
|
||||
|
||||
cairo_matrix_copy (&surface->matrix, matrix);
|
||||
|
||||
return surface->backend->set_matrix (surface, matrix);
|
||||
return cairo_matrix_copy (&surface->matrix, matrix);
|
||||
}
|
||||
slim_hidden_def(cairo_surface_set_matrix);
|
||||
|
||||
|
|
@ -327,7 +325,7 @@ cairo_surface_set_filter (cairo_surface_t *surface, cairo_filter_t filter)
|
|||
return CAIRO_STATUS_NULL_POINTER;
|
||||
|
||||
surface->filter = filter;
|
||||
return surface->backend->set_filter (surface, filter);
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
cairo_filter_t
|
||||
|
|
@ -359,7 +357,7 @@ cairo_surface_set_repeat (cairo_surface_t *surface, int repeat)
|
|||
|
||||
surface->repeat = repeat;
|
||||
|
||||
return surface->backend->set_repeat (surface, repeat);
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
}
|
||||
slim_hidden_def(cairo_surface_set_repeat);
|
||||
|
||||
|
|
|
|||
|
|
@ -442,10 +442,6 @@ _cairo_xlib_surface_clone_similar (void *abstract_surface,
|
|||
|
||||
_draw_image_surface (clone, image_src, 0, 0);
|
||||
|
||||
cairo_surface_set_filter (&clone->base, src->filter);
|
||||
cairo_surface_set_matrix (&clone->base, &src->matrix);
|
||||
cairo_surface_set_repeat (&clone->base, src->repeat);
|
||||
|
||||
*clone_out = &clone->base;
|
||||
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
|
|
@ -455,14 +451,14 @@ _cairo_xlib_surface_clone_similar (void *abstract_surface,
|
|||
}
|
||||
|
||||
static cairo_status_t
|
||||
_cairo_xlib_surface_set_matrix (void *abstract_surface, cairo_matrix_t *matrix)
|
||||
_cairo_xlib_surface_set_matrix (cairo_xlib_surface_t *surface,
|
||||
cairo_matrix_t *matrix)
|
||||
{
|
||||
cairo_xlib_surface_t *surface = abstract_surface;
|
||||
XTransform xtransform;
|
||||
|
||||
if (!surface->picture)
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
|
||||
|
||||
xtransform.matrix[0][0] = _cairo_fixed_from_double (matrix->m[0][0]);
|
||||
xtransform.matrix[0][1] = _cairo_fixed_from_double (matrix->m[1][0]);
|
||||
xtransform.matrix[0][2] = _cairo_fixed_from_double (matrix->m[2][0]);
|
||||
|
|
@ -475,26 +471,41 @@ _cairo_xlib_surface_set_matrix (void *abstract_surface, cairo_matrix_t *matrix)
|
|||
xtransform.matrix[2][1] = 0;
|
||||
xtransform.matrix[2][2] = _cairo_fixed_from_double (1);
|
||||
|
||||
if (CAIRO_SURFACE_RENDER_HAS_PICTURE_TRANSFORM (surface))
|
||||
if (!CAIRO_SURFACE_RENDER_HAS_PICTURE_TRANSFORM (surface))
|
||||
{
|
||||
XRenderSetPictureTransform (surface->dpy, surface->picture, &xtransform);
|
||||
} else {
|
||||
/* XXX: Need support here if using an old RENDER without support
|
||||
for SetPictureTransform */
|
||||
static const XTransform identity = { {
|
||||
{ 1 << 16, 0x00000, 0x00000 },
|
||||
{ 0x00000, 1 << 16, 0x00000 },
|
||||
{ 0x00000, 0x00000, 1 << 16 },
|
||||
} };
|
||||
|
||||
if (memcmp (&xtransform, &identity, sizeof (XTransform)) == 0)
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
|
||||
return CAIRO_INT_STATUS_UNSUPPORTED;
|
||||
}
|
||||
|
||||
XRenderSetPictureTransform (surface->dpy, surface->picture, &xtransform);
|
||||
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static cairo_status_t
|
||||
_cairo_xlib_surface_set_filter (void *abstract_surface, cairo_filter_t filter)
|
||||
_cairo_xlib_surface_set_filter (cairo_xlib_surface_t *surface,
|
||||
cairo_filter_t filter)
|
||||
{
|
||||
cairo_xlib_surface_t *surface = abstract_surface;
|
||||
char *render_filter;
|
||||
|
||||
if (!(surface->picture
|
||||
&& CAIRO_SURFACE_RENDER_HAS_FILTERS(surface)))
|
||||
if (!surface->picture)
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
|
||||
if (!CAIRO_SURFACE_RENDER_HAS_FILTERS (surface))
|
||||
{
|
||||
if (filter == CAIRO_FILTER_FAST || filter == CAIRO_FILTER_NEAREST)
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
|
||||
return CAIRO_INT_STATUS_UNSUPPORTED;
|
||||
}
|
||||
|
||||
switch (filter) {
|
||||
case CAIRO_FILTER_FAST:
|
||||
|
|
@ -524,11 +535,10 @@ _cairo_xlib_surface_set_filter (void *abstract_surface, cairo_filter_t filter)
|
|||
}
|
||||
|
||||
static cairo_status_t
|
||||
_cairo_xlib_surface_set_repeat (void *abstract_surface, int repeat)
|
||||
_cairo_xlib_surface_set_repeat (cairo_xlib_surface_t *surface, int repeat)
|
||||
{
|
||||
cairo_xlib_surface_t *surface = abstract_surface;
|
||||
unsigned long mask;
|
||||
XRenderPictureAttributes pa;
|
||||
unsigned long mask;
|
||||
|
||||
if (!surface->picture)
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
|
|
@ -857,9 +867,6 @@ static const cairo_surface_backend_t cairo_xlib_surface_backend = {
|
|||
_cairo_xlib_surface_acquire_dest_image,
|
||||
_cairo_xlib_surface_release_dest_image,
|
||||
_cairo_xlib_surface_clone_similar,
|
||||
_cairo_xlib_surface_set_matrix,
|
||||
_cairo_xlib_surface_set_filter,
|
||||
_cairo_xlib_surface_set_repeat,
|
||||
_cairo_xlib_surface_composite,
|
||||
_cairo_xlib_surface_fill_rectangles,
|
||||
_cairo_xlib_surface_composite_trapezoids,
|
||||
|
|
|
|||
|
|
@ -585,18 +585,6 @@ typedef struct _cairo_surface_backend {
|
|||
cairo_surface_t *src,
|
||||
cairo_surface_t **clone_out);
|
||||
|
||||
cairo_status_t
|
||||
(*set_matrix) (void *surface,
|
||||
cairo_matrix_t *matrix);
|
||||
|
||||
cairo_status_t
|
||||
(*set_filter) (void *surface,
|
||||
cairo_filter_t filter);
|
||||
|
||||
cairo_status_t
|
||||
(*set_repeat) (void *surface,
|
||||
int repeat);
|
||||
|
||||
/* XXX: dst should be the first argument for consistency */
|
||||
cairo_int_status_t
|
||||
(*composite) (cairo_operator_t operator,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue