mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-05 08:48:00 +02:00
Implement cairo_backend_t
Allow a backend to completely reimplement the Cairo API as it wants. The goal is to pass operations to the native backends such as Quartz, Direct2D, Qt, Skia, OpenVG with no overhead. And to permit complete logging contexts, and whatever else the imagination holds. Perhaps to experiment with double-paths? Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
parent
2055732ffc
commit
83bfd85a13
52 changed files with 2323 additions and 811 deletions
|
|
@ -62,6 +62,7 @@ cairo_private = \
|
|||
cairo-combsort-private.h \
|
||||
cairo-compiler-private.h \
|
||||
cairo-composite-rectangles-private.h \
|
||||
cairo-default-context-private.h \
|
||||
cairo-device-private.h \
|
||||
cairo-error-private.h \
|
||||
cairo-fixed-private.h \
|
||||
|
|
@ -122,6 +123,7 @@ cairo_sources = \
|
|||
cairo-color.c \
|
||||
cairo-composite-rectangles.c \
|
||||
cairo-debug.c \
|
||||
cairo-default-context.c \
|
||||
cairo-device.c \
|
||||
cairo-error.c \
|
||||
cairo-fixed.c \
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@
|
|||
#include "cairoint.h"
|
||||
|
||||
#include "cairo-analysis-surface-private.h"
|
||||
#include "cairo-default-context-private.h"
|
||||
#include "cairo-error-private.h"
|
||||
#include "cairo-paginated-private.h"
|
||||
#include "cairo-recording-surface-private.h"
|
||||
|
|
@ -646,6 +647,8 @@ _cairo_analysis_surface_show_text_glyphs (void *abstract_surface,
|
|||
|
||||
static const cairo_surface_backend_t cairo_analysis_surface_backend = {
|
||||
CAIRO_INTERNAL_SURFACE_TYPE_ANALYSIS,
|
||||
NULL,
|
||||
|
||||
NULL, /* create_similar */
|
||||
_cairo_analysis_surface_finish,
|
||||
NULL, /* acquire_source_image */
|
||||
|
|
@ -843,6 +846,7 @@ typedef cairo_int_status_t
|
|||
|
||||
static const cairo_surface_backend_t cairo_null_surface_backend = {
|
||||
CAIRO_INTERNAL_SURFACE_TYPE_NULL,
|
||||
_cairo_default_context_create, /* XXX */
|
||||
|
||||
NULL, /* create_similar */
|
||||
NULL, /* finish */
|
||||
|
|
|
|||
170
src/cairo-backend-private.h
Normal file
170
src/cairo-backend-private.h
Normal file
|
|
@ -0,0 +1,170 @@
|
|||
/* cairo - a vector graphics library with display and print output
|
||||
*
|
||||
* Copyright © 2010 Intel Corporation
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it either under the terms of the GNU Lesser General Public
|
||||
* License version 2.1 as published by the Free Software Foundation
|
||||
* (the "LGPL") or, at your option, under the terms of the Mozilla
|
||||
* Public License Version 1.1 (the "MPL"). If you do not alter this
|
||||
* notice, a recipient may use your version of this file under either
|
||||
* the MPL or the LGPL.
|
||||
*
|
||||
* You should have received a copy of the LGPL along with this library
|
||||
* in the file COPYING-LGPL-2.1; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
* You should have received a copy of the MPL along with this library
|
||||
* in the file COPYING-MPL-1.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY
|
||||
* OF ANY KIND, either express or implied. See the LGPL or the MPL for
|
||||
* the specific language governing rights and limitations.
|
||||
*
|
||||
* The Original Code is the cairo graphics library.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Intel Corporation
|
||||
*
|
||||
* Contributor(s):
|
||||
* Chris Wilson <chris@chris-wilson.co.uk>
|
||||
*/
|
||||
|
||||
#ifndef CAIRO_BACKEND_PRIVATE_H
|
||||
#define CAIRO_BACKEND_PRIVATE_H
|
||||
|
||||
#include "cairo-types-private.h"
|
||||
|
||||
typedef enum _cairo_backend_type {
|
||||
CAIRO_TYPE_DEFAULT,
|
||||
} cairo_backend_type_t;
|
||||
|
||||
struct _cairo_backend {
|
||||
cairo_backend_type_t type;
|
||||
void (*destroy) (void *cr);
|
||||
|
||||
cairo_surface_t *(*get_original_target) (void *cr);
|
||||
cairo_surface_t *(*get_current_target) (void *cr);
|
||||
|
||||
cairo_status_t (*save) (void *cr);
|
||||
cairo_status_t (*restore) (void *cr);
|
||||
|
||||
cairo_status_t (*push_group) (void *cr, cairo_content_t content);
|
||||
cairo_pattern_t *(*pop_group) (void *cr);
|
||||
|
||||
cairo_status_t (*set_source_rgba) (void *cr, double red, double green, double blue, double alpha);
|
||||
cairo_status_t (*set_source_surface) (void *cr, cairo_surface_t *surface, double x, double y);
|
||||
cairo_status_t (*set_source) (void *cr, cairo_pattern_t *source);
|
||||
cairo_pattern_t *(*get_source) (void *cr);
|
||||
|
||||
cairo_status_t (*set_antialias) (void *cr, cairo_antialias_t antialias);
|
||||
cairo_status_t (*set_dash) (void *cr, const double *dashes, int num_dashes, double offset);
|
||||
cairo_status_t (*set_fill_rule) (void *cr, cairo_fill_rule_t fill_rule);
|
||||
cairo_status_t (*set_line_cap) (void *cr, cairo_line_cap_t line_cap);
|
||||
cairo_status_t (*set_line_join) (void *cr, cairo_line_join_t line_join);
|
||||
cairo_status_t (*set_line_width) (void *cr, double line_width);
|
||||
cairo_status_t (*set_miter_limit) (void *cr, double limit);
|
||||
cairo_status_t (*set_opacity) (void *cr, double opacity);
|
||||
cairo_status_t (*set_operator) (void *cr, cairo_operator_t op);
|
||||
cairo_status_t (*set_tolerance) (void *cr, double tolerance);
|
||||
|
||||
cairo_antialias_t (*get_antialias) (void *cr);
|
||||
void (*get_dash) (void *cr, double *dashes, int *num_dashes, double *offset);
|
||||
cairo_fill_rule_t (*get_fill_rule) (void *cr);
|
||||
cairo_line_cap_t (*get_line_cap) (void *cr);
|
||||
cairo_line_join_t (*get_line_join) (void *cr);
|
||||
double (*get_line_width) (void *cr);
|
||||
double (*get_miter_limit) (void *cr);
|
||||
double (*get_opacity) (void *cr);
|
||||
cairo_operator_t (*get_operator) (void *cr);
|
||||
double (*get_tolerance) (void *cr);
|
||||
|
||||
cairo_status_t (*translate) (void *cr, double tx, double ty);
|
||||
cairo_status_t (*scale) (void *cr, double sx, double sy);
|
||||
cairo_status_t (*rotate) (void *cr, double theta);
|
||||
cairo_status_t (*transform) (void *cr, const cairo_matrix_t *matrix);
|
||||
cairo_status_t (*set_matrix) (void *cr, const cairo_matrix_t *matrix);
|
||||
cairo_status_t (*set_identity_matrix) (void *cr);
|
||||
void (*get_matrix) (void *cr, cairo_matrix_t *matrix);
|
||||
|
||||
void (*user_to_device) (void *cr, double *x, double *y);
|
||||
void (*user_to_device_distance) (void *cr, double *x, double *y);
|
||||
void (*device_to_user) (void *cr, double *x, double *y);
|
||||
void (*device_to_user_distance) (void *cr, double *x, double *y);
|
||||
|
||||
cairo_status_t (*new_path) (void *cr);
|
||||
cairo_status_t (*new_sub_path) (void *cr);
|
||||
cairo_status_t (*move_to) (void *cr, double x, double y);
|
||||
cairo_status_t (*rel_move_to) (void *cr, double dx, double dy);
|
||||
cairo_status_t (*line_to) (void *cr, double x, double y);
|
||||
cairo_status_t (*rel_line_to) (void *cr, double dx, double dy);
|
||||
cairo_status_t (*curve_to) (void *cr, double x1, double y1, double x2, double y2, double x3, double y3);
|
||||
cairo_status_t (*rel_curve_to) (void *cr, double dx1, double dy1, double dx2, double dy2, double dx3, double dy3);
|
||||
cairo_status_t (*arc_to) (void *cr, double x1, double y1, double x2, double y2, double radius);
|
||||
cairo_status_t (*rel_arc_to) (void *cr, double dx1, double dy1, double dx2, double dy2, double radius);
|
||||
cairo_status_t (*close_path) (void *cr);
|
||||
|
||||
cairo_status_t (*arc) (void *cr, double xc, double yc, double radius, double angle1, double angle2, cairo_bool_t forward);
|
||||
cairo_status_t (*rectangle) (void *cr, double x, double y, double width, double height);
|
||||
|
||||
void (*path_extents) (void *cr, double *x1, double *y1, double *x2, double *y2);
|
||||
cairo_bool_t (*has_current_point) (void *cr);
|
||||
cairo_bool_t (*get_current_point) (void *cr, double *x, double *y);
|
||||
|
||||
cairo_path_t *(*copy_path) (void *cr);
|
||||
cairo_path_t *(*copy_path_flat) (void *cr);
|
||||
cairo_status_t (*append_path) (void *cr, const cairo_path_t *path);
|
||||
|
||||
cairo_status_t (*stroke_to_path) (void *cr);
|
||||
|
||||
cairo_status_t (*clip) (void *cr);
|
||||
cairo_status_t (*clip_preserve) (void *cr);
|
||||
cairo_status_t (*in_clip) (void *cr, double x, double y, cairo_bool_t *inside);
|
||||
cairo_status_t (*clip_extents) (void *cr, double *x1, double *y1, double *x2, double *y2);
|
||||
cairo_status_t (*reset_clip) (void *cr);
|
||||
cairo_rectangle_list_t *(*clip_copy_rectangle_list) (void *cr);
|
||||
|
||||
cairo_status_t (*paint) (void *cr);
|
||||
cairo_status_t (*paint_with_alpha) (void *cr, double opacity);
|
||||
cairo_status_t (*mask) (void *cr, cairo_pattern_t *pattern);
|
||||
|
||||
cairo_status_t (*stroke) (void *cr);
|
||||
cairo_status_t (*stroke_preserve) (void *cr);
|
||||
cairo_status_t (*in_stroke) (void *cr, double x, double y, cairo_bool_t *inside);
|
||||
cairo_status_t (*stroke_extents) (void *cr, double *x1, double *y1, double *x2, double *y2);
|
||||
|
||||
cairo_status_t (*fill) (void *cr);
|
||||
cairo_status_t (*fill_preserve) (void *cr);
|
||||
cairo_status_t (*in_fill) (void *cr, double x, double y, cairo_bool_t *inside);
|
||||
cairo_status_t (*fill_extents) (void *cr, double *x1, double *y1, double *x2, double *y2);
|
||||
|
||||
cairo_status_t (*set_font_face) (void *cr, cairo_font_face_t *font_face);
|
||||
cairo_font_face_t *(*get_font_face) (void *cr);
|
||||
cairo_status_t (*set_font_size) (void *cr, double size);
|
||||
cairo_status_t (*set_font_matrix) (void *cr, const cairo_matrix_t *matrix);
|
||||
void (*get_font_matrix) (void *cr, cairo_matrix_t *matrix);
|
||||
cairo_status_t (*set_font_options) (void *cr, const cairo_font_options_t *options);
|
||||
void (*get_font_options) (void *cr, cairo_font_options_t *options);
|
||||
cairo_status_t (*set_scaled_font) (void *cr, cairo_scaled_font_t *scaled_font);
|
||||
cairo_scaled_font_t *(*get_scaled_font) (void *cr);
|
||||
cairo_status_t (*font_extents) (void *cr, cairo_font_extents_t *extents);
|
||||
|
||||
cairo_status_t (*glyphs) (void *cr,
|
||||
const cairo_glyph_t *glyphs, int num_glyphs,
|
||||
cairo_glyph_text_info_t *info);
|
||||
cairo_status_t (*glyph_path) (void *cr,
|
||||
const cairo_glyph_t *glyphs, int num_glyphs);
|
||||
|
||||
cairo_status_t (*glyph_extents) (void *cr,
|
||||
const cairo_glyph_t *glyphs,
|
||||
int num_glyphs,
|
||||
cairo_text_extents_t *extents);
|
||||
|
||||
cairo_status_t (*copy_page) (void *cr);
|
||||
cairo_status_t (*show_page) (void *cr);
|
||||
};
|
||||
|
||||
#endif /* CAIRO_BACKEND_PRIVATE_H */
|
||||
|
|
@ -513,10 +513,13 @@ static cairo_status_t
|
|||
_cairo_clip_apply_clip_path (cairo_clip_t *clip,
|
||||
const cairo_clip_path_t *path)
|
||||
{
|
||||
cairo_status_t status;
|
||||
if (path->prev != NULL) {
|
||||
cairo_status_t status;
|
||||
|
||||
if (path->prev != NULL)
|
||||
status = _cairo_clip_apply_clip_path (clip, path->prev);
|
||||
if (unlikely (status))
|
||||
return status;
|
||||
}
|
||||
|
||||
return _cairo_clip_intersect_path (clip,
|
||||
&path->path,
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ cairo_debug_reset_static_data (void)
|
|||
_cairo_drm_device_reset_static_data ();
|
||||
#endif
|
||||
|
||||
_cairo_reset_static_data ();
|
||||
_cairo_default_context_reset_static_data ();
|
||||
|
||||
CAIRO_MUTEX_FINALIZE ();
|
||||
}
|
||||
|
|
|
|||
58
src/cairo-default-context-private.h
Normal file
58
src/cairo-default-context-private.h
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
/* cairo - a vector graphics library with display and print output
|
||||
*
|
||||
* Copyright © 2005 Red Hat, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it either under the terms of the GNU Lesser General Public
|
||||
* License version 2.1 as published by the Free Software Foundation
|
||||
* (the "LGPL") or, at your option, under the terms of the Mozilla
|
||||
* Public License Version 1.1 (the "MPL"). If you do not alter this
|
||||
* notice, a recipient may use your version of this file under either
|
||||
* the MPL or the LGPL.
|
||||
*
|
||||
* You should have received a copy of the LGPL along with this library
|
||||
* in the file COPYING-LGPL-2.1; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
* You should have received a copy of the MPL along with this library
|
||||
* in the file COPYING-MPL-1.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY
|
||||
* OF ANY KIND, either express or implied. See the LGPL or the MPL for
|
||||
* the specific language governing rights and limitations.
|
||||
*
|
||||
* The Original Code is the cairo graphics library.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Red Hat, Inc.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Carl D. Worth <cworth@redhat.com>
|
||||
*/
|
||||
|
||||
#ifndef CAIRO_DEFAULT_CONTEXT_PRIVATE_H
|
||||
#define CAIRO_DEFAULT_CONTEXT_PRIVATE_H
|
||||
|
||||
#include "cairo-private.h"
|
||||
#include "cairo-gstate-private.h"
|
||||
#include "cairo-path-fixed-private.h"
|
||||
|
||||
typedef struct _cairo_default_context cairo_default_context_t;
|
||||
|
||||
struct _cairo_default_context {
|
||||
cairo_t base;
|
||||
|
||||
cairo_gstate_t *gstate;
|
||||
cairo_gstate_t gstate_tail[2];
|
||||
cairo_gstate_t *gstate_freelist;
|
||||
|
||||
cairo_path_fixed_t path[1];
|
||||
};
|
||||
|
||||
cairo_private cairo_t *
|
||||
_cairo_default_context_create (void *target);
|
||||
|
||||
#endif /* CAIRO_DEFAULT_CONTEXT_PRIVATE_H */
|
||||
1406
src/cairo-default-context.c
Normal file
1406
src/cairo-default-context.c
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -39,6 +39,7 @@
|
|||
#include "cairo-directfb.h"
|
||||
|
||||
#include "cairo-clip-private.h"
|
||||
#include "cairo-default-context-private.h"
|
||||
#include "cairo-error-private.h"
|
||||
|
||||
#include <pixman.h>
|
||||
|
|
@ -1827,6 +1828,8 @@ _cairo_directfb_surface_is_similar (void *surface_a, void *surface_b)
|
|||
static cairo_surface_backend_t
|
||||
_cairo_directfb_surface_backend = {
|
||||
CAIRO_SURFACE_TYPE_DIRECTFB, /*type*/
|
||||
_cairo_default_context_create,
|
||||
|
||||
_cairo_directfb_surface_create_similar,/*create_similar*/
|
||||
_cairo_directfb_surface_finish, /*finish*/
|
||||
_cairo_directfb_surface_acquire_source_image,/*acquire_source_image*/
|
||||
|
|
|
|||
|
|
@ -41,6 +41,7 @@
|
|||
#include "cairoint.h"
|
||||
|
||||
#include "cairo-composite-rectangles-private.h"
|
||||
#include "cairo-default-context-private.h"
|
||||
#include "cairo-error-private.h"
|
||||
#include "cairo-gl-private.h"
|
||||
|
||||
|
|
@ -1839,6 +1840,8 @@ _cairo_gl_surface_fill (void *abstract_surface,
|
|||
|
||||
const cairo_surface_backend_t _cairo_gl_surface_backend = {
|
||||
CAIRO_SURFACE_TYPE_GL,
|
||||
_cairo_default_context_create,
|
||||
|
||||
_cairo_gl_surface_create_similar,
|
||||
_cairo_gl_surface_finish,
|
||||
|
||||
|
|
|
|||
|
|
@ -41,6 +41,7 @@
|
|||
struct _cairo_gstate {
|
||||
cairo_operator_t op;
|
||||
|
||||
double opacity;
|
||||
double tolerance;
|
||||
cairo_antialias_t antialias;
|
||||
|
||||
|
|
@ -114,6 +115,12 @@ _cairo_gstate_set_operator (cairo_gstate_t *gstate, cairo_operator_t op);
|
|||
cairo_private cairo_operator_t
|
||||
_cairo_gstate_get_operator (cairo_gstate_t *gstate);
|
||||
|
||||
cairo_private cairo_status_t
|
||||
_cairo_gstate_set_opacity (cairo_gstate_t *gstate, double opacity);
|
||||
|
||||
cairo_private double
|
||||
_cairo_gstate_get_opacity (cairo_gstate_t *gstate);
|
||||
|
||||
cairo_private cairo_status_t
|
||||
_cairo_gstate_set_tolerance (cairo_gstate_t *gstate, double tolerance);
|
||||
|
||||
|
|
@ -289,10 +296,16 @@ cairo_private cairo_rectangle_list_t*
|
|||
_cairo_gstate_copy_clip_rectangle_list (cairo_gstate_t *gstate);
|
||||
|
||||
cairo_private cairo_status_t
|
||||
_cairo_gstate_select_font_face (cairo_gstate_t *gstate,
|
||||
const char *family,
|
||||
cairo_font_slant_t slant,
|
||||
cairo_font_weight_t weight);
|
||||
_cairo_gstate_show_surface (cairo_gstate_t *gstate,
|
||||
cairo_surface_t *surface,
|
||||
double x,
|
||||
double y,
|
||||
double width,
|
||||
double height);
|
||||
|
||||
cairo_private cairo_status_t
|
||||
_cairo_gstate_set_font_size (cairo_gstate_t *gstate,
|
||||
double size);
|
||||
|
||||
cairo_private void
|
||||
_cairo_gstate_get_font_matrix (cairo_gstate_t *gstate,
|
||||
|
|
@ -326,18 +339,6 @@ cairo_private cairo_status_t
|
|||
_cairo_gstate_set_font_face (cairo_gstate_t *gstate,
|
||||
cairo_font_face_t *font_face);
|
||||
|
||||
cairo_private cairo_status_t
|
||||
_cairo_gstate_text_to_glyphs (cairo_gstate_t *gstate,
|
||||
double x,
|
||||
double y,
|
||||
const char *utf8,
|
||||
int utf8_len,
|
||||
cairo_glyph_t **glyphs,
|
||||
int *num_glyphs,
|
||||
cairo_text_cluster_t **clusters,
|
||||
int *num_clusters,
|
||||
cairo_text_cluster_flags_t *cluster_flags);
|
||||
|
||||
cairo_private cairo_status_t
|
||||
_cairo_gstate_glyph_extents (cairo_gstate_t *gstate,
|
||||
const cairo_glyph_t *glyphs,
|
||||
|
|
@ -346,13 +347,9 @@ _cairo_gstate_glyph_extents (cairo_gstate_t *gstate,
|
|||
|
||||
cairo_private cairo_status_t
|
||||
_cairo_gstate_show_text_glyphs (cairo_gstate_t *gstate,
|
||||
const char *utf8,
|
||||
int utf8_len,
|
||||
const cairo_glyph_t *glyphs,
|
||||
int num_glyphs,
|
||||
const cairo_text_cluster_t *clusters,
|
||||
int num_clusters,
|
||||
cairo_text_cluster_flags_t cluster_flags);
|
||||
cairo_glyph_text_info_t *info);
|
||||
|
||||
cairo_private cairo_status_t
|
||||
_cairo_gstate_glyph_path (cairo_gstate_t *gstate,
|
||||
|
|
|
|||
|
|
@ -91,6 +91,7 @@ _cairo_gstate_init (cairo_gstate_t *gstate,
|
|||
gstate->next = NULL;
|
||||
|
||||
gstate->op = CAIRO_GSTATE_OPERATOR_DEFAULT;
|
||||
gstate->opacity = 1.;
|
||||
|
||||
gstate->tolerance = CAIRO_GSTATE_TOLERANCE_DEFAULT;
|
||||
gstate->antialias = CAIRO_ANTIALIAS_DEFAULT;
|
||||
|
|
@ -147,6 +148,7 @@ _cairo_gstate_init_copy (cairo_gstate_t *gstate, cairo_gstate_t *other)
|
|||
VG (VALGRIND_MAKE_MEM_UNDEFINED (gstate, sizeof (cairo_gstate_t)));
|
||||
|
||||
gstate->op = other->op;
|
||||
gstate->opacity = other->opacity;
|
||||
|
||||
gstate->tolerance = other->tolerance;
|
||||
gstate->antialias = other->antialias;
|
||||
|
|
@ -428,6 +430,20 @@ _cairo_gstate_get_operator (cairo_gstate_t *gstate)
|
|||
return gstate->op;
|
||||
}
|
||||
|
||||
cairo_status_t
|
||||
_cairo_gstate_set_opacity (cairo_gstate_t *gstate, double op)
|
||||
{
|
||||
gstate->opacity = op;
|
||||
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
double
|
||||
_cairo_gstate_get_opacity (cairo_gstate_t *gstate)
|
||||
{
|
||||
return gstate->opacity;
|
||||
}
|
||||
|
||||
cairo_status_t
|
||||
_cairo_gstate_set_tolerance (cairo_gstate_t *gstate, double tolerance)
|
||||
{
|
||||
|
|
@ -1066,6 +1082,8 @@ _cairo_gstate_mask (cairo_gstate_t *gstate,
|
|||
if (_clipped (gstate))
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
|
||||
assert (gstate->opacity == 1.0);
|
||||
|
||||
if (_cairo_pattern_is_opaque (mask, NULL))
|
||||
return _cairo_gstate_paint (gstate);
|
||||
|
||||
|
|
@ -1143,6 +1161,8 @@ _cairo_gstate_stroke (cairo_gstate_t *gstate, cairo_path_fixed_t *path)
|
|||
if (_clipped (gstate))
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
|
||||
assert (gstate->opacity == 1.0);
|
||||
|
||||
memcpy (&style, &gstate->stroke_style, sizeof (gstate->stroke_style));
|
||||
if (_cairo_stroke_style_dash_can_approximate (&gstate->stroke_style, &gstate->ctm, gstate->tolerance)) {
|
||||
style.dash = dash;
|
||||
|
|
@ -1243,6 +1263,8 @@ _cairo_gstate_fill (cairo_gstate_t *gstate, cairo_path_fixed_t *path)
|
|||
if (_clipped (gstate))
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
|
||||
assert (gstate->opacity == 1.0);
|
||||
|
||||
if (_cairo_path_fixed_fill_is_empty (path)) {
|
||||
if (_cairo_operator_bounded_by_mask (gstate->op))
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
|
|
@ -1580,22 +1602,14 @@ _cairo_gstate_unset_scaled_font (cairo_gstate_t *gstate)
|
|||
}
|
||||
|
||||
cairo_status_t
|
||||
_cairo_gstate_select_font_face (cairo_gstate_t *gstate,
|
||||
const char *family,
|
||||
cairo_font_slant_t slant,
|
||||
cairo_font_weight_t weight)
|
||||
_cairo_gstate_set_font_size (cairo_gstate_t *gstate,
|
||||
double size)
|
||||
{
|
||||
cairo_font_face_t *font_face;
|
||||
cairo_status_t status;
|
||||
_cairo_gstate_unset_scaled_font (gstate);
|
||||
|
||||
font_face = cairo_toy_font_face_create (family, slant, weight);
|
||||
if (font_face->status)
|
||||
return font_face->status;
|
||||
cairo_matrix_init_scale (&gstate->font_matrix, size, size);
|
||||
|
||||
status = _cairo_gstate_set_font_face (gstate, font_face);
|
||||
cairo_font_face_destroy (font_face);
|
||||
|
||||
return status;
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
cairo_status_t
|
||||
|
|
@ -1809,31 +1823,6 @@ _cairo_gstate_get_font_extents (cairo_gstate_t *gstate,
|
|||
return cairo_scaled_font_status (gstate->scaled_font);
|
||||
}
|
||||
|
||||
cairo_status_t
|
||||
_cairo_gstate_text_to_glyphs (cairo_gstate_t *gstate,
|
||||
double x,
|
||||
double y,
|
||||
const char *utf8,
|
||||
int utf8_len,
|
||||
cairo_glyph_t **glyphs,
|
||||
int *num_glyphs,
|
||||
cairo_text_cluster_t **clusters,
|
||||
int *num_clusters,
|
||||
cairo_text_cluster_flags_t *cluster_flags)
|
||||
{
|
||||
cairo_status_t status;
|
||||
|
||||
status = _cairo_gstate_ensure_scaled_font (gstate);
|
||||
if (unlikely (status))
|
||||
return status;
|
||||
|
||||
return cairo_scaled_font_text_to_glyphs (gstate->scaled_font, x, y,
|
||||
utf8, utf8_len,
|
||||
glyphs, num_glyphs,
|
||||
clusters, num_clusters,
|
||||
cluster_flags);
|
||||
}
|
||||
|
||||
cairo_status_t
|
||||
_cairo_gstate_set_font_face (cairo_gstate_t *gstate,
|
||||
cairo_font_face_t *font_face)
|
||||
|
|
@ -1873,20 +1862,16 @@ _cairo_gstate_glyph_extents (cairo_gstate_t *gstate,
|
|||
|
||||
cairo_status_t
|
||||
_cairo_gstate_show_text_glyphs (cairo_gstate_t *gstate,
|
||||
const char *utf8,
|
||||
int utf8_len,
|
||||
const cairo_glyph_t *glyphs,
|
||||
int num_glyphs,
|
||||
const cairo_text_cluster_t *clusters,
|
||||
int num_clusters,
|
||||
cairo_text_cluster_flags_t cluster_flags)
|
||||
cairo_glyph_text_info_t *info)
|
||||
{
|
||||
cairo_pattern_union_t source_pattern;
|
||||
const cairo_pattern_t *pattern;
|
||||
cairo_glyph_t stack_transformed_glyphs[CAIRO_STACK_ARRAY_LENGTH (cairo_glyph_t)];
|
||||
cairo_glyph_t *transformed_glyphs;
|
||||
cairo_text_cluster_t stack_transformed_clusters[CAIRO_STACK_ARRAY_LENGTH (cairo_text_cluster_t)];
|
||||
cairo_text_cluster_t *transformed_clusters;
|
||||
cairo_text_cluster_t *transformed_clusters = NULL;
|
||||
cairo_operator_t op;
|
||||
cairo_status_t status;
|
||||
cairo_clip_t clip;
|
||||
|
|
@ -1906,8 +1891,6 @@ _cairo_gstate_show_text_glyphs (cairo_gstate_t *gstate,
|
|||
return status;
|
||||
|
||||
transformed_glyphs = stack_transformed_glyphs;
|
||||
transformed_clusters = stack_transformed_clusters;
|
||||
|
||||
if (num_glyphs > ARRAY_LENGTH (stack_transformed_glyphs)) {
|
||||
transformed_glyphs = cairo_glyph_allocate (num_glyphs);
|
||||
if (unlikely (transformed_glyphs == NULL)) {
|
||||
|
|
@ -1916,26 +1899,32 @@ _cairo_gstate_show_text_glyphs (cairo_gstate_t *gstate,
|
|||
}
|
||||
}
|
||||
|
||||
/* Just in case */
|
||||
if (!clusters)
|
||||
num_clusters = 0;
|
||||
|
||||
if (num_clusters > ARRAY_LENGTH (stack_transformed_clusters)) {
|
||||
transformed_clusters = cairo_text_cluster_allocate (num_clusters);
|
||||
if (unlikely (transformed_clusters == NULL)) {
|
||||
status = _cairo_error (CAIRO_STATUS_NO_MEMORY);
|
||||
goto CLEANUP_GLYPHS;
|
||||
if (info != NULL) {
|
||||
transformed_clusters = stack_transformed_clusters;
|
||||
if (info->num_clusters > ARRAY_LENGTH (stack_transformed_clusters)) {
|
||||
transformed_clusters = cairo_text_cluster_allocate (info->num_clusters);
|
||||
if (unlikely (transformed_clusters == NULL)) {
|
||||
status = _cairo_error (CAIRO_STATUS_NO_MEMORY);
|
||||
goto CLEANUP_GLYPHS;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
status = _cairo_gstate_transform_glyphs_to_backend (gstate,
|
||||
glyphs, num_glyphs,
|
||||
clusters,
|
||||
num_clusters,
|
||||
cluster_flags,
|
||||
transformed_glyphs,
|
||||
&num_glyphs,
|
||||
transformed_clusters);
|
||||
status = _cairo_gstate_transform_glyphs_to_backend (gstate,
|
||||
glyphs, num_glyphs,
|
||||
info->clusters,
|
||||
info->num_clusters,
|
||||
info->cluster_flags,
|
||||
transformed_glyphs,
|
||||
&num_glyphs,
|
||||
transformed_clusters);
|
||||
} else {
|
||||
status = _cairo_gstate_transform_glyphs_to_backend (gstate,
|
||||
glyphs, num_glyphs,
|
||||
NULL, 0, 0,
|
||||
transformed_glyphs,
|
||||
&num_glyphs,
|
||||
NULL);
|
||||
}
|
||||
|
||||
if (status || num_glyphs == 0)
|
||||
goto CLEANUP_GLYPHS;
|
||||
|
|
@ -1961,13 +1950,22 @@ _cairo_gstate_show_text_glyphs (cairo_gstate_t *gstate,
|
|||
if (cairo_surface_has_show_text_glyphs (gstate->target) ||
|
||||
_cairo_scaled_font_get_max_scale (gstate->scaled_font) <= 10240)
|
||||
{
|
||||
status = _cairo_surface_show_text_glyphs (gstate->target, op, pattern,
|
||||
utf8, utf8_len,
|
||||
transformed_glyphs, num_glyphs,
|
||||
transformed_clusters, num_clusters,
|
||||
cluster_flags,
|
||||
gstate->scaled_font,
|
||||
_gstate_get_clip (gstate, &clip));
|
||||
if (info != NULL) {
|
||||
status = _cairo_surface_show_text_glyphs (gstate->target, op, pattern,
|
||||
info->utf8, info->utf8_len,
|
||||
transformed_glyphs, num_glyphs,
|
||||
transformed_clusters, info->num_clusters,
|
||||
info->cluster_flags,
|
||||
gstate->scaled_font,
|
||||
_gstate_get_clip (gstate, &clip));
|
||||
} else {
|
||||
status = _cairo_surface_show_text_glyphs (gstate->target, op, pattern,
|
||||
NULL, 0,
|
||||
transformed_glyphs, num_glyphs,
|
||||
NULL, 0, 0,
|
||||
gstate->scaled_font,
|
||||
_gstate_get_clip (gstate, &clip));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -2028,7 +2026,7 @@ _cairo_gstate_glyph_path (cairo_gstate_t *gstate,
|
|||
glyphs, num_glyphs,
|
||||
NULL, 0, 0,
|
||||
transformed_glyphs,
|
||||
NULL, NULL);
|
||||
&num_glyphs, NULL);
|
||||
if (unlikely (status))
|
||||
goto CLEANUP_GLYPHS;
|
||||
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@
|
|||
#include "cairo-boxes-private.h"
|
||||
#include "cairo-clip-private.h"
|
||||
#include "cairo-composite-rectangles-private.h"
|
||||
#include "cairo-default-context-private.h"
|
||||
#include "cairo-error-private.h"
|
||||
#include "cairo-region-private.h"
|
||||
#include "cairo-scaled-font-private.h"
|
||||
|
|
@ -4601,6 +4602,8 @@ _cairo_surface_is_image (const cairo_surface_t *surface)
|
|||
|
||||
const cairo_surface_backend_t _cairo_image_surface_backend = {
|
||||
CAIRO_SURFACE_TYPE_IMAGE,
|
||||
_cairo_default_context_create,
|
||||
|
||||
_cairo_image_surface_create_similar,
|
||||
_cairo_image_surface_finish,
|
||||
_cairo_image_surface_acquire_source_image,
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@
|
|||
#include "cairoint.h"
|
||||
|
||||
#include "cairo-os2-private.h"
|
||||
#include "cairo-default-context-private.h"
|
||||
#include "cairo-error-private.h"
|
||||
|
||||
#if CAIRO_HAS_FC_FONT
|
||||
|
|
@ -1438,6 +1439,8 @@ _cairo_os2_surface_mark_dirty_rectangle (void *surface,
|
|||
|
||||
static const cairo_surface_backend_t cairo_os2_surface_backend = {
|
||||
CAIRO_SURFACE_TYPE_OS2,
|
||||
_cairo_default_context_create,
|
||||
|
||||
NULL, /* create_similar */
|
||||
_cairo_os2_surface_finish,
|
||||
_cairo_os2_surface_acquire_source_image,
|
||||
|
|
|
|||
|
|
@ -641,8 +641,17 @@ _cairo_paginated_surface_snapshot (void *abstract_other)
|
|||
return _cairo_surface_snapshot (other->recording_surface);
|
||||
}
|
||||
|
||||
static cairo_t *
|
||||
_cairo_paginated_context_create (void *target)
|
||||
{
|
||||
cairo_paginated_surface_t *surface = target;
|
||||
return cairo_create (surface->recording_surface);
|
||||
}
|
||||
|
||||
static const cairo_surface_backend_t cairo_paginated_surface_backend = {
|
||||
CAIRO_INTERNAL_SURFACE_TYPE_PAGINATED,
|
||||
_cairo_paginated_context_create,
|
||||
|
||||
_cairo_paginated_surface_create_similar,
|
||||
_cairo_paginated_surface_finish,
|
||||
_cairo_paginated_surface_acquire_source_image,
|
||||
|
|
|
|||
|
|
@ -41,11 +41,11 @@
|
|||
|
||||
cairo_private cairo_path_t *
|
||||
_cairo_path_create (cairo_path_fixed_t *path,
|
||||
cairo_gstate_t *gstate);
|
||||
cairo_t *cr);
|
||||
|
||||
cairo_private cairo_path_t *
|
||||
_cairo_path_create_flat (cairo_path_fixed_t *path,
|
||||
cairo_gstate_t *gstate);
|
||||
cairo_t *cr);
|
||||
|
||||
cairo_private cairo_path_t *
|
||||
_cairo_path_create_in_error (cairo_status_t status);
|
||||
|
|
|
|||
|
|
@ -1382,7 +1382,7 @@ BAIL:
|
|||
return status;
|
||||
}
|
||||
|
||||
cairo_status_t
|
||||
cairo_int_status_t
|
||||
_cairo_path_fixed_stroke_to_traps (const cairo_path_fixed_t *path,
|
||||
const cairo_stroke_style_t *stroke_style,
|
||||
const cairo_matrix_t *ctm,
|
||||
|
|
@ -1390,7 +1390,7 @@ _cairo_path_fixed_stroke_to_traps (const cairo_path_fixed_t *path,
|
|||
double tolerance,
|
||||
cairo_traps_t *traps)
|
||||
{
|
||||
cairo_status_t status;
|
||||
cairo_int_status_t status;
|
||||
cairo_polygon_t polygon;
|
||||
|
||||
/* Before we do anything else, we attempt the rectilinear
|
||||
|
|
|
|||
|
|
@ -138,7 +138,7 @@ _cairo_path_count (cairo_path_t *path,
|
|||
/* Closure for path interpretation. */
|
||||
typedef struct cairo_path_populate {
|
||||
cairo_path_data_t *data;
|
||||
cairo_gstate_t *gstate;
|
||||
cairo_t *cr;
|
||||
} cpp_t;
|
||||
|
||||
static cairo_status_t
|
||||
|
|
@ -152,7 +152,7 @@ _cpp_move_to (void *closure,
|
|||
x = _cairo_fixed_to_double (point->x);
|
||||
y = _cairo_fixed_to_double (point->y);
|
||||
|
||||
_cairo_gstate_backend_to_user (cpp->gstate, &x, &y);
|
||||
cairo_device_to_user (cpp->cr, &x, &y);
|
||||
|
||||
data->header.type = CAIRO_PATH_MOVE_TO;
|
||||
data->header.length = 2;
|
||||
|
|
@ -177,7 +177,7 @@ _cpp_line_to (void *closure,
|
|||
x = _cairo_fixed_to_double (point->x);
|
||||
y = _cairo_fixed_to_double (point->y);
|
||||
|
||||
_cairo_gstate_backend_to_user (cpp->gstate, &x, &y);
|
||||
cairo_device_to_user (cpp->cr, &x, &y);
|
||||
|
||||
data->header.type = CAIRO_PATH_LINE_TO;
|
||||
data->header.length = 2;
|
||||
|
|
@ -205,15 +205,15 @@ _cpp_curve_to (void *closure,
|
|||
|
||||
x1 = _cairo_fixed_to_double (p1->x);
|
||||
y1 = _cairo_fixed_to_double (p1->y);
|
||||
_cairo_gstate_backend_to_user (cpp->gstate, &x1, &y1);
|
||||
cairo_device_to_user (cpp->cr, &x1, &y1);
|
||||
|
||||
x2 = _cairo_fixed_to_double (p2->x);
|
||||
y2 = _cairo_fixed_to_double (p2->y);
|
||||
_cairo_gstate_backend_to_user (cpp->gstate, &x2, &y2);
|
||||
cairo_device_to_user (cpp->cr, &x2, &y2);
|
||||
|
||||
x3 = _cairo_fixed_to_double (p3->x);
|
||||
y3 = _cairo_fixed_to_double (p3->y);
|
||||
_cairo_gstate_backend_to_user (cpp->gstate, &x3, &y3);
|
||||
cairo_device_to_user (cpp->cr, &x3, &y3);
|
||||
|
||||
data->header.type = CAIRO_PATH_CURVE_TO;
|
||||
data->header.length = 4;
|
||||
|
|
@ -250,23 +250,22 @@ _cpp_close_path (void *closure)
|
|||
static cairo_status_t
|
||||
_cairo_path_populate (cairo_path_t *path,
|
||||
cairo_path_fixed_t *path_fixed,
|
||||
cairo_gstate_t *gstate,
|
||||
cairo_t *cr,
|
||||
cairo_bool_t flatten)
|
||||
{
|
||||
cairo_status_t status;
|
||||
cpp_t cpp;
|
||||
|
||||
cpp.data = path->data;
|
||||
cpp.gstate = gstate;
|
||||
cpp.cr = cr;
|
||||
|
||||
if (flatten) {
|
||||
double tolerance = _cairo_gstate_get_tolerance (gstate);
|
||||
status = _cairo_path_fixed_interpret_flat (path_fixed,
|
||||
_cpp_move_to,
|
||||
_cpp_line_to,
|
||||
_cpp_close_path,
|
||||
&cpp,
|
||||
tolerance);
|
||||
cairo_get_tolerance (cr));
|
||||
} else {
|
||||
status = _cairo_path_fixed_interpret (path_fixed,
|
||||
_cpp_move_to,
|
||||
|
|
@ -309,7 +308,7 @@ _cairo_path_create_in_error (cairo_status_t status)
|
|||
|
||||
static cairo_path_t *
|
||||
_cairo_path_create_internal (cairo_path_fixed_t *path_fixed,
|
||||
cairo_gstate_t *gstate,
|
||||
cairo_t *cr,
|
||||
cairo_bool_t flatten)
|
||||
{
|
||||
cairo_path_t *path;
|
||||
|
|
@ -321,7 +320,7 @@ _cairo_path_create_internal (cairo_path_fixed_t *path_fixed,
|
|||
}
|
||||
|
||||
path->num_data = _cairo_path_count (path, path_fixed,
|
||||
_cairo_gstate_get_tolerance (gstate),
|
||||
cairo_get_tolerance (cr),
|
||||
flatten);
|
||||
if (path->num_data < 0) {
|
||||
free (path);
|
||||
|
|
@ -337,8 +336,7 @@ _cairo_path_create_internal (cairo_path_fixed_t *path_fixed,
|
|||
return (cairo_path_t*) &_cairo_path_nil;
|
||||
}
|
||||
|
||||
path->status = _cairo_path_populate (path, path_fixed,
|
||||
gstate, flatten);
|
||||
path->status = _cairo_path_populate (path, path_fixed, cr, flatten);
|
||||
} else {
|
||||
path->data = NULL;
|
||||
path->status = CAIRO_STATUS_SUCCESS;
|
||||
|
|
@ -377,10 +375,10 @@ slim_hidden_def (cairo_path_destroy);
|
|||
/**
|
||||
* _cairo_path_create:
|
||||
* @path: a fixed-point, device-space path to be converted and copied
|
||||
* @gstate: the current graphics state
|
||||
* @cr: the current graphics context
|
||||
*
|
||||
* Creates a user-space #cairo_path_t copy of the given device-space
|
||||
* @path. The @gstate parameter provides the inverse CTM for the
|
||||
* @path. The @cr parameter provides the inverse CTM for the
|
||||
* conversion.
|
||||
*
|
||||
* Return value: the new copy of the path. If there is insufficient
|
||||
|
|
@ -389,19 +387,19 @@ slim_hidden_def (cairo_path_destroy);
|
|||
* data==%NULL.
|
||||
**/
|
||||
cairo_path_t *
|
||||
_cairo_path_create (cairo_path_fixed_t *path,
|
||||
cairo_gstate_t *gstate)
|
||||
_cairo_path_create (cairo_path_fixed_t *path,
|
||||
cairo_t *cr)
|
||||
{
|
||||
return _cairo_path_create_internal (path, gstate, FALSE);
|
||||
return _cairo_path_create_internal (path, cr, FALSE);
|
||||
}
|
||||
|
||||
/**
|
||||
* _cairo_path_create_flat:
|
||||
* @path: a fixed-point, device-space path to be flattened, converted and copied
|
||||
* @gstate: the current graphics state
|
||||
* @cr: the current graphics context
|
||||
*
|
||||
* Creates a flattened, user-space #cairo_path_t copy of the given
|
||||
* device-space @path. The @gstate parameter provide the inverse CTM
|
||||
* device-space @path. The @cr parameter provide the inverse CTM
|
||||
* for the conversion, as well as the tolerance value to control the
|
||||
* accuracy of the flattening.
|
||||
*
|
||||
|
|
@ -412,9 +410,9 @@ _cairo_path_create (cairo_path_fixed_t *path,
|
|||
**/
|
||||
cairo_path_t *
|
||||
_cairo_path_create_flat (cairo_path_fixed_t *path,
|
||||
cairo_gstate_t *gstate)
|
||||
cairo_t *cr)
|
||||
{
|
||||
return _cairo_path_create_internal (path, gstate, TRUE);
|
||||
return _cairo_path_create_internal (path, cr, TRUE);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -432,17 +430,6 @@ _cairo_path_append_to_context (const cairo_path_t *path,
|
|||
cairo_t *cr)
|
||||
{
|
||||
const cairo_path_data_t *p, *end;
|
||||
cairo_fixed_t x1_fixed, y1_fixed;
|
||||
cairo_fixed_t x2_fixed, y2_fixed;
|
||||
cairo_fixed_t x3_fixed, y3_fixed;
|
||||
cairo_matrix_t user_to_backend;
|
||||
cairo_status_t status;
|
||||
double x, y;
|
||||
|
||||
user_to_backend = cr->gstate->ctm;
|
||||
cairo_matrix_multiply (&user_to_backend,
|
||||
&user_to_backend,
|
||||
&cr->gstate->target->device_transform);
|
||||
|
||||
end = &path->data[path->num_data];
|
||||
for (p = &path->data[0]; p < end; p += p->header.length) {
|
||||
|
|
@ -451,64 +438,39 @@ _cairo_path_append_to_context (const cairo_path_t *path,
|
|||
if (unlikely (p->header.length < 2))
|
||||
return _cairo_error (CAIRO_STATUS_INVALID_PATH_DATA);
|
||||
|
||||
x = p[1].point.x, y = p[1].point.y;
|
||||
cairo_matrix_transform_point (&user_to_backend, &x, &y);
|
||||
x1_fixed = _cairo_fixed_from_double (x);
|
||||
y1_fixed = _cairo_fixed_from_double (y);
|
||||
|
||||
status = _cairo_path_fixed_move_to (cr->path, x1_fixed, y1_fixed);
|
||||
cairo_move_to (cr, p[1].point.x, p[1].point.y);
|
||||
break;
|
||||
|
||||
case CAIRO_PATH_LINE_TO:
|
||||
if (unlikely (p->header.length < 2))
|
||||
return _cairo_error (CAIRO_STATUS_INVALID_PATH_DATA);
|
||||
|
||||
x = p[1].point.x, y = p[1].point.y;
|
||||
cairo_matrix_transform_point (&user_to_backend, &x, &y);
|
||||
x1_fixed = _cairo_fixed_from_double (x);
|
||||
y1_fixed = _cairo_fixed_from_double (y);
|
||||
|
||||
status = _cairo_path_fixed_line_to (cr->path, x1_fixed, y1_fixed);
|
||||
cairo_line_to (cr, p[1].point.x, p[1].point.y);
|
||||
break;
|
||||
|
||||
case CAIRO_PATH_CURVE_TO:
|
||||
if (unlikely (p->header.length < 4))
|
||||
return _cairo_error (CAIRO_STATUS_INVALID_PATH_DATA);
|
||||
|
||||
x = p[1].point.x, y = p[1].point.y;
|
||||
cairo_matrix_transform_point (&user_to_backend, &x, &y);
|
||||
x1_fixed = _cairo_fixed_from_double (x);
|
||||
y1_fixed = _cairo_fixed_from_double (y);
|
||||
|
||||
x = p[2].point.x, y = p[2].point.y;
|
||||
cairo_matrix_transform_point (&user_to_backend, &x, &y);
|
||||
x2_fixed = _cairo_fixed_from_double (x);
|
||||
y2_fixed = _cairo_fixed_from_double (y);
|
||||
|
||||
x = p[3].point.x, y = p[3].point.y;
|
||||
cairo_matrix_transform_point (&user_to_backend, &x, &y);
|
||||
x3_fixed = _cairo_fixed_from_double (x);
|
||||
y3_fixed = _cairo_fixed_from_double (y);
|
||||
|
||||
status = _cairo_path_fixed_curve_to (cr->path,
|
||||
x1_fixed, y1_fixed,
|
||||
x2_fixed, y2_fixed,
|
||||
x3_fixed, y3_fixed);
|
||||
cairo_curve_to (cr,
|
||||
p[1].point.x, p[1].point.y,
|
||||
p[2].point.x, p[2].point.y,
|
||||
p[3].point.x, p[3].point.y);
|
||||
break;
|
||||
|
||||
case CAIRO_PATH_CLOSE_PATH:
|
||||
if (unlikely (p->header.length < 1))
|
||||
return _cairo_error (CAIRO_STATUS_INVALID_PATH_DATA);
|
||||
|
||||
status = _cairo_path_fixed_close_path (cr->path);
|
||||
cairo_close_path (cr);
|
||||
break;
|
||||
|
||||
default:
|
||||
return _cairo_error (CAIRO_STATUS_INVALID_PATH_DATA);
|
||||
}
|
||||
|
||||
if (unlikely (status))
|
||||
return status;
|
||||
if (unlikely (cr->status))
|
||||
return cr->status;
|
||||
}
|
||||
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@
|
|||
#include "cairo-pdf-shading-private.h"
|
||||
#include "cairo-analysis-surface-private.h"
|
||||
#include "cairo-composite-rectangles-private.h"
|
||||
#include "cairo-default-context-private.h"
|
||||
#include "cairo-error-private.h"
|
||||
#include "cairo-image-info-private.h"
|
||||
#include "cairo-recording-surface-private.h"
|
||||
|
|
@ -6566,6 +6567,8 @@ _cairo_pdf_surface_set_paginated_mode (void *abstract_surface,
|
|||
|
||||
static const cairo_surface_backend_t cairo_pdf_surface_backend = {
|
||||
CAIRO_SURFACE_TYPE_PDF,
|
||||
_cairo_default_context_create,
|
||||
|
||||
NULL, /* create similar: handled by wrapper */
|
||||
_cairo_pdf_surface_finish,
|
||||
NULL, /* acquire_source_image */
|
||||
|
|
|
|||
|
|
@ -36,22 +36,29 @@
|
|||
#ifndef CAIRO_PRIVATE_H
|
||||
#define CAIRO_PRIVATE_H
|
||||
|
||||
#include "cairo-types-private.h"
|
||||
#include "cairo-reference-count-private.h"
|
||||
#include "cairo-gstate-private.h"
|
||||
#include "cairo-path-fixed-private.h"
|
||||
|
||||
CAIRO_BEGIN_DECLS
|
||||
|
||||
struct _cairo {
|
||||
cairo_reference_count_t ref_count;
|
||||
|
||||
cairo_status_t status;
|
||||
|
||||
cairo_user_data_array_t user_data;
|
||||
|
||||
cairo_gstate_t *gstate;
|
||||
cairo_gstate_t gstate_tail[2];
|
||||
cairo_gstate_t *gstate_freelist;
|
||||
|
||||
cairo_path_fixed_t path[1];
|
||||
const cairo_backend_t *backend;
|
||||
};
|
||||
|
||||
cairo_private cairo_t *
|
||||
_cairo_create_in_error (cairo_status_t status);
|
||||
|
||||
cairo_private void
|
||||
_cairo_init (cairo_t *cr,
|
||||
const cairo_backend_t *backend);
|
||||
|
||||
cairo_private void
|
||||
_cairo_fini (cairo_t *cr);
|
||||
|
||||
CAIRO_END_DECLS
|
||||
|
||||
#endif /* CAIRO_PRIVATE_H */
|
||||
|
|
|
|||
|
|
@ -60,6 +60,7 @@
|
|||
#include "cairo-pdf-operators-private.h"
|
||||
#include "cairo-pdf-shading-private.h"
|
||||
#include "cairo-composite-rectangles-private.h"
|
||||
#include "cairo-default-context-private.h"
|
||||
#include "cairo-error-private.h"
|
||||
#include "cairo-scaled-font-subsets-private.h"
|
||||
#include "cairo-paginated-private.h"
|
||||
|
|
@ -3931,6 +3932,8 @@ _cairo_ps_surface_supports_fine_grained_fallbacks (void *abstract_surface)
|
|||
|
||||
static const cairo_surface_backend_t cairo_ps_surface_backend = {
|
||||
CAIRO_SURFACE_TYPE_PS,
|
||||
_cairo_default_context_create,
|
||||
|
||||
NULL, /* create similar: handled by wrapper */
|
||||
_cairo_ps_surface_finish,
|
||||
NULL, /* acquire_source_image */
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@
|
|||
#include "cairoint.h"
|
||||
|
||||
#include "cairo-clip-private.h"
|
||||
#include "cairo-default-context-private.h"
|
||||
#include "cairo-error-private.h"
|
||||
#include "cairo-region-private.h"
|
||||
#include "cairo-surface-clipper-private.h"
|
||||
|
|
@ -1551,6 +1552,8 @@ _cairo_qt_surface_mark_dirty (void *abstract_surface,
|
|||
|
||||
static const cairo_surface_backend_t cairo_qt_surface_backend = {
|
||||
CAIRO_SURFACE_TYPE_QT,
|
||||
_cairo_default_context_create,
|
||||
|
||||
_cairo_qt_surface_create_similar,
|
||||
_cairo_qt_surface_finish,
|
||||
_cairo_qt_surface_acquire_source_image,
|
||||
|
|
|
|||
|
|
@ -159,6 +159,8 @@ _cairo_quartz_image_surface_flush (void *asurface)
|
|||
|
||||
static const cairo_surface_backend_t cairo_quartz_image_surface_backend = {
|
||||
CAIRO_SURFACE_TYPE_QUARTZ_IMAGE,
|
||||
_cairo_default_context_create,
|
||||
|
||||
_cairo_quartz_image_surface_create_similar,
|
||||
_cairo_quartz_image_surface_finish,
|
||||
_cairo_quartz_image_surface_acquire_source_image,
|
||||
|
|
|
|||
|
|
@ -79,6 +79,7 @@
|
|||
#include "cairoint.h"
|
||||
#include "cairo-analysis-surface-private.h"
|
||||
#include "cairo-clip-private.h"
|
||||
#include "cairo-default-context-private.h"
|
||||
#include "cairo-error-private.h"
|
||||
#include "cairo-recording-surface-private.h"
|
||||
#include "cairo-surface-wrapper-private.h"
|
||||
|
|
@ -707,6 +708,8 @@ _cairo_surface_is_recording (const cairo_surface_t *surface)
|
|||
|
||||
static const cairo_surface_backend_t cairo_recording_surface_backend = {
|
||||
CAIRO_SURFACE_TYPE_RECORDING,
|
||||
_cairo_default_context_create,
|
||||
|
||||
_cairo_recording_surface_create_similar,
|
||||
_cairo_recording_surface_finish,
|
||||
_cairo_recording_surface_acquire_source_image,
|
||||
|
|
|
|||
|
|
@ -630,6 +630,7 @@ _cairo_sub_font_map_glyph (cairo_sub_font_t *sub_font,
|
|||
* create a separate subset just for the .notdef glyph.
|
||||
*/
|
||||
is_latin = FALSE;
|
||||
latin_character = -1;
|
||||
if (sub_font->use_latin_subset &&
|
||||
(! _cairo_font_face_is_user (sub_font->scaled_font->font_face)))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -3405,6 +3405,8 @@ _cairo_script_surface_get_extents (void *abstract_surface,
|
|||
static const cairo_surface_backend_t
|
||||
_cairo_script_surface_backend = {
|
||||
CAIRO_SURFACE_TYPE_SCRIPT,
|
||||
_cairo_default_context_create,
|
||||
|
||||
_cairo_script_surface_create_similar,
|
||||
_cairo_script_surface_finish,
|
||||
_cairo_script_surface_acquire_source_image,
|
||||
|
|
|
|||
|
|
@ -89,6 +89,7 @@ _cairo_surface_snapshot_get_extents (void *abstract_surface,
|
|||
|
||||
static const cairo_surface_backend_t _cairo_surface_snapshot_backend = {
|
||||
CAIRO_INTERNAL_SURFACE_TYPE_SNAPSHOT,
|
||||
NULL,
|
||||
|
||||
NULL, /* create similar */
|
||||
_cairo_surface_snapshot_finish,
|
||||
|
|
|
|||
|
|
@ -442,8 +442,17 @@ _cairo_surface_subsurface_snapshot (void *abstract_surface)
|
|||
return &snapshot->base;
|
||||
}
|
||||
|
||||
static cairo_t *
|
||||
_cairo_surface_subsurface_create_context(void *target)
|
||||
{
|
||||
cairo_surface_subsurface_t *surface = target;
|
||||
return cairo_create (surface->target);
|
||||
}
|
||||
|
||||
static const cairo_surface_backend_t _cairo_surface_subsurface_backend = {
|
||||
CAIRO_SURFACE_TYPE_SUBSURFACE,
|
||||
_cairo_surface_subsurface_create_context,
|
||||
|
||||
_cairo_surface_subsurface_create_similar,
|
||||
_cairo_surface_subsurface_finish,
|
||||
|
||||
|
|
|
|||
|
|
@ -43,6 +43,7 @@
|
|||
#include "cairoint.h"
|
||||
#include "cairo-svg.h"
|
||||
#include "cairo-analysis-surface-private.h"
|
||||
#include "cairo-default-context-private.h"
|
||||
#include "cairo-error-private.h"
|
||||
#include "cairo-image-info-private.h"
|
||||
#include "cairo-recording-surface-private.h"
|
||||
|
|
@ -2574,6 +2575,8 @@ _cairo_svg_surface_get_font_options (void *abstract_surface,
|
|||
|
||||
static const cairo_surface_backend_t cairo_svg_surface_backend = {
|
||||
CAIRO_SURFACE_TYPE_SVG,
|
||||
_cairo_default_context_create,
|
||||
|
||||
NULL, /* create_similar: handled by wrapper */
|
||||
_cairo_svg_surface_finish,
|
||||
NULL, /* acquire_source_image */
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@
|
|||
|
||||
#include "cairo-tee.h"
|
||||
|
||||
#include "cairo-default-context-private.h"
|
||||
#include "cairo-error-private.h"
|
||||
#include "cairo-tee-surface-private.h"
|
||||
#include "cairo-surface-wrapper-private.h"
|
||||
|
|
@ -395,6 +396,8 @@ _cairo_tee_surface_show_text_glyphs (void *abstract_surface,
|
|||
|
||||
static const cairo_surface_backend_t cairo_tee_surface_backend = {
|
||||
CAIRO_SURFACE_TYPE_TEE,
|
||||
_cairo_default_context_create, /* XXX */
|
||||
|
||||
_cairo_tee_surface_create_similar,
|
||||
_cairo_tee_surface_finish,
|
||||
_cairo_tee_surface_acquire_source_image,
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@
|
|||
#include "cairo-output-stream-private.h"
|
||||
#include "cairo-recording-surface-private.h"
|
||||
#include "cairo-analysis-surface-private.h"
|
||||
#include "cairo-default-context-private.h"
|
||||
#include "cairo-error-private.h"
|
||||
#include "cairo-surface-clipper-private.h"
|
||||
|
||||
|
|
@ -321,6 +322,8 @@ _cairo_type3_glyph_surface_show_glyphs (void *abstract_surface,
|
|||
|
||||
static const cairo_surface_backend_t cairo_type3_glyph_surface_backend = {
|
||||
CAIRO_INTERNAL_SURFACE_TYPE_TYPE3_GLYPH,
|
||||
_cairo_default_context_create,
|
||||
|
||||
NULL, /* _cairo_type3_glyph_surface_create_similar */
|
||||
_cairo_type3_glyph_surface_finish,
|
||||
NULL, /* acquire_source_image */
|
||||
|
|
|
|||
|
|
@ -64,6 +64,8 @@ typedef struct _cairo_color_stop cairo_color_stop_t;
|
|||
typedef struct _cairo_device_backend cairo_device_backend_t;
|
||||
typedef struct _cairo_font_face_backend cairo_font_face_backend_t;
|
||||
typedef struct _cairo_gstate cairo_gstate_t;
|
||||
typedef struct _cairo_gstate_backend cairo_gstate_backend_t;
|
||||
typedef struct _cairo_glyph_text_info cairo_glyph_text_info_t;
|
||||
typedef struct _cairo_hash_entry cairo_hash_entry_t;
|
||||
typedef struct _cairo_hash_table cairo_hash_table_t;
|
||||
typedef struct _cairo_image_surface cairo_image_surface_t;
|
||||
|
|
@ -174,6 +176,16 @@ struct _cairo_font_options {
|
|||
cairo_round_glyph_positions_t round_glyph_positions;
|
||||
};
|
||||
|
||||
struct _cairo_glyph_text_info {
|
||||
const char *utf8;
|
||||
int utf8_len;
|
||||
|
||||
const cairo_text_cluster_t *clusters;
|
||||
int num_clusters;
|
||||
cairo_text_cluster_flags_t cluster_flags;
|
||||
};
|
||||
|
||||
|
||||
/* XXX: Right now, the _cairo_color structure puts unpremultiplied
|
||||
color in the doubles and premultiplied color in the shorts. Yes,
|
||||
this is crazy insane, (but at least we don't export this
|
||||
|
|
@ -209,7 +221,7 @@ struct _cairo_color_stop {
|
|||
typedef enum _cairo_paginated_mode {
|
||||
CAIRO_PAGINATED_MODE_ANALYZE, /* analyze page regions */
|
||||
CAIRO_PAGINATED_MODE_RENDER, /* render page contents */
|
||||
CAIRO_PAGINATED_MODE_FALLBACK /* paint fallback images */
|
||||
CAIRO_PAGINATED_MODE_FALLBACK /* paint fallback images */
|
||||
} cairo_paginated_mode_t;
|
||||
|
||||
/* Sure wish C had a real enum type so that this would be distinct
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@
|
|||
#include "cairo-vg.h"
|
||||
|
||||
#include "cairo-cache-private.h"
|
||||
#include "cairo-default-context-private.h"
|
||||
#include "cairo-error-private.h"
|
||||
#include "cairo-path-fixed-private.h"
|
||||
#include "cairo-recording-surface-private.h"
|
||||
|
|
@ -1547,6 +1548,8 @@ _vg_surface_finish (void *abstract_surface)
|
|||
|
||||
static const cairo_surface_backend_t cairo_vg_surface_backend = {
|
||||
CAIRO_SURFACE_TYPE_VG,
|
||||
_cairo_default_context_create, /* XXX */
|
||||
|
||||
_vg_surface_create_similar,
|
||||
_vg_surface_finish,
|
||||
|
||||
|
|
|
|||
|
|
@ -46,6 +46,7 @@
|
|||
|
||||
#include "cairoint.h"
|
||||
|
||||
#include "cairo-default-context-private.h"
|
||||
#include "cairo-error-private.h"
|
||||
#include "cairo-paginated-private.h"
|
||||
|
||||
|
|
@ -1861,6 +1862,8 @@ _cairo_surface_is_win32_printing (cairo_surface_t *surface)
|
|||
|
||||
static const cairo_surface_backend_t cairo_win32_printing_surface_backend = {
|
||||
CAIRO_SURFACE_TYPE_WIN32_PRINTING,
|
||||
_cairo_default_context_create,
|
||||
|
||||
_cairo_win32_printing_surface_create_similar,
|
||||
_cairo_win32_surface_finish,
|
||||
NULL, /* acquire_source_image */
|
||||
|
|
|
|||
|
|
@ -49,6 +49,7 @@
|
|||
|
||||
#include "cairo-clip-private.h"
|
||||
#include "cairo-composite-rectangles-private.h"
|
||||
#include "cairo-default-context-private.h"
|
||||
#include "cairo-error-private.h"
|
||||
#include "cairo-paginated-private.h"
|
||||
#include "cairo-win32-private.h"
|
||||
|
|
@ -2089,6 +2090,8 @@ _cairo_win32_surface_create_span_renderer (cairo_operator_t op,
|
|||
|
||||
static const cairo_surface_backend_t cairo_win32_surface_backend = {
|
||||
CAIRO_SURFACE_TYPE_WIN32,
|
||||
_cairo_default_context_create,
|
||||
|
||||
_cairo_win32_surface_create_similar,
|
||||
_cairo_win32_surface_finish,
|
||||
_cairo_win32_surface_acquire_source_image,
|
||||
|
|
|
|||
|
|
@ -75,6 +75,7 @@ _cairo_xcb_pixmap_finish (void *abstract_surface)
|
|||
static const cairo_surface_backend_t _cairo_xcb_pixmap_backend = {
|
||||
CAIRO_SURFACE_TYPE_XCB,
|
||||
NULL,
|
||||
NULL,
|
||||
_cairo_xcb_pixmap_finish,
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -95,6 +95,7 @@ _cairo_xcb_picture_finish (void *abstract_surface)
|
|||
static const cairo_surface_backend_t _cairo_xcb_picture_backend = {
|
||||
CAIRO_SURFACE_TYPE_XCB,
|
||||
NULL,
|
||||
NULL,
|
||||
_cairo_xcb_picture_finish,
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -43,6 +43,8 @@
|
|||
#include "cairo-xcb.h"
|
||||
#include "cairo-xcb-private.h"
|
||||
|
||||
#include "cairo-default-context-private.h"
|
||||
|
||||
#define AllPlanes ((unsigned) -1)
|
||||
#define CAIRO_ASSUME_PIXMAP 20
|
||||
#define XLIB_COORD_MAX 32767
|
||||
|
|
@ -923,6 +925,7 @@ _cairo_xcb_surface_glyphs (void *abstract_surface,
|
|||
|
||||
const cairo_surface_backend_t _cairo_xcb_surface_backend = {
|
||||
CAIRO_SURFACE_TYPE_XCB,
|
||||
_cairo_default_context_create,
|
||||
|
||||
_cairo_xcb_surface_create_similar,
|
||||
_cairo_xcb_surface_finish,
|
||||
|
|
|
|||
|
|
@ -52,6 +52,7 @@
|
|||
#include "cairo-xlib-private.h"
|
||||
#include "cairo-xlib-surface-private.h"
|
||||
#include "cairo-clip-private.h"
|
||||
#include "cairo-default-context-private.h"
|
||||
#include "cairo-error-private.h"
|
||||
#include "cairo-scaled-font-private.h"
|
||||
#include "cairo-surface-snapshot-private.h"
|
||||
|
|
@ -3133,6 +3134,8 @@ _cairo_xlib_surface_is_similar (void *surface_a,
|
|||
|
||||
static const cairo_surface_backend_t cairo_xlib_surface_backend = {
|
||||
CAIRO_SURFACE_TYPE_XLIB,
|
||||
_cairo_default_context_create,
|
||||
|
||||
_cairo_xlib_surface_create_similar,
|
||||
_cairo_xlib_surface_finish,
|
||||
_cairo_xlib_surface_acquire_source_image,
|
||||
|
|
|
|||
|
|
@ -46,6 +46,8 @@
|
|||
#include "cairo-xcb-private.h"
|
||||
#include "cairo-xlib-xrender-private.h"
|
||||
|
||||
#include "cairo-default-context-private.h"
|
||||
|
||||
#include <X11/Xlib-xcb.h>
|
||||
#include <X11/Xlibint.h> /* For XESetCloseDisplay */
|
||||
|
||||
|
|
@ -60,7 +62,7 @@ struct cairo_xlib_xcb_display_t {
|
|||
};
|
||||
typedef struct cairo_xlib_xcb_display_t cairo_xlib_xcb_display_t;
|
||||
|
||||
/* List of all cairo_xlib_xcb_display_t alive,
|
||||
/* List of all #cairo_xlib_xcb_display_t alive,
|
||||
* protected by _cairo_xlib_display_mutex */
|
||||
static cairo_list_t displays;
|
||||
|
||||
|
|
@ -232,6 +234,8 @@ _cairo_xlib_xcb_surface_mark_dirty (void *abstract_surface,
|
|||
|
||||
static const cairo_surface_backend_t _cairo_xlib_xcb_surface_backend = {
|
||||
CAIRO_SURFACE_TYPE_XLIB,
|
||||
_cairo_default_context_create, /* XXX */
|
||||
|
||||
_cairo_xlib_xcb_surface_create_similar,
|
||||
_cairo_xlib_xcb_surface_finish,
|
||||
_cairo_xlib_xcb_surface_acquire_source_image,
|
||||
|
|
|
|||
|
|
@ -46,6 +46,7 @@
|
|||
|
||||
#include "cairo-clip-private.h"
|
||||
#include "cairo-device-private.h"
|
||||
#include "cairo-default-context-private.h"
|
||||
#include "cairo-error-private.h"
|
||||
#include "cairo-output-stream-private.h"
|
||||
#include "cairo-recording-surface-private.h"
|
||||
|
|
@ -989,6 +990,8 @@ _cairo_xml_surface_glyphs (void *abstract_surface,
|
|||
static const cairo_surface_backend_t
|
||||
_cairo_xml_surface_backend = {
|
||||
CAIRO_SURFACE_TYPE_XML,
|
||||
_cairo_default_context_create,
|
||||
|
||||
_cairo_xml_surface_create_similar,
|
||||
NULL,
|
||||
NULL, NULL, /* source image */
|
||||
|
|
|
|||
1043
src/cairo.c
1043
src/cairo.c
File diff suppressed because it is too large
Load diff
|
|
@ -409,7 +409,7 @@ struct _cairo_font_face {
|
|||
};
|
||||
|
||||
cairo_private void
|
||||
_cairo_reset_static_data (void);
|
||||
_cairo_default_context_reset_static_data (void);
|
||||
|
||||
cairo_private void
|
||||
_cairo_toy_font_face_reset_static_data (void);
|
||||
|
|
@ -599,6 +599,9 @@ extern const cairo_private struct _cairo_font_face_backend _cairo_quartz_font_fa
|
|||
struct _cairo_surface_backend {
|
||||
cairo_surface_type_t type;
|
||||
|
||||
cairo_t *
|
||||
(*create_context) (void *surface);
|
||||
|
||||
cairo_surface_t *
|
||||
(*create_similar) (void *surface,
|
||||
cairo_content_t content,
|
||||
|
|
@ -1357,7 +1360,7 @@ _cairo_path_fixed_stroke_rectilinear_to_boxes (const cairo_path_fixed_t *path,
|
|||
const cairo_matrix_t *ctm,
|
||||
cairo_boxes_t *boxes);
|
||||
|
||||
cairo_private cairo_status_t
|
||||
cairo_private cairo_int_status_t
|
||||
_cairo_path_fixed_stroke_to_traps (const cairo_path_fixed_t *path,
|
||||
const cairo_stroke_style_t *stroke_style,
|
||||
const cairo_matrix_t *ctm,
|
||||
|
|
@ -2404,6 +2407,7 @@ slim_hidden_proto (cairo_format_stride_for_width);
|
|||
slim_hidden_proto (cairo_get_current_point);
|
||||
slim_hidden_proto (cairo_get_line_width);
|
||||
slim_hidden_proto (cairo_get_matrix);
|
||||
slim_hidden_proto (cairo_get_scaled_font);
|
||||
slim_hidden_proto (cairo_get_target);
|
||||
slim_hidden_proto (cairo_get_tolerance);
|
||||
slim_hidden_proto (cairo_glyph_allocate);
|
||||
|
|
@ -2511,6 +2515,7 @@ slim_hidden_proto (cairo_user_font_face_create);
|
|||
slim_hidden_proto (cairo_user_font_face_set_init_func);
|
||||
slim_hidden_proto (cairo_user_font_face_set_render_glyph_func);
|
||||
slim_hidden_proto (cairo_user_font_face_set_unicode_to_glyph_func);
|
||||
slim_hidden_proto (cairo_device_to_user);
|
||||
slim_hidden_proto (cairo_user_to_device);
|
||||
slim_hidden_proto (cairo_user_to_device_distance);
|
||||
slim_hidden_proto (cairo_version_string);
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@
|
|||
#include "cairoint.h"
|
||||
|
||||
#include "cairo-drm-private.h"
|
||||
#include "cairo-default-context-private.h"
|
||||
#include "cairo-error-private.h"
|
||||
|
||||
#include <dlfcn.h>
|
||||
|
|
@ -462,6 +463,8 @@ gallium_surface_glyphs (void *abstract_surface,
|
|||
|
||||
static const cairo_surface_backend_t gallium_surface_backend = {
|
||||
CAIRO_SURFACE_TYPE_DRM,
|
||||
_cairo_default_context_create,
|
||||
|
||||
gallium_surface_create_similar,
|
||||
gallium_surface_finish,
|
||||
|
||||
|
|
|
|||
|
|
@ -103,6 +103,7 @@
|
|||
#include "cairo-boxes-private.h"
|
||||
#include "cairo-cache-private.h"
|
||||
#include "cairo-composite-rectangles-private.h"
|
||||
#include "cairo-default-context-private.h"
|
||||
#include "cairo-error-private.h"
|
||||
#include "cairo-freelist-private.h"
|
||||
#include "cairo-list-private.h"
|
||||
|
|
@ -2338,6 +2339,7 @@ i915_surface_fill (void *abstract_dst,
|
|||
|
||||
static const cairo_surface_backend_t i915_surface_backend = {
|
||||
CAIRO_SURFACE_TYPE_DRM,
|
||||
_cairo_default_context_create,
|
||||
|
||||
i915_surface_create_similar,
|
||||
i915_surface_finish,
|
||||
|
|
|
|||
|
|
@ -56,6 +56,7 @@
|
|||
|
||||
#include "cairo-boxes-private.h"
|
||||
#include "cairo-composite-rectangles-private.h"
|
||||
#include "cairo-default-context-private.h"
|
||||
#include "cairo-error-private.h"
|
||||
#include "cairo-region-private.h"
|
||||
#include "cairo-surface-offset-private.h"
|
||||
|
|
@ -1490,6 +1491,7 @@ CLEANUP_BOXES:
|
|||
|
||||
static const cairo_surface_backend_t i965_surface_backend = {
|
||||
CAIRO_SURFACE_TYPE_DRM,
|
||||
_cairo_default_context_create,
|
||||
|
||||
i965_surface_create_similar,
|
||||
i965_surface_finish,
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@
|
|||
#include "cairo-drm-private.h"
|
||||
#include "cairo-drm-intel-private.h"
|
||||
|
||||
#include "cairo-default-context-private.h"
|
||||
#include "cairo-error-private.h"
|
||||
|
||||
/* Basic generic/stub surface for intel chipsets */
|
||||
|
|
@ -248,6 +249,7 @@ intel_surface_glyphs (void *abstract_surface,
|
|||
|
||||
static const cairo_surface_backend_t intel_surface_backend = {
|
||||
CAIRO_SURFACE_TYPE_DRM,
|
||||
_cairo_default_context_create,
|
||||
|
||||
intel_surface_create_similar,
|
||||
intel_surface_finish,
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@
|
|||
#include "cairo-drm-private.h"
|
||||
#include "cairo-drm-radeon-private.h"
|
||||
|
||||
#include "cairo-default-context-private.h"
|
||||
#include "cairo-error-private.h"
|
||||
|
||||
/* Basic stub surface for radeon chipsets */
|
||||
|
|
@ -252,6 +253,7 @@ radeon_surface_glyphs (void *abstract_surface,
|
|||
|
||||
static const cairo_surface_backend_t radeon_surface_backend = {
|
||||
CAIRO_SURFACE_TYPE_DRM,
|
||||
_cairo_default_context_create,
|
||||
|
||||
radeon_surface_create_similar,
|
||||
radeon_surface_finish,
|
||||
|
|
|
|||
|
|
@ -54,6 +54,7 @@
|
|||
#include "cairoint.h"
|
||||
|
||||
#include "test-fallback-surface.h"
|
||||
#include "cairo-default-context-private.h"
|
||||
#include "cairo-error-private.h"
|
||||
|
||||
typedef struct _test_fallback_surface {
|
||||
|
|
@ -207,6 +208,8 @@ _test_fallback_surface_get_extents (void *abstract_surface,
|
|||
|
||||
static const cairo_surface_backend_t test_fallback_surface_backend = {
|
||||
CAIRO_INTERNAL_SURFACE_TYPE_TEST_FALLBACK,
|
||||
_cairo_default_context_create,
|
||||
|
||||
_test_fallback_surface_create_similar,
|
||||
_test_fallback_surface_finish,
|
||||
_test_fallback_surface_acquire_source_image,
|
||||
|
|
|
|||
|
|
@ -43,6 +43,7 @@
|
|||
#include "cairoint.h"
|
||||
|
||||
#include "test-fallback16-surface.h"
|
||||
#include "cairo-default-context-private.h"
|
||||
#include "cairo-error-private.h"
|
||||
|
||||
typedef struct _test_fallback16_surface {
|
||||
|
|
@ -204,6 +205,8 @@ _test_fallback16_surface_get_extents (void *abstract_surface,
|
|||
|
||||
static const cairo_surface_backend_t test_fallback16_surface_backend = {
|
||||
CAIRO_INTERNAL_SURFACE_TYPE_TEST_FALLBACK,
|
||||
_cairo_default_context_create,
|
||||
|
||||
_test_fallback16_surface_create_similar,
|
||||
_test_fallback16_surface_finish,
|
||||
_test_fallback16_surface_acquire_source_image,
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@
|
|||
|
||||
#include "test-null-surface.h"
|
||||
|
||||
#include "cairo-default-context-private.h"
|
||||
#include "cairo-error-private.h"
|
||||
|
||||
slim_hidden_proto (_cairo_test_null_surface_create);
|
||||
|
|
@ -133,6 +134,7 @@ _cairo_null_surface_has_show_text_glyphs (void *surface)
|
|||
|
||||
static const cairo_surface_backend_t null_surface_backend = {
|
||||
CAIRO_INTERNAL_SURFACE_TYPE_NULL,
|
||||
_cairo_default_context_create,
|
||||
|
||||
_cairo_null_surface_create_similar,
|
||||
NULL, /* finish */
|
||||
|
|
|
|||
|
|
@ -49,6 +49,7 @@
|
|||
|
||||
#include "test-paginated-surface.h"
|
||||
|
||||
#include "cairo-default-context-private.h"
|
||||
#include "cairo-error-private.h"
|
||||
#include "cairo-paginated-private.h"
|
||||
|
||||
|
|
@ -240,6 +241,7 @@ _test_paginated_surface_set_paginated_mode (void *abstract_surface,
|
|||
|
||||
static const cairo_surface_backend_t test_paginated_surface_backend = {
|
||||
CAIRO_INTERNAL_SURFACE_TYPE_TEST_PAGINATED,
|
||||
_cairo_default_context_create,
|
||||
|
||||
/* Since we are a paginated user, we get to regard most of the
|
||||
* surface backend interface as historical cruft and ignore it. */
|
||||
|
|
|
|||
|
|
@ -43,6 +43,7 @@
|
|||
|
||||
#include "test-wrapping-surface.h"
|
||||
|
||||
#include "cairo-default-context-private.h"
|
||||
#include "cairo-error-private.h"
|
||||
#include "cairo-surface-wrapper-private.h"
|
||||
|
||||
|
|
@ -234,6 +235,8 @@ _test_wrapping_surface_show_text_glyphs (void *abstract_surface,
|
|||
|
||||
static const cairo_surface_backend_t test_wrapping_surface_backend = {
|
||||
CAIRO_INTERNAL_SURFACE_TYPE_TEST_WRAPPING,
|
||||
_cairo_default_context_create,
|
||||
|
||||
_test_wrapping_surface_create_similar,
|
||||
_test_wrapping_surface_finish,
|
||||
_test_wrapping_surface_acquire_source_image,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue