2 * Copyright © 2012 SCore Corporation
4 * This library is free software; you can redistribute it and/or
5 * modify it either under the terms of the GNU Lesser General Public
6 * License version 2.1 as published by the Free Software Foundation
7 * (the "LGPL") or, at your option, under the terms of the Mozilla
8 * Public License Version 1.1 (the "MPL"). If you do not alter this
9 * notice, a recipient may use your version of this file under either
10 * the MPL or the LGPL.
12 * You should have received a copy of the LGPL along with this library
13 * in the file COPYING-LGPL-2.1; if not, write to the Free Software
14 * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA
15 * You should have received a copy of the MPL along with this library
16 * in the file COPYING-MPL-1.1
18 * The contents of this file are subject to the Mozilla Public License
19 * Version 1.1 (the "License"); you may not use this file except in
20 * compliance with the License. You may obtain a copy of the License at
21 * http://www.mozilla.org/MPL/
23 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY
24 * OF ANY KIND, either express or implied. See the LGPL or the MPL for
25 * the specific language governing rights and limitations.
27 * Author: Taekyun Kim (podain77@gmail.com)
30 #ifndef CAIRO_TG_JOURNAL_PRIVATE_H
31 #define CAIRO_TG_JOURNAL_PRIVATE_H
34 #include "cairo-pattern-private.h"
35 #include "cairo-clip-private.h"
36 #include "cairo-surface-private.h"
37 #include "cairo-list-private.h"
38 #include "cairo-list-inline.h"
39 #include "cairo-tg-allocator-private.h"
40 #include "cairo-mutex-private.h"
44 CAIRO_TG_JOURNAL_ENTRY_PAINT,
45 CAIRO_TG_JOURNAL_ENTRY_MASK,
46 CAIRO_TG_JOURNAL_ENTRY_FILL,
47 CAIRO_TG_JOURNAL_ENTRY_STROKE,
48 CAIRO_TG_JOURNAL_ENTRY_GLYPHS,
49 } cairo_tg_journal_entry_type_t;
51 typedef struct _cairo_tg_journal_entry cairo_tg_journal_entry_t;
53 struct _cairo_tg_journal_entry
56 cairo_tg_journal_entry_type_t type;
58 cairo_rectangle_int_t extents;
61 cairo_pattern_union_t source;
65 typedef struct _cairo_tg_journal_entry_paint
67 cairo_tg_journal_entry_t base;
68 } cairo_tg_journal_entry_paint_t;
70 typedef struct _cairo_tg_journal_entry_mask
72 cairo_tg_journal_entry_t base;
74 cairo_pattern_union_t mask;
75 } cairo_tg_journal_entry_mask_t;
77 typedef struct _cairo_tg_journal_entry_stroke
79 cairo_tg_journal_entry_t base;
81 cairo_path_fixed_t path;
82 cairo_stroke_style_t style;
84 cairo_matrix_t ctm_inverse;
86 cairo_antialias_t antialias;
87 } cairo_tg_journal_entry_stroke_t;
89 typedef struct _cairo_tg_journal_entry_fill
91 cairo_tg_journal_entry_t base;
93 cairo_path_fixed_t path;
94 cairo_fill_rule_t fill_rule;
96 cairo_antialias_t antialias;
97 } cairo_tg_journal_entry_fill_t;
99 typedef struct _cairo_tg_journal_entry_glyphs
101 cairo_tg_journal_entry_t base;
103 cairo_glyph_t *glyphs;
105 cairo_scaled_font_t *scaled_font;
106 } cairo_tg_journal_entry_glyphs_t;
108 typedef struct _cairo_tg_journal
110 cairo_rectangle_int_t extents;
111 cairo_list_t entry_list;
113 cairo_tg_mono_allocator_t allocator;
115 } cairo_tg_journal_t;
117 typedef struct _cairo_tg_journal_replay_funcs
120 (*paint) (void *closure,
122 const cairo_pattern_t *source,
123 const cairo_clip_t *clip);
126 (*mask) (void *closure,
128 const cairo_pattern_t *source,
129 const cairo_pattern_t *mask,
130 const cairo_clip_t *clip);
133 (*stroke) (void *closure,
135 const cairo_pattern_t *source,
136 const cairo_path_fixed_t *path,
137 const cairo_stroke_style_t *style,
138 const cairo_matrix_t *ctm,
139 const cairo_matrix_t *ctm_inverse,
141 cairo_antialias_t antialias,
142 const cairo_clip_t *clip);
145 (*fill) (void *closure,
147 const cairo_pattern_t *source,
148 const cairo_path_fixed_t *path,
149 cairo_fill_rule_t fill_rule,
151 cairo_antialias_t antialias,
152 const cairo_clip_t *clip);
155 (*glyphs) (void *closure,
157 const cairo_pattern_t *source,
158 cairo_glyph_t *glyphs,
160 cairo_scaled_font_t *scaled_font,
161 const cairo_clip_t *clip);
162 } cairo_tg_journal_replay_funcs_t;
165 _cairo_tg_journal_init (cairo_tg_journal_t *journal);
168 _cairo_tg_journal_fini (cairo_tg_journal_t *journal);
171 _cairo_tg_journal_lock (cairo_tg_journal_t *journal);
174 _cairo_tg_journal_unlock (cairo_tg_journal_t *journal);
177 _cairo_tg_journal_log_paint (cairo_tg_journal_t *journal,
179 const cairo_pattern_t *source,
180 const cairo_clip_t *clip);
183 _cairo_tg_journal_log_mask (cairo_tg_journal_t *journal,
185 const cairo_pattern_t *source,
186 const cairo_pattern_t *mask,
187 const cairo_clip_t *clip);
190 _cairo_tg_journal_log_stroke (cairo_tg_journal_t *journal,
192 const cairo_pattern_t *source,
193 const cairo_path_fixed_t *path,
194 const cairo_stroke_style_t *style,
195 const cairo_matrix_t *ctm,
196 const cairo_matrix_t *ctm_inverse,
198 cairo_antialias_t antialias,
199 const cairo_clip_t *clip);
202 _cairo_tg_journal_log_fill (cairo_tg_journal_t *journal,
204 const cairo_pattern_t *source,
205 const cairo_path_fixed_t *path,
206 cairo_fill_rule_t fill_rule,
208 cairo_antialias_t antialias,
209 const cairo_clip_t *clip);
212 _cairo_tg_journal_log_glyphs (cairo_tg_journal_t *journal,
214 const cairo_pattern_t *source,
215 cairo_glyph_t *glyphs,
217 cairo_scaled_font_t *scaled_font,
218 const cairo_clip_t *clip);
221 _cairo_tg_journal_clear (cairo_tg_journal_t *journal);
224 _cairo_tg_journal_replay (const cairo_tg_journal_t *journal,
226 const cairo_rectangle_int_t *extents,
227 const cairo_tg_journal_replay_funcs_t *funcs);
229 #endif /* CAIRO_TG_JOURNAL_PRIVATE_H */