Back to index

lightning-sunbird  0.9+nobinonly
Classes | Typedefs | Enumerations | Functions
cairo-meta-surface-private.h File Reference
#include "cairoint.h"
#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_command_composite
struct  _cairo_command_fill_rectangles
struct  _cairo_command_composite_trapezoids
struct  _cairo_command_set_clip_region
struct  _cairo_command_intersect_clip_path
struct  _cairo_command_show_glyphs
struct  _cairo_command_fill_path
union  _cairo_command
struct  _cairo_meta_surface

Typedefs

typedef struct
_cairo_command_composite 
cairo_command_composite_t
typedef struct
_cairo_command_fill_rectangles 
cairo_command_fill_rectangles_t
typedef struct
_cairo_command_composite_trapezoids 
cairo_command_composite_trapezoids_t
typedef struct
_cairo_command_set_clip_region 
cairo_command_set_clip_region_t
typedef struct
_cairo_command_intersect_clip_path 
cairo_command_intersect_clip_path_t
typedef struct
_cairo_command_show_glyphs 
cairo_command_show_glyphs_t
typedef struct
_cairo_command_fill_path 
cairo_command_fill_path_t
typedef union _cairo_command cairo_command_t
typedef struct _cairo_meta_surface cairo_meta_surface_t

Enumerations

enum  cairo_command_type_t {
  CAIRO_COMMAND_COMPOSITE, CAIRO_COMMAND_FILL_RECTANGLES, CAIRO_COMMAND_COMPOSITE_TRAPEZOIDS, CAIRO_COMMAND_SET_CLIP_REGION,
  CAIRO_COMMAND_INTERSECT_CLIP_PATH, CAIRO_COMMAND_SHOW_GLYPHS, CAIRO_COMMAND_FILL_PATH
}

Functions

cairo_private cairo_surface_t * _cairo_meta_surface_create (double width, double height)
cairo_private cairo_int_status_t _cairo_meta_surface_replay (cairo_surface_t *surface, cairo_surface_t *target)

Class Documentation

struct _cairo_command_composite

Definition at line 52 of file cairo-meta-surface-private.h.

Collaboration diagram for _cairo_command_composite:
Class Members
int dst_x
int dst_y
unsigned int height
cairo_pattern_union_t mask_pattern
cairo_pattern_t * mask_pattern_pointer
int mask_x
int mask_y
cairo_operator_t operator
cairo_pattern_union_t src_pattern
int src_x
int src_y
cairo_command_type_t type
unsigned int width
struct _cairo_command_fill_rectangles

Definition at line 68 of file cairo-meta-surface-private.h.

Collaboration diagram for _cairo_command_fill_rectangles:
Class Members
cairo_color_t color
int num_rects
cairo_operator_t operator
cairo_rectangle_t * rects
cairo_command_type_t type
struct _cairo_command_composite_trapezoids

Definition at line 76 of file cairo-meta-surface-private.h.

Collaboration diagram for _cairo_command_composite_trapezoids:
Class Members
cairo_antialias_t antialias
unsigned int height
int num_traps
cairo_operator_t operator
cairo_pattern_union_t pattern
cairo_trapezoid_t * traps
cairo_command_type_t type
unsigned int width
int x_dst
int x_src
int y_dst
int y_src
struct _cairo_command_set_clip_region

Definition at line 91 of file cairo-meta-surface-private.h.

Class Members
pixman_region16_t * region
unsigned int serial
cairo_command_type_t type
struct _cairo_command_intersect_clip_path

Definition at line 97 of file cairo-meta-surface-private.h.

Class Members
cairo_antialias_t antialias
cairo_fill_rule_t fill_rule
cairo_path_fixed_t path
cairo_path_fixed_t * path_pointer
double tolerance
cairo_command_type_t type
struct _cairo_command_show_glyphs

Definition at line 106 of file cairo-meta-surface-private.h.

Collaboration diagram for _cairo_command_show_glyphs:
Class Members
int dest_x
int dest_y
cairo_glyph_t * glyphs
unsigned int height
int num_glyphs
cairo_operator_t operator
cairo_pattern_union_t pattern
cairo_scaled_font_t * scaled_font
int source_x
int source_y
cairo_command_type_t type
unsigned int width
struct _cairo_command_fill_path

Definition at line 121 of file cairo-meta-surface-private.h.

Collaboration diagram for _cairo_command_fill_path:
Class Members
cairo_antialias_t antialias
cairo_fill_rule_t fill_rule
cairo_operator_t operator
cairo_path_fixed_t path
cairo_pattern_union_t pattern
double tolerance
cairo_command_type_t type
union _cairo_command

Definition at line 131 of file cairo-meta-surface-private.h.

Collaboration diagram for _cairo_command:
Class Members
cairo_command_composite_t composite
cairo_command_composite_trapezoids_t composite_trapezoids
cairo_command_fill_path_t fill_path
cairo_command_fill_rectangles_t fill_rectangles
cairo_command_intersect_clip_path_t intersect_clip_path
cairo_command_set_clip_region_t set_clip_region
cairo_command_show_glyphs_t show_glyphs
cairo_command_type_t type
struct _cairo_meta_surface

Definition at line 142 of file cairo-meta-surface-private.h.

Class Members
cairo_surface_t base
cairo_array_t commands
double height
double width

Typedef Documentation


Enumeration Type Documentation

Enumerator:
CAIRO_COMMAND_COMPOSITE 
CAIRO_COMMAND_FILL_RECTANGLES 
CAIRO_COMMAND_COMPOSITE_TRAPEZOIDS 
CAIRO_COMMAND_SET_CLIP_REGION 
CAIRO_COMMAND_INTERSECT_CLIP_PATH 
CAIRO_COMMAND_SHOW_GLYPHS 
CAIRO_COMMAND_FILL_PATH 

Definition at line 42 of file cairo-meta-surface-private.h.


Function Documentation

cairo_private cairo_surface_t* _cairo_meta_surface_create ( double  width,
double  height 
)

Definition at line 43 of file cairo-meta-surface.c.

{
    cairo_meta_surface_t *meta;

    meta = malloc (sizeof (cairo_meta_surface_t));
    if (meta == NULL) {
       _cairo_error (CAIRO_STATUS_NO_MEMORY);
       return (cairo_surface_t*) &_cairo_surface_nil;
    }

    meta->width = width;
    meta->height = height;
    _cairo_surface_init (&meta->base, &cairo_meta_surface_backend);
    _cairo_array_init (&meta->commands, sizeof (cairo_command_t *));

    return &meta->base;
}

Here is the call graph for this function:

Here is the caller graph for this function:

cairo_private cairo_int_status_t _cairo_meta_surface_replay ( cairo_surface_t *  surface,
cairo_surface_t *  target 
)

Definition at line 439 of file cairo-meta-surface.c.

{
    cairo_meta_surface_t *meta;
    cairo_command_t *command, **elements;
    int i, num_elements;
    cairo_int_status_t status;
    cairo_traps_t traps;
    cairo_clip_t clip;

    meta = (cairo_meta_surface_t *) surface;
    status = CAIRO_STATUS_SUCCESS;

    _cairo_clip_init (&clip, target);    

    num_elements = meta->commands.num_elements;
    elements = (cairo_command_t **) meta->commands.elements;
    for (i = 0; i < num_elements; i++) {
       command = elements[i];
       switch (command->type) {
       case CAIRO_COMMAND_COMPOSITE:
           status = _cairo_surface_set_clip (target, &clip);
           if (status)
              break;

           status = _cairo_surface_composite
              (command->composite.operator,
               &command->composite.src_pattern.base,
               command->composite.mask_pattern_pointer,
               target,
               command->composite.src_x,
               command->composite.src_y,
               command->composite.mask_x,
               command->composite.mask_y,
               command->composite.dst_x,
               command->composite.dst_y,
               command->composite.width,
               command->composite.height);
           break;

       case CAIRO_COMMAND_FILL_RECTANGLES:
           status = _cairo_surface_set_clip (target, &clip);
           if (status)
              break;

           status = _cairo_surface_fill_rectangles
              (target,
               command->fill_rectangles.operator,
               &command->fill_rectangles.color,
               command->fill_rectangles.rects,
               command->fill_rectangles.num_rects);
           break;

       case CAIRO_COMMAND_COMPOSITE_TRAPEZOIDS:
           status = _cairo_surface_set_clip (target, &clip);
           if (status)
              break;

           status = _cairo_surface_composite_trapezoids
              (command->composite_trapezoids.operator,
               &command->composite_trapezoids.pattern.base,
               target,
               command->composite_trapezoids.antialias,
               command->composite_trapezoids.x_src,
               command->composite_trapezoids.y_src,
               command->composite_trapezoids.x_dst,
               command->composite_trapezoids.y_dst,
               command->composite_trapezoids.width,
               command->composite_trapezoids.height,
               command->composite_trapezoids.traps,
               command->composite_trapezoids.num_traps);
           break;

       case CAIRO_COMMAND_INTERSECT_CLIP_PATH:
           /* XXX Meta surface clipping is broken and requires some
            * cairo-gstate.c rewriting.  Work around it for now. */
           if (command->intersect_clip_path.path_pointer == NULL)
              status = _cairo_clip_reset (&clip);
           else
              status = _cairo_clip_clip (&clip,
                                      command->intersect_clip_path.path_pointer,
                                      command->intersect_clip_path.fill_rule,
                                      command->intersect_clip_path.tolerance,
                                      command->intersect_clip_path.antialias,
                                      target);
           break;

       case CAIRO_COMMAND_SHOW_GLYPHS:
           status = _cairo_surface_set_clip (target, &clip);
           if (status)
              break;

           status = _cairo_surface_show_glyphs
              (command->show_glyphs.scaled_font,
               command->show_glyphs.operator,
               &command->show_glyphs.pattern.base,
               target,
               command->show_glyphs.source_x,
               command->show_glyphs.source_y,
               command->show_glyphs.dest_x,
               command->show_glyphs.dest_y,
               command->show_glyphs.width,
               command->show_glyphs.height,
               command->show_glyphs.glyphs,
               command->show_glyphs.num_glyphs);
           if (status != CAIRO_INT_STATUS_UNSUPPORTED)
              break;
           
           status = (*command->show_glyphs.scaled_font->backend->
                    show_glyphs) (command->show_glyphs.scaled_font,
                                command->show_glyphs.operator,
                                &command->show_glyphs.pattern.base,
                                target,
                                command->show_glyphs.source_x,
                                command->show_glyphs.source_y,
                                command->show_glyphs.dest_x,
                                command->show_glyphs.dest_y,
                                command->show_glyphs.width,
                                command->show_glyphs.height,
                                command->show_glyphs.glyphs,
                                command->show_glyphs.num_glyphs);

           break;

       case CAIRO_COMMAND_FILL_PATH:
           status = _cairo_surface_set_clip (target, &clip);
           if (status)
              break;

           status = _cairo_surface_fill_path (command->fill_path.operator,
                                          &command->fill_path.pattern.base,
                                          target,
                                          &command->fill_path.path,
                                          command->fill_path.fill_rule,
                                          command->fill_path.tolerance);
           if (status != CAIRO_INT_STATUS_UNSUPPORTED)
              break;

           _cairo_traps_init (&traps);

           status = _cairo_path_fixed_fill_to_traps (&command->fill_path.path,
                                                command->fill_path.fill_rule,
                                                command->fill_path.tolerance,
                                                &traps);
           if (status) {
              _cairo_traps_fini (&traps);
              break;
           }

           status = _cairo_surface_clip_and_composite_trapezoids (&command->fill_path.pattern.base,
                                                           command->fill_path.operator,
                                                           target,
                                                           &traps,
                                                           &clip,
                                                           command->fill_path.antialias);

           _cairo_traps_fini (&traps);
           break;

       default:
           ASSERT_NOT_REACHED;
       }

       if (status)
           break;
    }

    _cairo_clip_fini (&clip);

    return status;
}

Here is the call graph for this function:

Here is the caller graph for this function: