Back to index

lightning-sunbird  0.9+nobinonly
Functions
cairo-region.c File Reference
#include <cairoint.h>

Go to the source code of this file.

Functions

pixman_region16_t * _cairo_region_create_from_rectangle (cairo_rectangle_t *rect)
 _cairo_region_create_from_rectangle: : a cairo_rectangle_t
void _cairo_region_extents_rectangle (pixman_region16_t *region, cairo_rectangle_t *rect)
 _cairo_region_extents_rectangle: : a #pixman_region16_t : rectangle into which to store the extents

Function Documentation

_cairo_region_create_from_rectangle: : a cairo_rectangle_t

Creates a region with extents initialized from the given rectangle.

Return value: a newly created #pixman_region16_t or NULL if memory couldn't a allocated.

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

{
    /* We can't use pixman_region_create_simple(), because it doesn't
     * have an error return
     */
    pixman_region16_t *region = pixman_region_create ();
    if (pixman_region_union_rect (region, region,
                              rect->x, rect->y,
                              rect->width, rect->height) != PIXMAN_REGION_STATUS_SUCCESS) {
       pixman_region_destroy (region);
       return NULL;
    }
    
    return region;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void _cairo_region_extents_rectangle ( pixman_region16_t *  region,
cairo_rectangle_t rect 
)

_cairo_region_extents_rectangle: : a #pixman_region16_t : rectangle into which to store the extents

Gets the bounding box of a region as a cairo_rectangle_t

Definition at line 73 of file cairo-region.c.

{
    pixman_box16_t *region_extents = pixman_region_extents (region);

    rect->x = region_extents->x1;
    rect->y = region_extents->y1;
    rect->width = region_extents->x2 - region_extents->x1;
    rect->height = region_extents->y2 - region_extents->y1;
}

Here is the caller graph for this function: