1 /* cairo - a vector graphics library with display and print output
3 * Copyright © 2002 University of Southern California
4 * Copyright © 2005 Red Hat, Inc.
6 * This library is free software; you can redistribute it and/or
7 * modify it either under the terms of the GNU Lesser General Public
8 * License version 2.1 as published by the Free Software Foundation
9 * (the "LGPL") or, at your option, under the terms of the Mozilla
10 * Public License Version 1.1 (the "MPL"). If you do not alter this
11 * notice, a recipient may use your version of this file under either
12 * the MPL or the LGPL.
14 * You should have received a copy of the LGPL along with this library
15 * in the file COPYING-LGPL-2.1; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 * You should have received a copy of the MPL along with this library
18 * in the file COPYING-MPL-1.1
20 * The contents of this file are subject to the Mozilla Public License
21 * Version 1.1 (the "License"); you may not use this file except in
22 * compliance with the License. You may obtain a copy of the License at
23 * http://www.mozilla.org/MPL/
25 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY
26 * OF ANY KIND, either express or implied. See the LGPL or the MPL for
27 * the specific language governing rights and limitations.
29 * The Original Code is the cairo graphics library.
31 * The Initial Developer of the Original Code is University of Southern
35 * Carl D. Worth <cworth@cworth.org>
38 #ifndef CAIRO_SURFACE_PRIVATE_H
39 #define CAIRO_SURFACE_PRIVATE_H
43 #include "cairo-types-private.h"
44 #include "cairo-reference-count-private.h"
46 struct _cairo_surface
{
47 const cairo_surface_backend_t
*backend
;
49 /* We allow surfaces to override the backend->type by shoving something
50 * else into surface->type. This is for "wrapper" surfaces that want to
51 * hide their internal type from the user-level API. */
52 cairo_surface_type_t type
;
54 cairo_content_t content
;
56 cairo_reference_count_t ref_count
;
57 cairo_status_t status
;
58 cairo_bool_t finished
;
59 cairo_user_data_array_t user_data
;
61 cairo_matrix_t device_transform
;
62 cairo_matrix_t device_transform_inverse
;
64 /* The actual resolution of the device, in dots per inch. */
68 /* The resolution that should be used when generating image-based
69 * fallback; generally only used by the analysis/paginated
72 double x_fallback_resolution
;
73 double y_fallback_resolution
;
78 * Each time a clip region is modified, it gets the next value in this
79 * sequence. This means that clip regions for this surface are uniquely
80 * identified and updates to the clip can be readily identified
82 unsigned int next_clip_serial
;
84 * The serial number of the current clip. This is set when
85 * the surface clipping is set. The gstate can then cheaply
86 * check whether the surface clipping is already correct before
87 * performing a rendering operation.
89 * The special value '0' is reserved for the unclipped case.
91 unsigned int current_clip_serial
;
93 /* A "snapshot" surface is immutable. See _cairo_surface_snapshot. */
94 cairo_bool_t is_snapshot
;
97 * Surface font options, falling back to backend's default options,
98 * and set using _cairo_surface_set_font_options(), and propagated by
99 * cairo_surface_create_similar().
101 cairo_bool_t has_font_options
;
102 cairo_font_options_t font_options
;
105 #endif /* CAIRO_SURFACE_PRIVATE_H */