mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2025-12-24 20:40:10 +01:00
composite: Pass unbounded extents to initialisation
For an unbounded surface we cannot assume (0, 0, surface_width, surface_height) as that is wrong and causes the operation to appear clipped. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
parent
a69335a84e
commit
91faf9c1cf
10 changed files with 123 additions and 136 deletions
|
|
@ -62,22 +62,22 @@ struct _cairo_composite_rectangles {
|
|||
|
||||
cairo_private cairo_int_status_t
|
||||
_cairo_composite_rectangles_init_for_paint (cairo_composite_rectangles_t *extents,
|
||||
int surface_width, int surface_height,
|
||||
cairo_operator_t op,
|
||||
const cairo_pattern_t *source,
|
||||
const cairo_clip_t *clip);
|
||||
const cairo_rectangle_int_t *unbounded,
|
||||
cairo_operator_t op,
|
||||
const cairo_pattern_t *source,
|
||||
const cairo_clip_t *clip);
|
||||
|
||||
cairo_private cairo_int_status_t
|
||||
_cairo_composite_rectangles_init_for_mask (cairo_composite_rectangles_t *extents,
|
||||
int surface_width, int surface_height,
|
||||
cairo_operator_t op,
|
||||
const cairo_pattern_t *source,
|
||||
const cairo_pattern_t *mask,
|
||||
const cairo_clip_t *clip);
|
||||
const cairo_rectangle_int_t *unbounded,
|
||||
cairo_operator_t op,
|
||||
const cairo_pattern_t *source,
|
||||
const cairo_pattern_t *mask,
|
||||
const cairo_clip_t *clip);
|
||||
|
||||
cairo_private cairo_int_status_t
|
||||
_cairo_composite_rectangles_init_for_stroke (cairo_composite_rectangles_t *extents,
|
||||
int surface_width, int surface_height,
|
||||
const cairo_rectangle_int_t *unbounded,
|
||||
cairo_operator_t op,
|
||||
const cairo_pattern_t *source,
|
||||
const cairo_path_fixed_t *path,
|
||||
|
|
@ -87,7 +87,7 @@ _cairo_composite_rectangles_init_for_stroke (cairo_composite_rectangles_t *exten
|
|||
|
||||
cairo_private cairo_int_status_t
|
||||
_cairo_composite_rectangles_init_for_fill (cairo_composite_rectangles_t *extents,
|
||||
int surface_width, int surface_height,
|
||||
const cairo_rectangle_int_t *unbounded,
|
||||
cairo_operator_t op,
|
||||
const cairo_pattern_t *source,
|
||||
const cairo_path_fixed_t *path,
|
||||
|
|
@ -95,7 +95,7 @@ _cairo_composite_rectangles_init_for_fill (cairo_composite_rectangles_t *extents
|
|||
|
||||
cairo_private cairo_int_status_t
|
||||
_cairo_composite_rectangles_init_for_glyphs (cairo_composite_rectangles_t *extents,
|
||||
int surface_width, int surface_height,
|
||||
const cairo_rectangle_int_t *unbounded,
|
||||
cairo_operator_t op,
|
||||
const cairo_pattern_t *source,
|
||||
cairo_scaled_font_t *scaled_font,
|
||||
|
|
|
|||
|
|
@ -48,19 +48,17 @@ void _cairo_composite_rectangles_fini (cairo_composite_rectangles_t *extents)
|
|||
|
||||
static inline cairo_bool_t
|
||||
_cairo_composite_rectangles_init (cairo_composite_rectangles_t *extents,
|
||||
int width, int height,
|
||||
const cairo_rectangle_int_t *unbounded,
|
||||
cairo_operator_t op,
|
||||
const cairo_pattern_t *source,
|
||||
const cairo_clip_t *clip)
|
||||
{
|
||||
extents->unbounded.x = extents->unbounded.y = 0;
|
||||
extents->unbounded.width = width;
|
||||
extents->unbounded.height = height;
|
||||
extents->clip = NULL;
|
||||
|
||||
if (_cairo_clip_is_all_clipped (clip))
|
||||
return FALSE;
|
||||
|
||||
extents->unbounded = *unbounded;
|
||||
if (clip != NULL) {
|
||||
if (! _cairo_rectangle_intersect (&extents->unbounded,
|
||||
_cairo_clip_get_extents (clip)))
|
||||
|
|
@ -81,13 +79,12 @@ _cairo_composite_rectangles_init (cairo_composite_rectangles_t *extents,
|
|||
|
||||
cairo_int_status_t
|
||||
_cairo_composite_rectangles_init_for_paint (cairo_composite_rectangles_t *extents,
|
||||
int surface_width, int surface_height,
|
||||
const cairo_rectangle_int_t *unbounded,
|
||||
cairo_operator_t op,
|
||||
const cairo_pattern_t *source,
|
||||
const cairo_clip_t *clip)
|
||||
{
|
||||
if (! _cairo_composite_rectangles_init (extents,
|
||||
surface_width, surface_height,
|
||||
if (! _cairo_composite_rectangles_init (extents, unbounded,
|
||||
op, source, clip))
|
||||
{
|
||||
return CAIRO_INT_STATUS_NOTHING_TO_DO;
|
||||
|
|
@ -124,7 +121,7 @@ _cairo_composite_rectangles_intersect (cairo_composite_rectangles_t *extents,
|
|||
|
||||
cairo_int_status_t
|
||||
_cairo_composite_rectangles_intersect_mask_extents (cairo_composite_rectangles_t *extents,
|
||||
const cairo_box_t *box)
|
||||
const cairo_box_t *box)
|
||||
{
|
||||
cairo_rectangle_int_t mask;
|
||||
cairo_int_status_t status;
|
||||
|
|
@ -154,14 +151,13 @@ _cairo_composite_rectangles_intersect_mask_extents (cairo_composite_rectangles_t
|
|||
|
||||
cairo_int_status_t
|
||||
_cairo_composite_rectangles_init_for_mask (cairo_composite_rectangles_t *extents,
|
||||
int surface_width, int surface_height,
|
||||
const cairo_rectangle_int_t *unbounded,
|
||||
cairo_operator_t op,
|
||||
const cairo_pattern_t *source,
|
||||
const cairo_pattern_t *mask,
|
||||
const cairo_clip_t *clip)
|
||||
{
|
||||
if (! _cairo_composite_rectangles_init (extents,
|
||||
surface_width, surface_height,
|
||||
if (! _cairo_composite_rectangles_init (extents, unbounded,
|
||||
op, source, clip))
|
||||
{
|
||||
return CAIRO_INT_STATUS_NOTHING_TO_DO;
|
||||
|
|
@ -174,7 +170,7 @@ _cairo_composite_rectangles_init_for_mask (cairo_composite_rectangles_t *extents
|
|||
|
||||
cairo_int_status_t
|
||||
_cairo_composite_rectangles_init_for_stroke (cairo_composite_rectangles_t *extents,
|
||||
int surface_width, int surface_height,
|
||||
const cairo_rectangle_int_t *unbounded,
|
||||
cairo_operator_t op,
|
||||
const cairo_pattern_t *source,
|
||||
const cairo_path_fixed_t *path,
|
||||
|
|
@ -182,8 +178,7 @@ _cairo_composite_rectangles_init_for_stroke (cairo_composite_rectangles_t *exten
|
|||
const cairo_matrix_t *ctm,
|
||||
const cairo_clip_t *clip)
|
||||
{
|
||||
if (! _cairo_composite_rectangles_init (extents,
|
||||
surface_width, surface_height,
|
||||
if (! _cairo_composite_rectangles_init (extents, unbounded,
|
||||
op, source, clip))
|
||||
{
|
||||
return CAIRO_INT_STATUS_NOTHING_TO_DO;
|
||||
|
|
@ -196,14 +191,13 @@ _cairo_composite_rectangles_init_for_stroke (cairo_composite_rectangles_t *exten
|
|||
|
||||
cairo_int_status_t
|
||||
_cairo_composite_rectangles_init_for_fill (cairo_composite_rectangles_t *extents,
|
||||
int surface_width, int surface_height,
|
||||
const cairo_rectangle_int_t *unbounded,
|
||||
cairo_operator_t op,
|
||||
const cairo_pattern_t *source,
|
||||
const cairo_path_fixed_t *path,
|
||||
const cairo_clip_t *clip)
|
||||
{
|
||||
if (! _cairo_composite_rectangles_init (extents,
|
||||
surface_width, surface_height,
|
||||
if (! _cairo_composite_rectangles_init (extents, unbounded,
|
||||
op, source, clip))
|
||||
{
|
||||
return CAIRO_INT_STATUS_NOTHING_TO_DO;
|
||||
|
|
@ -216,7 +210,7 @@ _cairo_composite_rectangles_init_for_fill (cairo_composite_rectangles_t *extents
|
|||
|
||||
cairo_int_status_t
|
||||
_cairo_composite_rectangles_init_for_glyphs (cairo_composite_rectangles_t *extents,
|
||||
int surface_width, int surface_height,
|
||||
const cairo_rectangle_int_t *unbounded,
|
||||
cairo_operator_t op,
|
||||
const cairo_pattern_t *source,
|
||||
cairo_scaled_font_t *scaled_font,
|
||||
|
|
@ -227,8 +221,7 @@ _cairo_composite_rectangles_init_for_glyphs (cairo_composite_rectangles_t *exten
|
|||
{
|
||||
cairo_status_t status;
|
||||
|
||||
if (! _cairo_composite_rectangles_init (extents,
|
||||
surface_width, surface_height,
|
||||
if (! _cairo_composite_rectangles_init (extents, unbounded,
|
||||
op, source, clip))
|
||||
{
|
||||
return CAIRO_INT_STATUS_NOTHING_TO_DO;
|
||||
|
|
|
|||
|
|
@ -3291,6 +3291,19 @@ _clip_and_composite_trapezoids (cairo_image_surface_t *dst,
|
|||
}
|
||||
|
||||
/* high level image interface */
|
||||
static cairo_bool_t
|
||||
_cairo_image_surface_get_extents (void *abstract_surface,
|
||||
cairo_rectangle_int_t *rectangle)
|
||||
{
|
||||
cairo_image_surface_t *surface = abstract_surface;
|
||||
|
||||
rectangle->x = 0;
|
||||
rectangle->y = 0;
|
||||
rectangle->width = surface->width;
|
||||
rectangle->height = surface->height;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static cairo_int_status_t
|
||||
_cairo_image_surface_paint (void *abstract_surface,
|
||||
|
|
@ -3299,13 +3312,13 @@ _cairo_image_surface_paint (void *abstract_surface,
|
|||
const cairo_clip_t *clip)
|
||||
{
|
||||
cairo_image_surface_t *surface = abstract_surface;
|
||||
cairo_rectangle_int_t unbounded;
|
||||
cairo_composite_rectangles_t extents;
|
||||
cairo_status_t status;
|
||||
cairo_boxes_t boxes;
|
||||
|
||||
status = _cairo_composite_rectangles_init_for_paint (&extents,
|
||||
surface->width,
|
||||
surface->height,
|
||||
_cairo_image_surface_get_extents (surface, &unbounded);
|
||||
status = _cairo_composite_rectangles_init_for_paint (&extents, &unbounded,
|
||||
op, source,
|
||||
clip);
|
||||
if (unlikely (status))
|
||||
|
|
@ -3537,10 +3550,11 @@ _cairo_image_surface_mask (void *abstract_surface,
|
|||
{
|
||||
cairo_image_surface_t *surface = abstract_surface;
|
||||
cairo_composite_rectangles_t extents;
|
||||
cairo_rectangle_int_t unbounded;
|
||||
cairo_status_t status;
|
||||
|
||||
status = _cairo_composite_rectangles_init_for_mask (&extents,
|
||||
surface->width, surface->height,
|
||||
_cairo_image_surface_get_extents (surface, &unbounded);
|
||||
status = _cairo_composite_rectangles_init_for_mask (&extents, &unbounded,
|
||||
op, source, mask, clip);
|
||||
if (unlikely (status))
|
||||
return status;
|
||||
|
|
@ -3770,11 +3784,11 @@ _cairo_image_surface_stroke (void *abstract_surface,
|
|||
{
|
||||
cairo_image_surface_t *surface = abstract_surface;
|
||||
cairo_composite_rectangles_t extents;
|
||||
cairo_rectangle_int_t unbounded;
|
||||
cairo_int_status_t status;
|
||||
|
||||
status = _cairo_composite_rectangles_init_for_stroke (&extents,
|
||||
surface->width,
|
||||
surface->height,
|
||||
_cairo_image_surface_get_extents (surface, &unbounded);
|
||||
status = _cairo_composite_rectangles_init_for_stroke (&extents, &unbounded,
|
||||
op, source,
|
||||
path, style, ctm,
|
||||
clip);
|
||||
|
|
@ -3833,11 +3847,11 @@ _cairo_image_surface_fill (void *abstract_surface,
|
|||
{
|
||||
cairo_image_surface_t *surface = abstract_surface;
|
||||
cairo_composite_rectangles_t extents;
|
||||
cairo_rectangle_int_t unbounded;
|
||||
cairo_status_t status;
|
||||
|
||||
status = _cairo_composite_rectangles_init_for_fill (&extents,
|
||||
surface->width,
|
||||
surface->height,
|
||||
_cairo_image_surface_get_extents (surface, &unbounded);
|
||||
status = _cairo_composite_rectangles_init_for_fill (&extents, &unbounded,
|
||||
op, source, path,
|
||||
clip);
|
||||
if (unlikely (status))
|
||||
|
|
@ -4131,14 +4145,14 @@ _cairo_image_surface_glyphs (void *abstract_surface,
|
|||
{
|
||||
cairo_image_surface_t *surface = abstract_surface;
|
||||
cairo_composite_rectangles_t extents;
|
||||
cairo_rectangle_int_t unbounded;
|
||||
composite_glyphs_info_t glyph_info;
|
||||
cairo_status_t status;
|
||||
cairo_bool_t overlap;
|
||||
unsigned int flags;
|
||||
|
||||
status = _cairo_composite_rectangles_init_for_glyphs (&extents,
|
||||
surface->width,
|
||||
surface->height,
|
||||
_cairo_image_surface_get_extents (surface, &unbounded);
|
||||
status = _cairo_composite_rectangles_init_for_glyphs (&extents, &unbounded,
|
||||
op, source,
|
||||
scaled_font,
|
||||
glyphs, num_glyphs,
|
||||
|
|
@ -4171,20 +4185,6 @@ _cairo_image_surface_glyphs (void *abstract_surface,
|
|||
return status;
|
||||
}
|
||||
|
||||
static cairo_bool_t
|
||||
_cairo_image_surface_get_extents (void *abstract_surface,
|
||||
cairo_rectangle_int_t *rectangle)
|
||||
{
|
||||
cairo_image_surface_t *surface = abstract_surface;
|
||||
|
||||
rectangle->x = 0;
|
||||
rectangle->y = 0;
|
||||
rectangle->width = surface->width;
|
||||
rectangle->height = surface->height;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
_cairo_image_surface_get_font_options (void *abstract_surface,
|
||||
cairo_font_options_t *options)
|
||||
|
|
|
|||
|
|
@ -127,6 +127,10 @@
|
|||
* PDF files and is a multi-page vector surface backend.
|
||||
*/
|
||||
|
||||
static cairo_bool_t
|
||||
_cairo_pdf_surface_get_extents (void *abstract_surface,
|
||||
cairo_rectangle_int_t *rectangle);
|
||||
|
||||
/**
|
||||
* CAIRO_HAS_PDF_SURFACE:
|
||||
*
|
||||
|
|
@ -5750,10 +5754,11 @@ _cairo_pdf_surface_paint (void *abstract_surface,
|
|||
cairo_pdf_smask_group_t *group;
|
||||
cairo_pdf_resource_t pattern_res, gstate_res;
|
||||
cairo_composite_rectangles_t extents;
|
||||
cairo_rectangle_int_t unbounded;
|
||||
cairo_int_status_t status;
|
||||
|
||||
status = _cairo_composite_rectangles_init_for_paint (&extents,
|
||||
surface->width, surface->height,
|
||||
_cairo_pdf_surface_get_extents (surface, &unbounded);
|
||||
status = _cairo_composite_rectangles_init_for_paint (&extents, &unbounded,
|
||||
op, source, clip);
|
||||
if (unlikely (status)) {
|
||||
if (status == CAIRO_INT_STATUS_NOTHING_TO_DO)
|
||||
|
|
@ -5866,10 +5871,11 @@ _cairo_pdf_surface_mask (void *abstract_surface,
|
|||
cairo_pdf_surface_t *surface = abstract_surface;
|
||||
cairo_pdf_smask_group_t *group;
|
||||
cairo_composite_rectangles_t extents;
|
||||
cairo_rectangle_int_t unbounded;
|
||||
cairo_int_status_t status;
|
||||
|
||||
status = _cairo_composite_rectangles_init_for_mask (&extents,
|
||||
surface->width, surface->height,
|
||||
_cairo_pdf_surface_get_extents (surface, &unbounded);
|
||||
status = _cairo_composite_rectangles_init_for_mask (&extents, &unbounded,
|
||||
op, source, mask, clip);
|
||||
if (unlikely (status)) {
|
||||
if (status == CAIRO_INT_STATUS_NOTHING_TO_DO)
|
||||
|
|
@ -5980,11 +5986,11 @@ _cairo_pdf_surface_stroke (void *abstract_surface,
|
|||
cairo_pdf_smask_group_t *group;
|
||||
cairo_pdf_resource_t pattern_res, gstate_res;
|
||||
cairo_composite_rectangles_t extents;
|
||||
cairo_rectangle_int_t unbounded;
|
||||
cairo_int_status_t status;
|
||||
|
||||
status = _cairo_composite_rectangles_init_for_stroke (&extents,
|
||||
surface->width,
|
||||
surface->height,
|
||||
_cairo_pdf_surface_get_extents (surface, &unbounded);
|
||||
status = _cairo_composite_rectangles_init_for_stroke (&extents, &unbounded,
|
||||
op, source,
|
||||
path, style, ctm,
|
||||
clip);
|
||||
|
|
@ -6110,10 +6116,10 @@ _cairo_pdf_surface_fill (void *abstract_surface,
|
|||
cairo_pdf_smask_group_t *group;
|
||||
cairo_pdf_resource_t pattern_res, gstate_res;
|
||||
cairo_composite_rectangles_t extents;
|
||||
cairo_rectangle_int_t unbounded;
|
||||
|
||||
status = _cairo_composite_rectangles_init_for_fill (&extents,
|
||||
surface->width,
|
||||
surface->height,
|
||||
_cairo_pdf_surface_get_extents (surface, &unbounded);
|
||||
status = _cairo_composite_rectangles_init_for_fill (&extents, &unbounded,
|
||||
op, source, path,
|
||||
clip);
|
||||
if (unlikely (status)) {
|
||||
|
|
@ -6267,6 +6273,7 @@ _cairo_pdf_surface_fill_stroke (void *abstract_surface,
|
|||
cairo_int_status_t status;
|
||||
cairo_pdf_resource_t fill_pattern_res, stroke_pattern_res, gstate_res;
|
||||
cairo_composite_rectangles_t extents;
|
||||
cairo_rectangle_int_t unbounded;
|
||||
|
||||
/* During analysis we return unsupported and let the _fill and
|
||||
* _stroke functions that are on the fallback path do the analysis
|
||||
|
|
@ -6298,9 +6305,8 @@ _cairo_pdf_surface_fill_stroke (void *abstract_surface,
|
|||
if (unlikely (status))
|
||||
return status;
|
||||
|
||||
status = _cairo_composite_rectangles_init_for_fill (&extents,
|
||||
surface->width,
|
||||
surface->height,
|
||||
_cairo_pdf_surface_get_extents (surface, &unbounded);
|
||||
status = _cairo_composite_rectangles_init_for_fill (&extents, &unbounded,
|
||||
fill_op, fill_source, path,
|
||||
clip);
|
||||
if (unlikely (status)) {
|
||||
|
|
@ -6329,9 +6335,7 @@ _cairo_pdf_surface_fill_stroke (void *abstract_surface,
|
|||
|
||||
assert (gstate_res.id == 0);
|
||||
|
||||
status = _cairo_composite_rectangles_init_for_stroke (&extents,
|
||||
surface->width,
|
||||
surface->height,
|
||||
status = _cairo_composite_rectangles_init_for_stroke (&extents, &unbounded,
|
||||
stroke_op, stroke_source,
|
||||
path, stroke_style, stroke_ctm,
|
||||
clip);
|
||||
|
|
@ -6416,12 +6420,12 @@ _cairo_pdf_surface_show_text_glyphs (void *abstract_surface,
|
|||
cairo_pdf_smask_group_t *group;
|
||||
cairo_pdf_resource_t pattern_res, gstate_res;
|
||||
cairo_composite_rectangles_t extents;
|
||||
cairo_rectangle_int_t unbounded;
|
||||
cairo_bool_t overlap;
|
||||
cairo_int_status_t status;
|
||||
|
||||
status = _cairo_composite_rectangles_init_for_glyphs (&extents,
|
||||
surface->width,
|
||||
surface->height,
|
||||
_cairo_pdf_surface_get_extents (surface, &unbounded);
|
||||
status = _cairo_composite_rectangles_init_for_glyphs (&extents, &unbounded,
|
||||
op, source,
|
||||
scaled_font,
|
||||
glyphs, num_glyphs,
|
||||
|
|
|
|||
|
|
@ -110,6 +110,10 @@
|
|||
static const cairo_surface_backend_t cairo_ps_surface_backend;
|
||||
static const cairo_paginated_surface_backend_t cairo_ps_surface_paginated_backend;
|
||||
|
||||
static cairo_bool_t
|
||||
_cairo_ps_surface_get_extents (void *abstract_surface,
|
||||
cairo_rectangle_int_t *rectangle);
|
||||
|
||||
static void
|
||||
_cairo_ps_surface_release_surface (cairo_ps_surface_t *surface,
|
||||
cairo_surface_pattern_t *pattern);
|
||||
|
|
@ -3556,15 +3560,16 @@ static cairo_int_status_t
|
|||
_cairo_ps_surface_paint (void *abstract_surface,
|
||||
cairo_operator_t op,
|
||||
const cairo_pattern_t *source,
|
||||
const cairo_clip_t *clip)
|
||||
const cairo_clip_t *clip)
|
||||
{
|
||||
cairo_ps_surface_t *surface = abstract_surface;
|
||||
cairo_output_stream_t *stream = surface->stream;
|
||||
cairo_composite_rectangles_t extents;
|
||||
cairo_rectangle_int_t unbounded;
|
||||
cairo_status_t status;
|
||||
|
||||
status = _cairo_composite_rectangles_init_for_paint (&extents,
|
||||
surface->width, surface->height,
|
||||
_cairo_ps_surface_get_extents (surface, &unbounded);
|
||||
status = _cairo_composite_rectangles_init_for_paint (&extents, &unbounded,
|
||||
op, source, clip);
|
||||
if (unlikely (status))
|
||||
return status;
|
||||
|
|
@ -3625,11 +3630,11 @@ _cairo_ps_surface_stroke (void *abstract_surface,
|
|||
{
|
||||
cairo_ps_surface_t *surface = abstract_surface;
|
||||
cairo_composite_rectangles_t extents;
|
||||
cairo_rectangle_int_t unbounded;
|
||||
cairo_int_status_t status;
|
||||
|
||||
status = _cairo_composite_rectangles_init_for_stroke (&extents,
|
||||
surface->width,
|
||||
surface->height,
|
||||
_cairo_ps_surface_get_extents (surface, &unbounded);
|
||||
status = _cairo_composite_rectangles_init_for_stroke (&extents, &unbounded,
|
||||
op, source,
|
||||
path, style, ctm,
|
||||
clip);
|
||||
|
|
@ -3687,11 +3692,11 @@ _cairo_ps_surface_fill (void *abstract_surface,
|
|||
{
|
||||
cairo_ps_surface_t *surface = abstract_surface;
|
||||
cairo_composite_rectangles_t extents;
|
||||
cairo_rectangle_int_t unbounded;
|
||||
cairo_int_status_t status;
|
||||
|
||||
status = _cairo_composite_rectangles_init_for_fill (&extents,
|
||||
surface->width,
|
||||
surface->height,
|
||||
_cairo_ps_surface_get_extents (surface, &unbounded);
|
||||
status = _cairo_composite_rectangles_init_for_fill (&extents, &unbounded,
|
||||
op, source, path,
|
||||
clip);
|
||||
if (unlikely (status))
|
||||
|
|
@ -3771,12 +3776,12 @@ _cairo_ps_surface_show_glyphs (void *abstract_surface,
|
|||
{
|
||||
cairo_ps_surface_t *surface = abstract_surface;
|
||||
cairo_composite_rectangles_t extents;
|
||||
cairo_rectangle_int_t unbounded;
|
||||
cairo_bool_t overlap;
|
||||
cairo_status_t status;
|
||||
|
||||
status = _cairo_composite_rectangles_init_for_glyphs (&extents,
|
||||
surface->width,
|
||||
surface->height,
|
||||
_cairo_ps_surface_get_extents (surface, &unbounded);
|
||||
status = _cairo_composite_rectangles_init_for_glyphs (&extents, &unbounded,
|
||||
op, source,
|
||||
scaled_font,
|
||||
glyphs, num_glyphs,
|
||||
|
|
|
|||
|
|
@ -359,9 +359,7 @@ _cairo_recording_surface_paint (void *abstract_surface,
|
|||
const cairo_rectangle_int_t *extents;
|
||||
|
||||
extents = _cairo_recording_surface_extents (surface);
|
||||
status = _cairo_composite_rectangles_init_for_paint (&composite,
|
||||
extents->width,
|
||||
extents->height,
|
||||
status = _cairo_composite_rectangles_init_for_paint (&composite, extents,
|
||||
op, source,
|
||||
clip);
|
||||
if (unlikely (status))
|
||||
|
|
@ -420,9 +418,7 @@ _cairo_recording_surface_mask (void *abstract_surface,
|
|||
const cairo_rectangle_int_t *extents;
|
||||
|
||||
extents = _cairo_recording_surface_extents (surface);
|
||||
status = _cairo_composite_rectangles_init_for_mask (&composite,
|
||||
extents->width,
|
||||
extents->height,
|
||||
status = _cairo_composite_rectangles_init_for_mask (&composite, extents,
|
||||
op, source, mask,
|
||||
clip);
|
||||
if (unlikely (status))
|
||||
|
|
@ -486,9 +482,7 @@ _cairo_recording_surface_stroke (void *abstract_surface,
|
|||
const cairo_rectangle_int_t *extents;
|
||||
|
||||
extents = _cairo_recording_surface_extents (surface);
|
||||
status = _cairo_composite_rectangles_init_for_stroke (&composite,
|
||||
extents->width,
|
||||
extents->height,
|
||||
status = _cairo_composite_rectangles_init_for_stroke (&composite, extents,
|
||||
op, source,
|
||||
path, style, ctm,
|
||||
clip);
|
||||
|
|
@ -562,9 +556,7 @@ _cairo_recording_surface_fill (void *abstract_surface,
|
|||
const cairo_rectangle_int_t *extents;
|
||||
|
||||
extents = _cairo_recording_surface_extents (surface);
|
||||
status = _cairo_composite_rectangles_init_for_fill (&composite,
|
||||
extents->width,
|
||||
extents->height,
|
||||
status = _cairo_composite_rectangles_init_for_fill (&composite, extents,
|
||||
op, source, path,
|
||||
clip);
|
||||
if (unlikely (status))
|
||||
|
|
@ -640,9 +632,7 @@ _cairo_recording_surface_show_text_glyphs (void *abstract_surface,
|
|||
const cairo_rectangle_int_t *extents;
|
||||
|
||||
extents = _cairo_recording_surface_extents (surface);
|
||||
status = _cairo_composite_rectangles_init_for_glyphs (&composite,
|
||||
extents->width,
|
||||
extents->height,
|
||||
status = _cairo_composite_rectangles_init_for_glyphs (&composite, extents,
|
||||
op, source,
|
||||
scaled_font,
|
||||
glyphs, num_glyphs,
|
||||
|
|
@ -961,7 +951,6 @@ _cairo_recording_surface_replay_internal (cairo_recording_surface_t *surface,
|
|||
return CAIRO_STATUS_SUCCESS;
|
||||
|
||||
assert (_cairo_surface_is_recording (&surface->base));
|
||||
surface = (cairo_recording_surface_t *) surface;
|
||||
|
||||
_cairo_surface_wrapper_init (&wrapper, target);
|
||||
if (surface_extents)
|
||||
|
|
|
|||
|
|
@ -829,9 +829,7 @@ _cairo_surface_fallback_paint (cairo_surface_t *surface,
|
|||
if (!_cairo_surface_get_extents (surface, &rect))
|
||||
ASSERT_NOT_REACHED;
|
||||
|
||||
status = _cairo_composite_rectangles_init_for_paint (&extents,
|
||||
rect.width,
|
||||
rect.height,
|
||||
status = _cairo_composite_rectangles_init_for_paint (&extents, &rect,
|
||||
op, source,
|
||||
clip);
|
||||
if (unlikely (status))
|
||||
|
|
@ -918,8 +916,7 @@ _cairo_surface_fallback_mask (cairo_surface_t *surface,
|
|||
if (!_cairo_surface_get_extents (surface, &rect))
|
||||
ASSERT_NOT_REACHED;
|
||||
|
||||
status = _cairo_composite_rectangles_init_for_mask (&extents,
|
||||
rect.width, rect.height,
|
||||
status = _cairo_composite_rectangles_init_for_mask (&extents, &rect,
|
||||
op, source, mask, clip);
|
||||
if (unlikely (status))
|
||||
return status;
|
||||
|
|
@ -956,9 +953,7 @@ _cairo_surface_fallback_stroke (cairo_surface_t *surface,
|
|||
if (!_cairo_surface_get_extents (surface, &rect))
|
||||
ASSERT_NOT_REACHED;
|
||||
|
||||
status = _cairo_composite_rectangles_init_for_stroke (&extents,
|
||||
rect.width,
|
||||
rect.height,
|
||||
status = _cairo_composite_rectangles_init_for_stroke (&extents, &rect,
|
||||
op, source,
|
||||
path, stroke_style, ctm,
|
||||
clip);
|
||||
|
|
@ -1039,9 +1034,7 @@ _cairo_surface_fallback_fill (cairo_surface_t *surface,
|
|||
if (!_cairo_surface_get_extents (surface, &rect))
|
||||
ASSERT_NOT_REACHED;
|
||||
|
||||
status = _cairo_composite_rectangles_init_for_fill (&extents,
|
||||
rect.width,
|
||||
rect.height,
|
||||
status = _cairo_composite_rectangles_init_for_fill (&extents, &rect,
|
||||
op, source, path,
|
||||
clip);
|
||||
if (unlikely (status))
|
||||
|
|
@ -1187,9 +1180,7 @@ _cairo_surface_fallback_show_glyphs (cairo_surface_t *surface,
|
|||
if (!_cairo_surface_get_extents (surface, &rect))
|
||||
ASSERT_NOT_REACHED;
|
||||
|
||||
status = _cairo_composite_rectangles_init_for_glyphs (&extents,
|
||||
rect.width,
|
||||
rect.height,
|
||||
status = _cairo_composite_rectangles_init_for_glyphs (&extents, &rect,
|
||||
op, source,
|
||||
scaled_font,
|
||||
glyphs, num_glyphs,
|
||||
|
|
|
|||
|
|
@ -373,6 +373,10 @@ _cairo_xcb_surface_create_internal (cairo_xcb_screen_t *screen,
|
|||
int width,
|
||||
int height);
|
||||
|
||||
cairo_private cairo_bool_t
|
||||
_cairo_xcb_surface_get_extents (void *abstract_surface,
|
||||
cairo_rectangle_int_t *extents);
|
||||
|
||||
cairo_private cairo_int_status_t
|
||||
_cairo_xcb_surface_cairo_paint (cairo_xcb_surface_t *surface,
|
||||
cairo_operator_t op,
|
||||
|
|
|
|||
|
|
@ -3371,6 +3371,7 @@ _cairo_xcb_surface_render_paint (cairo_xcb_surface_t *surface,
|
|||
const cairo_clip_t *clip)
|
||||
{
|
||||
cairo_composite_rectangles_t extents;
|
||||
cairo_rectangle_int_t unbounded;
|
||||
cairo_boxes_t boxes;
|
||||
cairo_status_t status;
|
||||
|
||||
|
|
@ -3401,9 +3402,8 @@ _cairo_xcb_surface_render_paint (cairo_xcb_surface_t *surface,
|
|||
return CAIRO_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
status = _cairo_composite_rectangles_init_for_paint (&extents,
|
||||
surface->width,
|
||||
surface->height,
|
||||
_cairo_xcb_surface_get_extents (surface, &unbounded);
|
||||
status = _cairo_composite_rectangles_init_for_paint (&extents, &unbounded,
|
||||
op, source,
|
||||
clip);
|
||||
if (unlikely (status))
|
||||
|
|
@ -3428,6 +3428,7 @@ _cairo_xcb_surface_render_mask (cairo_xcb_surface_t *surface,
|
|||
const cairo_clip_t *clip)
|
||||
{
|
||||
cairo_composite_rectangles_t extents;
|
||||
cairo_rectangle_int_t unbounded;
|
||||
cairo_status_t status;
|
||||
|
||||
if (unlikely (! _operator_is_supported (surface->connection->flags, op)))
|
||||
|
|
@ -3436,8 +3437,8 @@ _cairo_xcb_surface_render_mask (cairo_xcb_surface_t *surface,
|
|||
if ((surface->connection->flags & CAIRO_XCB_RENDER_HAS_COMPOSITE) == 0)
|
||||
return CAIRO_INT_STATUS_UNSUPPORTED;
|
||||
|
||||
status = _cairo_composite_rectangles_init_for_mask (&extents,
|
||||
surface->width, surface->height,
|
||||
_cairo_xcb_surface_get_extents (surface, &unbounded);
|
||||
status = _cairo_composite_rectangles_init_for_mask (&extents, &unbounded,
|
||||
op, source, mask, clip);
|
||||
if (unlikely (status))
|
||||
return status;
|
||||
|
|
@ -3573,6 +3574,7 @@ _cairo_xcb_surface_render_stroke (cairo_xcb_surface_t *surface,
|
|||
const cairo_clip_t *clip)
|
||||
{
|
||||
cairo_composite_rectangles_t extents;
|
||||
cairo_rectangle_int_t unbounded;
|
||||
cairo_int_status_t status;
|
||||
|
||||
if (unlikely (! _operator_is_supported (surface->connection->flags, op)))
|
||||
|
|
@ -3584,9 +3586,8 @@ _cairo_xcb_surface_render_stroke (cairo_xcb_surface_t *surface,
|
|||
return CAIRO_INT_STATUS_UNSUPPORTED;
|
||||
}
|
||||
|
||||
status = _cairo_composite_rectangles_init_for_stroke (&extents,
|
||||
surface->width,
|
||||
surface->height,
|
||||
_cairo_xcb_surface_get_extents (surface, &unbounded);
|
||||
status = _cairo_composite_rectangles_init_for_stroke (&extents, &unbounded,
|
||||
op, source,
|
||||
path, style, ctm,
|
||||
clip);
|
||||
|
|
@ -3724,6 +3725,7 @@ _cairo_xcb_surface_render_fill (cairo_xcb_surface_t *surface,
|
|||
const cairo_clip_t *clip)
|
||||
{
|
||||
cairo_composite_rectangles_t extents;
|
||||
cairo_rectangle_int_t unbounded;
|
||||
cairo_int_status_t status;
|
||||
|
||||
if (unlikely (! _operator_is_supported (surface->connection->flags, op)))
|
||||
|
|
@ -3735,9 +3737,8 @@ _cairo_xcb_surface_render_fill (cairo_xcb_surface_t *surface,
|
|||
return CAIRO_INT_STATUS_UNSUPPORTED;
|
||||
}
|
||||
|
||||
status = _cairo_composite_rectangles_init_for_fill (&extents,
|
||||
surface->width,
|
||||
surface->height,
|
||||
_cairo_xcb_surface_get_extents (surface, &unbounded);
|
||||
status = _cairo_composite_rectangles_init_for_fill (&extents, &unbounded,
|
||||
op, source, path,
|
||||
clip);
|
||||
if (unlikely (status))
|
||||
|
|
@ -4710,6 +4711,7 @@ _cairo_xcb_surface_render_glyphs (cairo_xcb_surface_t *surface,
|
|||
const cairo_clip_t *clip)
|
||||
{
|
||||
cairo_composite_rectangles_t extents;
|
||||
cairo_rectangle_int_t unbounded;
|
||||
cairo_int_status_t status;
|
||||
cairo_bool_t overlap;
|
||||
|
||||
|
|
@ -4719,9 +4721,8 @@ _cairo_xcb_surface_render_glyphs (cairo_xcb_surface_t *surface,
|
|||
if ((surface->connection->flags & (CAIRO_XCB_RENDER_HAS_COMPOSITE_GLYPHS | CAIRO_XCB_RENDER_HAS_COMPOSITE)) == 0)
|
||||
return CAIRO_INT_STATUS_UNSUPPORTED;
|
||||
|
||||
status = _cairo_composite_rectangles_init_for_glyphs (&extents,
|
||||
surface->width,
|
||||
surface->height,
|
||||
_cairo_xcb_surface_get_extents (surface, &unbounded);
|
||||
status = _cairo_composite_rectangles_init_for_glyphs (&extents, &unbounded,
|
||||
op, source,
|
||||
scaled_font,
|
||||
glyphs, num_glyphs,
|
||||
|
|
|
|||
|
|
@ -511,7 +511,7 @@ _cairo_xcb_surface_release_source_image (void *abstract_surface,
|
|||
cairo_surface_destroy (&image->base);
|
||||
}
|
||||
|
||||
static cairo_bool_t
|
||||
cairo_bool_t
|
||||
_cairo_xcb_surface_get_extents (void *abstract_surface,
|
||||
cairo_rectangle_int_t *extents)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue