Back to index

lightning-sunbird  0.9+nobinonly
Classes | Enumerations | Functions
cairo-clip-private.h File Reference
#include "cairo-path-fixed-private.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _cairo_clip_path
struct  _cairo_clip

Enumerations

enum  _cairo_clip_mode { CAIRO_CLIP_MODE_PATH, CAIRO_CLIP_MODE_REGION, CAIRO_CLIP_MODE_MASK }

Functions

cairo_private void _cairo_clip_init (cairo_clip_t *clip, cairo_surface_t *target)
cairo_private void _cairo_clip_fini (cairo_clip_t *clip)
cairo_private void _cairo_clip_init_copy (cairo_clip_t *clip, cairo_clip_t *other)
cairo_private cairo_status_t _cairo_clip_reset (cairo_clip_t *clip)
cairo_private cairo_status_t _cairo_clip_clip (cairo_clip_t *clip, cairo_path_fixed_t *path, cairo_fill_rule_t fill_rule, double tolerance, cairo_antialias_t antialias, cairo_surface_t *target)
cairo_private cairo_status_t _cairo_clip_intersect_to_rectangle (cairo_clip_t *clip, cairo_rectangle_t *rectangle)
cairo_private cairo_status_t _cairo_clip_intersect_to_region (cairo_clip_t *clip, pixman_region16_t *region)
cairo_private cairo_status_t _cairo_clip_combine_to_surface (cairo_clip_t *clip, cairo_operator_t operator, cairo_surface_t *dst, int dst_x, int dst_y, const cairo_rectangle_t *extents)

Class Documentation

struct _cairo_clip_path

Definition at line 47 of file cairo-clip-private.h.

Class Members
cairo_antialias_t antialias
cairo_fill_rule_t fill_rule
cairo_path_fixed_t path
cairo_clip_path_t * prev
unsigned int ref_count
double tolerance
struct _cairo_clip

Definition at line 56 of file cairo-clip-private.h.

Collaboration diagram for _cairo_clip:
Class Members
cairo_clip_mode_t mode
cairo_clip_path_t * path
pixman_region16_t * region
unsigned int serial
cairo_surface_t * surface
cairo_rectangle_t surface_rect

Enumeration Type Documentation

Enumerator:
CAIRO_CLIP_MODE_PATH 
CAIRO_CLIP_MODE_REGION 
CAIRO_CLIP_MODE_MASK 

Definition at line 41 of file cairo-clip-private.h.


Function Documentation

cairo_private cairo_status_t _cairo_clip_clip ( cairo_clip_t *  clip,
cairo_path_fixed_t *  path,
cairo_fill_rule_t  fill_rule,
double  tolerance,
cairo_antialias_t  antialias,
cairo_surface_t *  target 
)

Definition at line 410 of file cairo-clip.c.

{
    cairo_status_t status;
    cairo_traps_t traps;
    
    status = _cairo_clip_intersect_path (clip,
                                    path, fill_rule, tolerance,
                                    antialias, target);
    if (status != CAIRO_INT_STATUS_UNSUPPORTED)
       return status;

    _cairo_traps_init (&traps);
    status = _cairo_path_fixed_fill_to_traps (path,
                                         fill_rule,
                                         tolerance,
                                         &traps);
    if (status)
       goto bail;

    status = _cairo_clip_intersect_region (clip, &traps, target);
    if (status != CAIRO_INT_STATUS_UNSUPPORTED)
       goto bail;

    status = _cairo_clip_intersect_mask (clip, &traps, antialias, target);
       
 bail:
    _cairo_traps_fini (&traps);

    return status;
}

Here is the call graph for this function:

Here is the caller graph for this function:

cairo_private cairo_status_t _cairo_clip_combine_to_surface ( cairo_clip_t *  clip,
cairo_operator_t  operator,
cairo_surface_t *  dst,
int  dst_x,
int  dst_y,
const cairo_rectangle_t extents 
)

Definition at line 187 of file cairo-clip.c.

{
    cairo_pattern_union_t pattern;
    cairo_status_t status;

    _cairo_pattern_init_for_surface (&pattern.surface, clip->surface);
    
    status = _cairo_surface_composite (operator,
                                   &pattern.base,
                                   NULL,
                                   dst,
                                   extents->x - clip->surface_rect.x,
                                   extents->y - clip->surface_rect.y, 
                                   0, 0,
                                   extents->x - dst_x,
                                   extents->y - dst_y,
                                   extents->width, extents->height);
    
    _cairo_pattern_fini (&pattern.base);

    return status;
}

Here is the call graph for this function:

Here is the caller graph for this function:

cairo_private void _cairo_clip_fini ( cairo_clip_t *  clip)

Definition at line 59 of file cairo-clip.c.

{
    if (clip->surface)
       cairo_surface_destroy (clip->surface);
    clip->surface = NULL;

    if (clip->path)
       _cairo_clip_path_destroy (clip->path);
    clip->path = NULL;

    if (clip->region)
       pixman_region_destroy (clip->region);
    clip->region = NULL;
    clip->serial = 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

cairo_private void _cairo_clip_init ( cairo_clip_t *  clip,
cairo_surface_t *  target 
)

Definition at line 49 of file cairo-clip.c.

{
    clip->mode = _cairo_surface_get_clip_mode (target);
    clip->region = NULL;
    clip->surface = NULL;
    clip->serial = 0;
    clip->path = NULL;
}

Here is the call graph for this function:

Here is the caller graph for this function:

cairo_private void _cairo_clip_init_copy ( cairo_clip_t *  clip,
cairo_clip_t *  other 
)

Definition at line 76 of file cairo-clip.c.

{
    if (other->region) {
       clip->region = pixman_region_create ();
       pixman_region_copy (clip->region, other->region);
    }

    cairo_surface_reference (other->surface);
    clip->surface = other->surface;
    _cairo_clip_path_reference (other->path);
    clip->path = other->path;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 111 of file cairo-clip.c.

{
    if (clip->path) {
       /* Intersect path extents here. */
    }

    if (clip->region) {
       pixman_region16_t *intersection;
       cairo_status_t status = CAIRO_STATUS_SUCCESS;
       pixman_region_status_t pixman_status;
       
       intersection = _cairo_region_create_from_rectangle (rectangle);
       if (intersection == NULL)
           return CAIRO_STATUS_NO_MEMORY;
       
       pixman_status = pixman_region_intersect (intersection,
                                     clip->region,
                                     intersection);
       if (pixman_status == PIXMAN_REGION_STATUS_SUCCESS)
           _cairo_region_extents_rectangle (intersection, rectangle);
       else
           status = CAIRO_STATUS_NO_MEMORY;

       pixman_region_destroy (intersection);

       if (status)
           return status;
    }

    if (clip->surface)
       _cairo_rectangle_intersect (rectangle, &clip->surface_rect);

    return CAIRO_STATUS_SUCCESS;
}

Here is the call graph for this function:

Here is the caller graph for this function:

cairo_private cairo_status_t _cairo_clip_intersect_to_region ( cairo_clip_t *  clip,
pixman_region16_t *  region 
)

Definition at line 148 of file cairo-clip.c.

{
    if (clip->path) {
       /* Intersect clip path into region. */
    }

    if (clip->region)
       pixman_region_intersect (region, clip->region, region);

    if (clip->surface) {
       pixman_region16_t *clip_rect;
       pixman_region_status_t pixman_status;
       cairo_status_t status = CAIRO_STATUS_SUCCESS;
    
       clip_rect = _cairo_region_create_from_rectangle (&clip->surface_rect);
       if (clip_rect == NULL)
           return CAIRO_STATUS_NO_MEMORY;
       
       pixman_status = pixman_region_intersect (region,
                                           clip_rect,
                                           region);
       if (pixman_status != PIXMAN_REGION_STATUS_SUCCESS)
           status = CAIRO_STATUS_NO_MEMORY;

       pixman_region_destroy (clip_rect);

       if (status)
           return status;
    }

    return CAIRO_STATUS_SUCCESS;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 90 of file cairo-clip.c.

{
    /* destroy any existing clip-region artifacts */
    if (clip->surface)
       cairo_surface_destroy (clip->surface);
    clip->surface = NULL;

    if (clip->region)
       pixman_region_destroy (clip->region);
    clip->region = NULL;

    if (clip->path)
       _cairo_clip_path_destroy (clip->path);
    clip->path = NULL;

    clip->serial = 0;
    
    return CAIRO_STATUS_SUCCESS;
}

Here is the call graph for this function:

Here is the caller graph for this function: