w32tex
About: TeX Live provides a comprehensive TeX system including all the major TeX-related programs, macro packages, and fonts that are free software. Windows sources.
  Fossies Dox: w32tex-src.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

cairo-script-surface.c File Reference
Include dependency graph for cairo-script-surface.c:

Go to the source code of this file.

Classes

struct  _operand
 
struct  deferred_finish
 
struct  _cairo_script_context
 
struct  _cairo_script_context::_bitmap
 
struct  _cairo_script_font
 
struct  _cairo_script_implicit_context
 
struct  _cairo_script_surface
 
struct  script_snapshot
 

Macros

#define to_be32(x)   bswap_32(x)
 
#define _cairo_output_stream_puts(S, STR)    _cairo_output_stream_write ((S), (STR), strlen (STR))
 
#define static   cairo_warn static
 

Typedefs

typedef struct _cairo_script_context cairo_script_context_t
 
typedef struct _cairo_script_surface cairo_script_surface_t
 
typedef struct _cairo_script_implicit_context cairo_script_implicit_context_t
 
typedef struct _cairo_script_font cairo_script_font_t
 
typedef struct _operand operand_t
 

Functions

static cairo_script_surface_t_cairo_script_surface_create_internal (cairo_script_context_t *ctx, cairo_content_t content, cairo_rectangle_t *extents, cairo_surface_t *passthrough)
 
static void _cairo_script_scaled_font_fini (cairo_scaled_font_private_t *abstract_private, cairo_scaled_font_t *scaled_font)
 
static void _cairo_script_implicit_context_init (cairo_script_implicit_context_t *cr)
 
static void _cairo_script_implicit_context_reset (cairo_script_implicit_context_t *cr)
 
static void _bitmap_release_id (struct _bitmap *b, unsigned long token)
 
static cairo_status_t _bitmap_next_id (struct _bitmap *b, unsigned long *id)
 
static void _bitmap_fini (struct _bitmap *b)
 
static const char * _direction_to_string (cairo_bool_t backward)
 
static const char * _operator_to_string (cairo_operator_t op)
 
static const char * _extend_to_string (cairo_extend_t extend)
 
static const char * _filter_to_string (cairo_filter_t filter)
 
static const char * _fill_rule_to_string (cairo_fill_rule_t rule)
 
static const char * _antialias_to_string (cairo_antialias_t antialias)
 
static const char * _line_cap_to_string (cairo_line_cap_t line_cap)
 
static const char * _line_join_to_string (cairo_line_join_t line_join)
 
static cairo_script_context_tto_context (cairo_script_surface_t *surface)
 
static cairo_bool_t target_is_active (cairo_script_surface_t *surface)
 
static void target_push (cairo_script_surface_t *surface)
 
static int target_depth (cairo_script_surface_t *surface)
 
static void _get_target (cairo_script_surface_t *surface)
 
static const char * _content_to_string (cairo_content_t content)
 
static cairo_status_t _emit_surface (cairo_script_surface_t *surface)
 
static cairo_status_t _emit_context (cairo_script_surface_t *surface)
 
static cairo_status_t _emit_operator (cairo_script_surface_t *surface, cairo_operator_t op)
 
static cairo_status_t _emit_fill_rule (cairo_script_surface_t *surface, cairo_fill_rule_t fill_rule)
 
static cairo_status_t _emit_tolerance (cairo_script_surface_t *surface, double tolerance, cairo_bool_t force)
 
static cairo_status_t _emit_antialias (cairo_script_surface_t *surface, cairo_antialias_t antialias)
 
static cairo_status_t _emit_line_width (cairo_script_surface_t *surface, double line_width, cairo_bool_t force)
 
static cairo_status_t _emit_line_cap (cairo_script_surface_t *surface, cairo_line_cap_t line_cap)
 
static cairo_status_t _emit_line_join (cairo_script_surface_t *surface, cairo_line_join_t line_join)
 
static cairo_status_t _emit_miter_limit (cairo_script_surface_t *surface, double miter_limit, cairo_bool_t force)
 
static cairo_bool_t _dashes_equal (const double *a, const double *b, int num_dashes)
 
static cairo_status_t _emit_dash (cairo_script_surface_t *surface, const double *dash, unsigned int num_dashes, double offset, cairo_bool_t force)
 
static cairo_status_t _emit_stroke_style (cairo_script_surface_t *surface, const cairo_stroke_style_t *style, cairo_bool_t force)
 
static const char * _format_to_string (cairo_format_t format)
 
static cairo_status_t _emit_solid_pattern (cairo_script_surface_t *surface, const cairo_pattern_t *pattern)
 
static cairo_status_t _emit_gradient_color_stops (cairo_gradient_pattern_t *gradient, cairo_output_stream_t *output)
 
static cairo_status_t _emit_linear_pattern (cairo_script_surface_t *surface, const cairo_pattern_t *pattern)
 
static cairo_status_t _emit_radial_pattern (cairo_script_surface_t *surface, const cairo_pattern_t *pattern)
 
static cairo_status_t _emit_mesh_pattern (cairo_script_surface_t *surface, const cairo_pattern_t *pattern)
 
static cairo_status_t script_snapshot_finish (void *abstract_surface)
 
static void detach_snapshot (cairo_surface_t *abstract_surface)
 
static void attach_snapshot (cairo_script_context_t *ctx, cairo_surface_t *source)
 
static cairo_status_t _emit_recording_surface_pattern (cairo_script_surface_t *surface, cairo_recording_surface_t *source)
 
static cairo_status_t _emit_script_surface_pattern (cairo_script_surface_t *surface, cairo_script_surface_t *source)
 
static cairo_status_t _write_image_surface (cairo_output_stream_t *output, const cairo_image_surface_t *image)
 
static cairo_int_status_t _emit_png_surface (cairo_script_surface_t *surface, cairo_image_surface_t *image)
 
static cairo_int_status_t _emit_image_surface (cairo_script_surface_t *surface, cairo_image_surface_t *image)
 
static cairo_int_status_t _emit_image_surface_pattern (cairo_script_surface_t *surface, cairo_surface_t *source)
 
static cairo_int_status_t _emit_subsurface_pattern (cairo_script_surface_t *surface, cairo_surface_subsurface_t *sub)
 
static cairo_int_status_t _emit_surface_pattern (cairo_script_surface_t *surface, const cairo_pattern_t *pattern)
 
static cairo_int_status_t _emit_raster_pattern (cairo_script_surface_t *surface, const cairo_pattern_t *pattern)
 
static cairo_int_status_t _emit_pattern (cairo_script_surface_t *surface, const cairo_pattern_t *pattern)
 
static cairo_int_status_t _emit_identity (cairo_script_surface_t *surface, cairo_bool_t *matrix_updated)
 
static cairo_int_status_t _emit_source (cairo_script_surface_t *surface, cairo_operator_t op, const cairo_pattern_t *source)
 
static cairo_status_t _path_move_to (void *closure, const cairo_point_t *point)
 
static cairo_status_t _path_line_to (void *closure, const cairo_point_t *point)
 
static cairo_status_t _path_curve_to (void *closure, const cairo_point_t *p1, const cairo_point_t *p2, const cairo_point_t *p3)
 
static cairo_status_t _path_close (void *closure)
 
static cairo_status_t _emit_path_boxes (cairo_script_surface_t *surface, const cairo_path_fixed_t *path)
 
static cairo_status_t _emit_path (cairo_script_surface_t *surface, const cairo_path_fixed_t *path, cairo_bool_t is_fill)
 
static cairo_bool_t _scaling_matrix_equal (const cairo_matrix_t *a, const cairo_matrix_t *b)
 
static cairo_status_t _emit_scaling_matrix (cairo_script_surface_t *surface, const cairo_matrix_t *ctm, cairo_bool_t *matrix_updated)
 
static cairo_status_t _emit_font_matrix (cairo_script_surface_t *surface, const cairo_matrix_t *font_matrix)
 
static cairo_surface_t_cairo_script_surface_create_similar (void *abstract_surface, cairo_content_t content, int width, int height)
 
static cairo_status_t _device_flush (void *abstract_device)
 
static void _device_destroy (void *abstract_device)
 
static cairo_surface_t_cairo_script_surface_source (void *abstract_surface, cairo_rectangle_int_t *extents)
 
static cairo_status_t _cairo_script_surface_acquire_source_image (void *abstract_surface, cairo_image_surface_t **image_out, void **image_extra)
 
static void _cairo_script_surface_release_source_image (void *abstract_surface, cairo_image_surface_t *image, void *image_extra)
 
static cairo_status_t _cairo_script_surface_finish (void *abstract_surface)
 
static cairo_int_status_t _cairo_script_surface_copy_page (void *abstract_surface)
 
static cairo_int_status_t _cairo_script_surface_show_page (void *abstract_surface)
 
static cairo_status_t _cairo_script_surface_clipper_intersect_clip_path (cairo_surface_clipper_t *clipper, cairo_path_fixed_t *path, cairo_fill_rule_t fill_rule, double tolerance, cairo_antialias_t antialias)
 
static cairo_status_t active (cairo_script_surface_t *surface)
 
static void inactive (cairo_script_surface_t *surface)
 
static cairo_int_status_t _cairo_script_surface_paint (void *abstract_surface, cairo_operator_t op, const cairo_pattern_t *source, const cairo_clip_t *clip)
 
static cairo_int_status_t _cairo_script_surface_mask (void *abstract_surface, cairo_operator_t op, const cairo_pattern_t *source, const cairo_pattern_t *mask, const cairo_clip_t *clip)
 
static cairo_int_status_t _cairo_script_surface_stroke (void *abstract_surface, cairo_operator_t op, const cairo_pattern_t *source, const cairo_path_fixed_t *path, const cairo_stroke_style_t *style, const cairo_matrix_t *ctm, const cairo_matrix_t *ctm_inverse, double tolerance, cairo_antialias_t antialias, const cairo_clip_t *clip)
 
static cairo_int_status_t _cairo_script_surface_fill (void *abstract_surface, cairo_operator_t op, const cairo_pattern_t *source, const cairo_path_fixed_t *path, cairo_fill_rule_t fill_rule, double tolerance, cairo_antialias_t antialias, const cairo_clip_t *clip)
 
static cairo_surface_t_cairo_script_surface_snapshot (void *abstract_surface)
 
static cairo_bool_t _cairo_script_surface_has_show_text_glyphs (void *abstract_surface)
 
static const char * _subpixel_order_to_string (cairo_subpixel_order_t subpixel_order)
 
static const char * _hint_style_to_string (cairo_hint_style_t hint_style)
 
static const char * _hint_metrics_to_string (cairo_hint_metrics_t hint_metrics)
 
static cairo_status_t _emit_font_options (cairo_script_surface_t *surface, cairo_font_options_t *font_options)
 
static cairo_script_font_t_cairo_script_font_get (cairo_script_context_t *ctx, cairo_scaled_font_t *font)
 
static long unsigned _cairo_script_font_id (cairo_script_context_t *ctx, cairo_scaled_font_t *font)
 
static cairo_status_t _emit_type42_font (cairo_script_surface_t *surface, cairo_scaled_font_t *scaled_font)
 
static cairo_status_t _emit_scaled_font_init (cairo_script_surface_t *surface, cairo_scaled_font_t *scaled_font, cairo_script_font_t **font_out)
 
static cairo_status_t _emit_scaled_font (cairo_script_surface_t *surface, cairo_scaled_font_t *scaled_font)
 
static cairo_status_t _emit_scaled_glyph_vector (cairo_script_surface_t *surface, cairo_scaled_font_t *scaled_font, cairo_script_font_t *font_private, cairo_scaled_glyph_t *scaled_glyph)
 
static cairo_status_t _emit_scaled_glyph_bitmap (cairo_script_surface_t *surface, cairo_scaled_font_t *scaled_font, cairo_script_font_t *font_private, cairo_scaled_glyph_t *scaled_glyph)
 
static cairo_status_t _emit_scaled_glyph_prologue (cairo_script_surface_t *surface, cairo_scaled_font_t *scaled_font)
 
static cairo_status_t _emit_scaled_glyphs (cairo_script_surface_t *surface, cairo_scaled_font_t *scaled_font, cairo_glyph_t *glyphs, unsigned int num_glyphs)
 
static void to_octal (int value, char *buf, size_t size)
 
static void _emit_string_literal (cairo_script_surface_t *surface, const char *utf8, int len)
 
static cairo_int_status_t _cairo_script_surface_show_text_glyphs (void *abstract_surface, cairo_operator_t op, const cairo_pattern_t *source, const char *utf8, int utf8_len, cairo_glyph_t *glyphs, int num_glyphs, const cairo_text_cluster_t *clusters, int num_clusters, cairo_text_cluster_flags_t backward, cairo_scaled_font_t *scaled_font, const cairo_clip_t *clip)
 
static cairo_bool_t _cairo_script_surface_get_extents (void *abstract_surface, cairo_rectangle_int_t *rectangle)
 
cairo_device_t_cairo_script_context_create_internal (cairo_output_stream_t *stream)
 
void _cairo_script_context_attach_snapshots (cairo_device_t *device, cairo_bool_t enable)
 
static cairo_device_t_cairo_script_context_create (cairo_output_stream_t *stream)
 
cairo_device_tcairo_script_create (const char *filename)
 
cairo_device_tcairo_script_create_for_stream (cairo_write_func_t write_func, void *closure)
 
void cairo_script_write_comment (cairo_device_t *script, const char *comment, int len)
 
void cairo_script_set_mode (cairo_device_t *script, cairo_script_mode_t mode)
 
cairo_script_mode_t cairo_script_get_mode (cairo_device_t *script)
 
cairo_surface_tcairo_script_surface_create (cairo_device_t *script, cairo_content_t content, double width, double height)
 
int _cairo_dummy_prototype (void)
 
cairo_surface_tcairo_script_surface_create_for_target (cairo_device_t *script, cairo_surface_t *target)
 
cairo_status_t cairo_script_from_recording_surface (cairo_device_t *script, cairo_surface_t *recording_surface)
 

Variables

static const cairo_surface_backend_t _cairo_script_surface_backend
 
static const cairo_surface_backend_t script_snapshot_backend
 
static const cairo_device_backend_t _cairo_script_device_backend
 

Macro Definition Documentation

◆ _cairo_output_stream_puts

#define _cairo_output_stream_puts (   S,
  STR 
)     _cairo_output_stream_write ((S), (STR), strlen (STR))

Definition at line 99 of file cairo-script-surface.c.

◆ static

#define static   cairo_warn static

Definition at line 102 of file cairo-script-surface.c.

◆ to_be32

#define to_be32 (   x)    bswap_32(x)

SECTION:cairo-script @Title: Script Surfaces @Short_Description: Rendering to replayable scripts @See_Also: cairo_surface_t

The script surface provides the ability to render to a native script that matches the cairo drawing model. The scripts can be replayed using tools under the util/cairo-script directory, or with cairo-perf-trace. CAIRO_HAS_SCRIPT_SURFACE:

Defined if the script surface backend is available. The script surface backend is always built in since 1.12.

Since: 1.12

Definition at line 96 of file cairo-script-surface.c.

Typedef Documentation

◆ cairo_script_context_t

Definition at line 1 of file cairo-script-surface.c.

◆ cairo_script_font_t

Definition at line 1 of file cairo-script-surface.c.

◆ cairo_script_implicit_context_t

◆ cairo_script_surface_t

Definition at line 1 of file cairo-script-surface.c.

◆ operand_t

typedef struct _operand operand_t

Function Documentation

◆ _antialias_to_string()

static const char* _antialias_to_string ( cairo_antialias_t  antialias)
static

Definition at line 385 of file cairo-script-surface.c.

References antialias, ARRAY_LENGTH, assert(), and fc-lang::names.

Referenced by _emit_antialias(), and _emit_font_options().

◆ _bitmap_fini()

static void _bitmap_fini ( struct _bitmap *  b)
static

Definition at line 283 of file cairo-script-surface.c.

References b, free, next, and NULL.

Referenced by _device_destroy().

◆ _bitmap_next_id()

static cairo_status_t _bitmap_next_id ( struct _bitmap *  b,
unsigned long *  id 
)
static

◆ _bitmap_release_id()

static void _bitmap_release_id ( struct _bitmap *  b,
unsigned long  token 
)
static

Definition at line 210 of file cairo-script-surface.c.

References b, CHAR_BIT, free, min, NULL, and prev.

Referenced by _cairo_script_scaled_font_fini().

◆ _cairo_dummy_prototype()

int _cairo_dummy_prototype ( void  )

◆ _cairo_script_context_attach_snapshots()

void _cairo_script_context_attach_snapshots ( cairo_device_t device,
cairo_bool_t  enable 
)

Definition at line 3718 of file cairo-script-surface.c.

References _cairo_script_context::attach_snapshots, and enable.

Referenced by _cairo_observation_print().

◆ _cairo_script_context_create()

◆ _cairo_script_context_create_internal()

◆ _cairo_script_font_get()

◆ _cairo_script_font_id()

static long unsigned _cairo_script_font_id ( cairo_script_context_t ctx,
cairo_scaled_font_t font 
)
static

◆ _cairo_script_implicit_context_init()

◆ _cairo_script_implicit_context_reset()

static void _cairo_script_implicit_context_reset ( cairo_script_implicit_context_t cr)
static

◆ _cairo_script_scaled_font_fini()

◆ _cairo_script_surface_acquire_source_image()

static cairo_status_t _cairo_script_surface_acquire_source_image ( void abstract_surface,
cairo_image_surface_t **  image_out,
void **  image_extra 
)
static

◆ _cairo_script_surface_clipper_intersect_clip_path()

◆ _cairo_script_surface_copy_page()

static cairo_int_status_t _cairo_script_surface_copy_page ( void abstract_surface)
static

◆ _cairo_script_surface_create_internal()

◆ _cairo_script_surface_create_similar()

◆ _cairo_script_surface_fill()

◆ _cairo_script_surface_finish()

◆ _cairo_script_surface_get_extents()

◆ _cairo_script_surface_has_show_text_glyphs()

static cairo_bool_t _cairo_script_surface_has_show_text_glyphs ( void abstract_surface)
static

Definition at line 2711 of file cairo-script-surface.c.

References TRUE.

◆ _cairo_script_surface_mask()

◆ _cairo_script_surface_paint()

◆ _cairo_script_surface_release_source_image()

static void _cairo_script_surface_release_source_image ( void abstract_surface,
cairo_image_surface_t image,
void image_extra 
)
static

◆ _cairo_script_surface_show_page()

static cairo_int_status_t _cairo_script_surface_show_page ( void abstract_surface)
static

◆ _cairo_script_surface_show_text_glyphs()

static cairo_int_status_t _cairo_script_surface_show_text_glyphs ( void abstract_surface,
cairo_operator_t  op,
const cairo_pattern_t source,
const char *  utf8,
int  utf8_len,
cairo_glyph_t glyphs,
int  num_glyphs,
const cairo_text_cluster_t clusters,
int  num_clusters,
cairo_text_cluster_flags_t  backward,
cairo_scaled_font_t scaled_font,
const cairo_clip_t clip 
)
static

◆ _cairo_script_surface_snapshot()

static cairo_surface_t* _cairo_script_surface_snapshot ( void abstract_surface)
static

◆ _cairo_script_surface_source()

static cairo_surface_t* _cairo_script_surface_source ( void abstract_surface,
cairo_rectangle_int_t extents 
)
static

Definition at line 2098 of file cairo-script-surface.c.

References surface.

◆ _cairo_script_surface_stroke()

◆ _content_to_string()

◆ _dashes_equal()

static cairo_bool_t _dashes_equal ( const double *  a,
const double *  b,
int  num_dashes 
)
static

Definition at line 768 of file cairo-script-surface.c.

References a, b, e, fabs, FALSE, and TRUE.

Referenced by _emit_dash().

◆ _device_destroy()

◆ _device_flush()

static cairo_status_t _device_flush ( void abstract_device)
static

◆ _direction_to_string()

static const char* _direction_to_string ( cairo_bool_t  backward)
static

Definition at line 293 of file cairo-script-surface.c.

References ARRAY_LENGTH, assert(), and fc-lang::names.

Referenced by _cairo_script_surface_show_text_glyphs().

◆ _emit_antialias()

◆ _emit_context()

◆ _emit_dash()

◆ _emit_fill_rule()

◆ _emit_font_matrix()

◆ _emit_font_options()

◆ _emit_gradient_color_stops()

◆ _emit_identity()

◆ _emit_image_surface()

◆ _emit_image_surface_pattern()

◆ _emit_line_cap()

◆ _emit_line_join()

◆ _emit_line_width()

static cairo_status_t _emit_line_width ( cairo_script_surface_t surface,
double  line_width,
cairo_bool_t  force 
)
static

◆ _emit_linear_pattern()

◆ _emit_mesh_pattern()

◆ _emit_miter_limit()

static cairo_status_t _emit_miter_limit ( cairo_script_surface_t surface,
double  miter_limit,
cairo_bool_t  force 
)
static

◆ _emit_operator()

◆ _emit_path()

◆ _emit_path_boxes()

◆ _emit_pattern()

◆ _emit_png_surface()

◆ _emit_radial_pattern()

◆ _emit_raster_pattern()

◆ _emit_recording_surface_pattern()

◆ _emit_scaled_font()

◆ _emit_scaled_font_init()

◆ _emit_scaled_glyph_bitmap()

◆ _emit_scaled_glyph_prologue()

◆ _emit_scaled_glyph_vector()

◆ _emit_scaled_glyphs()

◆ _emit_scaling_matrix()

◆ _emit_script_surface_pattern()

static cairo_status_t _emit_script_surface_pattern ( cairo_script_surface_t surface,
cairo_script_surface_t source 
)
static

Definition at line 1194 of file cairo-script-surface.c.

References _get_target(), and CAIRO_STATUS_SUCCESS.

Referenced by _emit_subsurface_pattern(), and _emit_surface_pattern().

◆ _emit_solid_pattern()

◆ _emit_source()

◆ _emit_string_literal()

◆ _emit_stroke_style()

◆ _emit_subsurface_pattern()

◆ _emit_surface()

◆ _emit_surface_pattern()

◆ _emit_tolerance()

◆ _emit_type42_font()

◆ _extend_to_string()

static const char* _extend_to_string ( cairo_extend_t  extend)
static

Definition at line 346 of file cairo-script-surface.c.

References ARRAY_LENGTH, assert(), extend, and fc-lang::names.

Referenced by _emit_pattern().

◆ _fill_rule_to_string()

static const char* _fill_rule_to_string ( cairo_fill_rule_t  rule)
static

Definition at line 374 of file cairo-script-surface.c.

References ARRAY_LENGTH, assert(), and fc-lang::names.

Referenced by _emit_fill_rule().

◆ _filter_to_string()

static const char* _filter_to_string ( cairo_filter_t  filter)
static

Definition at line 359 of file cairo-script-surface.c.

References ARRAY_LENGTH, assert(), filter, and fc-lang::names.

Referenced by _emit_pattern().

◆ _format_to_string()

◆ _get_target()

◆ _hint_metrics_to_string()

static const char* _hint_metrics_to_string ( cairo_hint_metrics_t  hint_metrics)
static

Definition at line 2741 of file cairo-script-surface.c.

References fc-lang::names.

Referenced by _emit_font_options().

◆ _hint_style_to_string()

static const char* _hint_style_to_string ( cairo_hint_style_t  hint_style)
static

Definition at line 2729 of file cairo-script-surface.c.

References fc-lang::names.

Referenced by _emit_font_options().

◆ _line_cap_to_string()

static const char* _line_cap_to_string ( cairo_line_cap_t  line_cap)
static

Definition at line 401 of file cairo-script-surface.c.

References ARRAY_LENGTH, assert(), and fc-lang::names.

Referenced by _emit_line_cap().

◆ _line_join_to_string()

static const char* _line_join_to_string ( cairo_line_join_t  line_join)
static

Definition at line 413 of file cairo-script-surface.c.

References ARRAY_LENGTH, assert(), and fc-lang::names.

Referenced by _emit_line_join().

◆ _operator_to_string()

static const char* _operator_to_string ( cairo_operator_t  op)
static

Definition at line 304 of file cairo-script-surface.c.

References ARRAY_LENGTH, assert(), fc-lang::names, and op.

Referenced by _emit_operator().

◆ _path_close()

static cairo_status_t _path_close ( void closure)
static

Definition at line 1808 of file cairo-script-surface.c.

References _cairo_output_stream_printf(), and CAIRO_STATUS_SUCCESS.

Referenced by _emit_path().

◆ _path_curve_to()

static cairo_status_t _path_curve_to ( void closure,
const cairo_point_t p1,
const cairo_point_t p2,
const cairo_point_t p3 
)
static

◆ _path_line_to()

static cairo_status_t _path_line_to ( void closure,
const cairo_point_t point 
)
static

◆ _path_move_to()

static cairo_status_t _path_move_to ( void closure,
const cairo_point_t point 
)
static

◆ _scaling_matrix_equal()

static cairo_bool_t _scaling_matrix_equal ( const cairo_matrix_t a,
const cairo_matrix_t b 
)
static

Definition at line 1924 of file cairo-script-surface.c.

References a, b, e, and fabs.

Referenced by _cairo_script_surface_stroke(), and _emit_scaling_matrix().

◆ _subpixel_order_to_string()

static const char* _subpixel_order_to_string ( cairo_subpixel_order_t  subpixel_order)
static

Definition at line 2717 of file cairo-script-surface.c.

References fc-lang::names.

Referenced by _emit_font_options().

◆ _write_image_surface()

◆ active()

◆ attach_snapshot()

◆ cairo_script_create()

cairo_device_t* cairo_script_create ( const char *  filename)

cairo_script_create: @filename: the name (path) of the file to write the script to

Creates a output device for emitting the script, used when creating the individual surfaces.

Return value: a pointer to the newly created device. The caller owns the surface and should call cairo_device_destroy() when done with it.

This function always returns a valid pointer, but it will return a pointer to a "nil" device if an error such as out of memory occurs. You can use cairo_device_status() to check for this.

Since: 1.12

Definition at line 3760 of file cairo-script-surface.c.

References _cairo_device_create_in_error(), _cairo_output_stream_create_for_filename(), _cairo_output_stream_get_status(), _cairo_script_context_create(), filename, and status.

◆ cairo_script_create_for_stream()

cairo_device_t* cairo_script_create_for_stream ( cairo_write_func_t  write_func,
void closure 
)

cairo_script_create_for_stream: @write_func: callback function passed the bytes written to the script @closure: user data to be passed to the callback

Creates a output device for emitting the script, used when creating the individual surfaces.

Return value: a pointer to the newly created device. The caller owns the surface and should call cairo_device_destroy() when done with it.

This function always returns a valid pointer, but it will return a pointer to a "nil" device if an error such as out of memory occurs. You can use cairo_device_status() to check for this.

Since: 1.12

Definition at line 3791 of file cairo-script-surface.c.

References _cairo_device_create_in_error(), _cairo_output_stream_create(), _cairo_output_stream_get_status(), _cairo_script_context_create(), NULL, and status.

◆ cairo_script_from_recording_surface()

cairo_status_t cairo_script_from_recording_surface ( cairo_device_t script,
cairo_surface_t recording_surface 
)

cairo_script_from_recording_surface: @script: the script (output device) @recording_surface: the recording surface to replay

Converts the record operations in @recording_surface into a script.

Return value: CAIRO_STATUS_SUCCESS on successful completion or an error code.

Since: 1.12

Definition at line 3969 of file cairo-script-surface.c.

References _cairo_error(), _cairo_recording_surface_get_bounds(), _cairo_recording_surface_replay(), _cairo_script_surface_create_internal(), _cairo_surface_is_recording(), _cairo_script_surface::base, CAIRO_DEVICE_TYPE_SCRIPT, CAIRO_STATUS_DEVICE_TYPE_MISMATCH, CAIRO_STATUS_SURFACE_TYPE_MISMATCH, cairo_surface_destroy(), _cairo_surface::content, NULL, r, script, _cairo_surface::status, status, surface, and unlikely.

◆ cairo_script_get_mode()

cairo_script_mode_t cairo_script_get_mode ( cairo_device_t script)

cairo_script_get_mode: @script: The script (output device) to query

Queries the script for its current output mode.

Return value: the current output mode of the script

Since: 1.12

Definition at line 3858 of file cairo-script-surface.c.

References script.

◆ cairo_script_set_mode()

void cairo_script_set_mode ( cairo_device_t script,
cairo_script_mode_t  mode 
)

cairo_script_set_mode: @script: The script (output device) @mode: the new mode

Change the output mode of the script

Since: 1.12

Definition at line 3839 of file cairo-script-surface.c.

References mode, and script.

◆ cairo_script_surface_create()

cairo_surface_t* cairo_script_surface_create ( cairo_device_t script,
cairo_content_t  content,
double  width,
double  height 
)

cairo_script_surface_create: @script: the script (output device) @content: the content of the surface @width: width in pixels @height: height in pixels

Create a new surface that will emit its rendering through @script

Return value: a pointer to the newly created surface. The caller owns the surface and should call cairo_surface_destroy() when done with it.

This function always returns a valid pointer, but it will return a pointer to a "nil" surface if an error such as out of memory occurs. You can use cairo_surface_status() to check for this.

Since: 1.12

Definition at line 3885 of file cairo-script-surface.c.

References _cairo_script_surface_create_internal(), _cairo_surface_create_in_error(), _cairo_script_surface::base, CAIRO_DEVICE_TYPE_SCRIPT, CAIRO_STATUS_DEVICE_TYPE_MISMATCH, check-c-linkage-decls::content, height, NULL, r, script, unlikely, and width.

◆ cairo_script_surface_create_for_target()

cairo_surface_t* cairo_script_surface_create_for_target ( cairo_device_t script,
cairo_surface_t target 
)

cairo_script_surface_create_for_target: @script: the script (output device) @target: a target surface to wrap

Create a pxoy surface that will render to @target and record the operations to @device.

Return value: a pointer to the newly created surface. The caller owns the surface and should call cairo_surface_destroy() when done with it.

This function always returns a valid pointer, but it will return a pointer to a "nil" surface if an error such as out of memory occurs. You can use cairo_surface_status() to check for this.

Since: 1.12

Definition at line 3930 of file cairo-script-surface.c.

References _cairo_script_surface_create_internal(), _cairo_surface_create_in_error(), _cairo_surface_get_extents(), _cairo_script_surface::base, CAIRO_DEVICE_TYPE_SCRIPT, CAIRO_STATUS_DEVICE_TYPE_MISMATCH, rect::height, NULL, r, script, target, unlikely, and rect::width.

◆ cairo_script_write_comment()

void cairo_script_write_comment ( cairo_device_t script,
const char *  comment,
int  len 
)

cairo_script_write_comment: @script: the script (output device) @comment: the string to emit @len:the length of the sting to write, or -1 to use strlen()

Emit a string verbatim into the script.

Since: 1.12

Definition at line 3815 of file cairo-script-surface.c.

References _cairo_output_stream_puts, _cairo_output_stream_write(), comment, len, script, and strlen().

◆ detach_snapshot()

static void detach_snapshot ( cairo_surface_t abstract_surface)
static

◆ inactive()

◆ script_snapshot_finish()

static cairo_status_t script_snapshot_finish ( void abstract_surface)
static

Definition at line 1078 of file cairo-script-surface.c.

References CAIRO_STATUS_SUCCESS.

◆ target_depth()

static int target_depth ( cairo_script_surface_t surface)
static

◆ target_is_active()

◆ target_push()

◆ to_context()

◆ to_octal()

static void to_octal ( int  value,
char *  buf,
size_t  size 
)
static

Definition at line 3223 of file cairo-script-surface.c.

References buf, and size.

Referenced by _emit_string_literal().

Variable Documentation

◆ _cairo_script_device_backend

const cairo_device_backend_t _cairo_script_device_backend
static
Initial value:
= {
NULL,
}
@ CAIRO_DEVICE_TYPE_SCRIPT
Definition: cairo.h:2166
static cairo_status_t _device_flush(void *abstract_device)
static void _device_destroy(void *abstract_device)
#define NULL
Definition: ftobjs.h:61

Definition at line 3681 of file cairo-script-surface.c.

Referenced by _cairo_script_context_create_internal().

◆ _cairo_script_surface_backend

static const cairo_surface_backend_t _cairo_script_surface_backend
static

Definition at line 191 of file cairo-script-surface.c.

Referenced by _cairo_script_surface_create_internal().

◆ script_snapshot_backend

const cairo_surface_backend_t script_snapshot_backend
static
Initial value:
= {
}
@ CAIRO_SURFACE_TYPE_SCRIPT
Definition: cairo.h:2412
static cairo_status_t script_snapshot_finish(void *abstract_surface)

Definition at line 1083 of file cairo-script-surface.c.

Referenced by _emit_image_surface(), _emit_recording_surface_pattern(), _emit_surface_pattern(), and attach_snapshot().