Add stubs for Direct3D9 backend.
[cairo/gpu.git] / src / cairo-meta-surface-private.h
blob8d5e096e4eb275803efa0636cd85fb1941a61eee
1 /* cairo - a vector graphics library with display and print output
3 * Copyright © 2005 Red Hat, Inc
5 * This library is free software; you can redistribute it and/or
6 * modify it either under the terms of the GNU Lesser General Public
7 * License version 2.1 as published by the Free Software Foundation
8 * (the "LGPL") or, at your option, under the terms of the Mozilla
9 * Public License Version 1.1 (the "MPL"). If you do not alter this
10 * notice, a recipient may use your version of this file under either
11 * the MPL or the LGPL.
13 * You should have received a copy of the LGPL along with this library
14 * in the file COPYING-LGPL-2.1; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 * You should have received a copy of the MPL along with this library
17 * in the file COPYING-MPL-1.1
19 * The contents of this file are subject to the Mozilla Public License
20 * Version 1.1 (the "License"); you may not use this file except in
21 * compliance with the License. You may obtain a copy of the License at
22 * http://www.mozilla.org/MPL/
24 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY
25 * OF ANY KIND, either express or implied. See the LGPL or the MPL for
26 * the specific language governing rights and limitations.
28 * The Original Code is the cairo graphics library.
30 * The Initial Developer of the Original Code is Red Hat, Inc.
32 * Contributor(s):
33 * Kristian Høgsberg <krh@redhat.com>
34 * Adrian Johnson <ajohnson@redneon.com>
37 #ifndef CAIRO_META_SURFACE_H
38 #define CAIRO_META_SURFACE_H
40 #include "cairoint.h"
41 #include "cairo-path-fixed-private.h"
43 typedef enum {
44 /* The 5 basic drawing operations. */
45 CAIRO_COMMAND_PAINT,
46 CAIRO_COMMAND_MASK,
47 CAIRO_COMMAND_STROKE,
48 CAIRO_COMMAND_FILL,
49 CAIRO_COMMAND_SHOW_TEXT_GLYPHS,
51 /* Other junk. For most of these, we should be able to assert that
52 * they never get called except as part of fallbacks for the 5
53 * basic drawing operations (which we implement already so the
54 * fallbacks should never get triggered). So the plan is to
55 * eliminate as many of these as possible. */
57 CAIRO_COMMAND_INTERSECT_CLIP_PATH
59 } cairo_command_type_t;
61 typedef enum {
62 CAIRO_META_REGION_ALL,
63 CAIRO_META_REGION_NATIVE,
64 CAIRO_META_REGION_IMAGE_FALLBACK
65 } cairo_meta_region_type_t;
67 typedef struct _cairo_command_header {
68 cairo_command_type_t type;
69 cairo_meta_region_type_t region;
70 cairo_rectangle_int_t extents;
71 } cairo_command_header_t;
73 typedef struct _cairo_command_paint {
74 cairo_command_header_t header;
75 cairo_operator_t op;
76 cairo_pattern_union_t source;
77 } cairo_command_paint_t;
79 typedef struct _cairo_command_mask {
80 cairo_command_header_t header;
81 cairo_operator_t op;
82 cairo_pattern_union_t source;
83 cairo_pattern_union_t mask;
84 } cairo_command_mask_t;
86 typedef struct _cairo_command_stroke {
87 cairo_command_header_t header;
88 cairo_operator_t op;
89 cairo_pattern_union_t source;
90 cairo_path_fixed_t path;
91 cairo_stroke_style_t style;
92 cairo_matrix_t ctm;
93 cairo_matrix_t ctm_inverse;
94 double tolerance;
95 cairo_antialias_t antialias;
96 } cairo_command_stroke_t;
98 typedef struct _cairo_command_fill {
99 cairo_command_header_t header;
100 cairo_operator_t op;
101 cairo_pattern_union_t source;
102 cairo_path_fixed_t path;
103 cairo_fill_rule_t fill_rule;
104 double tolerance;
105 cairo_antialias_t antialias;
106 } cairo_command_fill_t;
108 typedef struct _cairo_command_show_text_glyphs {
109 cairo_command_header_t header;
110 cairo_operator_t op;
111 cairo_pattern_union_t source;
112 char *utf8;
113 int utf8_len;
114 cairo_glyph_t *glyphs;
115 unsigned int num_glyphs;
116 cairo_text_cluster_t *clusters;
117 int num_clusters;
118 cairo_text_cluster_flags_t cluster_flags;
119 cairo_scaled_font_t *scaled_font;
120 } cairo_command_show_text_glyphs_t;
122 typedef struct _cairo_command_intersect_clip_path {
123 cairo_command_header_t header;
124 cairo_path_fixed_t *path_pointer;
125 cairo_path_fixed_t path;
126 cairo_fill_rule_t fill_rule;
127 double tolerance;
128 cairo_antialias_t antialias;
129 } cairo_command_intersect_clip_path_t;
131 typedef union _cairo_command {
132 cairo_command_header_t header;
134 /* The 5 basic drawing operations. */
135 cairo_command_paint_t paint;
136 cairo_command_mask_t mask;
137 cairo_command_stroke_t stroke;
138 cairo_command_fill_t fill;
139 cairo_command_show_text_glyphs_t show_text_glyphs;
141 /* The other junk. */
142 cairo_command_intersect_clip_path_t intersect_clip_path;
143 } cairo_command_t;
145 typedef struct _cairo_meta_surface {
146 cairo_surface_t base;
148 cairo_content_t content;
150 /* A meta-surface is logically unbounded, but when used as a
151 * source we need to render it to an image, so we need a size at
152 * which to create that image. */
153 int width_pixels;
154 int height_pixels;
156 cairo_array_t commands;
157 cairo_surface_t *commands_owner;
159 cairo_bool_t is_clipped;
160 int replay_start_idx;
161 } cairo_meta_surface_t;
163 cairo_private cairo_surface_t *
164 _cairo_meta_surface_create (cairo_content_t content,
165 int width_pixels,
166 int height_pixels);
168 cairo_private cairo_int_status_t
169 _cairo_meta_surface_get_path (cairo_surface_t *surface,
170 cairo_path_fixed_t *path);
172 cairo_private cairo_status_t
173 _cairo_meta_surface_replay (cairo_surface_t *surface,
174 cairo_surface_t *target);
176 cairo_private cairo_status_t
177 _cairo_meta_surface_replay_analyze_meta_pattern (cairo_surface_t *surface,
178 cairo_surface_t *target);
180 cairo_private cairo_status_t
181 _cairo_meta_surface_replay_and_create_regions (cairo_surface_t *surface,
182 cairo_surface_t *target);
183 cairo_private cairo_status_t
184 _cairo_meta_surface_replay_region (cairo_surface_t *surface,
185 cairo_surface_t *target,
186 cairo_meta_region_type_t region);
188 cairo_private cairo_bool_t
189 _cairo_surface_is_meta (const cairo_surface_t *surface);
191 #endif /* CAIRO_META_SURFACE_H */