Subversion Repositories Scribus

Rev

Rev 14952 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
14952 fschmid 1
/* cairo - a vector graphics library with display and print output
2
 *
3
 * Copyright © 2005 Red Hat, Inc
4
 * Copyright © 2007 Adrian Johnson
5
 *
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.
13
 *
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
18122 mrdocs 16
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
14952 fschmid 17
 * You should have received a copy of the MPL along with this library
18
 * in the file COPYING-MPL-1.1
19
 *
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/
24
 *
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.
28
 *
29
 * The Original Code is the cairo graphics library.
30
 *
31
 * The Initial Developer of the Original Code is Red Hat, Inc.
32
 *
33
 * Contributor(s):
34
 *      Carl Worth <cworth@cworth.org>
35
 *      Keith Packard <keithp@keithp.com>
36
 *      Adrian Johnson <ajohnson@redneon.com>
37
 */
38
 
39
/* The paginated surface layer exists to provide as much code sharing
40
 * as possible for the various paginated surface backends in cairo
41
 * (PostScript, PDF, etc.). See cairo-paginated-private.h for
42
 * more details on how it works and how to use it.
43
 */
44
 
45
#include "cairoint.h"
46
 
47
#include "cairo-paginated-private.h"
48
#include "cairo-paginated-surface-private.h"
49
#include "cairo-meta-surface-private.h"
50
#include "cairo-analysis-surface-private.h"
51
 
52
static const cairo_surface_backend_t cairo_paginated_surface_backend;
53
 
54
static cairo_int_status_t
55
_cairo_paginated_surface_show_page (void *abstract_surface);
56
 
57
static cairo_surface_t *
58
_cairo_paginated_surface_create_similar (void                   *abstract_surface,
59
                                         cairo_content_t         content,
60
                                         int                     width,
61
                                         int                     height)
62
{
63
    cairo_rectangle_t rect;
64
    rect.x = rect.y = 0.;
65
    rect.width = width;
66
    rect.height = height;
67
    return cairo_meta_surface_create (content, &rect);
68
}
69
 
70
static cairo_surface_t *
71
_create_meta_surface_for_target (cairo_surface_t *target,
72
                                 cairo_content_t content)
73
{
74
    cairo_rectangle_int_t rect;
75
 
76
    if (_cairo_surface_get_extents (target, &rect)) {
77
        cairo_rectangle_t meta_extents;
78
 
79
        meta_extents.x = rect.x;
80
        meta_extents.y = rect.y;
81
        meta_extents.width = rect.width;
82
        meta_extents.height = rect.height;
83
 
84
        return cairo_meta_surface_create (content, &meta_extents);
85
    } else {
86
        return cairo_meta_surface_create (content, NULL);
87
    }
88
}
89
 
90
cairo_surface_t *
91
_cairo_paginated_surface_create (cairo_surface_t                                *target,
92
                                 cairo_content_t                                 content,
93
                                 const cairo_paginated_surface_backend_t        *backend)
94
{
95
    cairo_paginated_surface_t *surface;
96
    cairo_status_t status;
97
 
98
    surface = malloc (sizeof (cairo_paginated_surface_t));
99
    if (unlikely (surface == NULL)) {
100
        status = _cairo_error (CAIRO_STATUS_NO_MEMORY);
101
        goto FAIL;
102
    }
103
 
104
    _cairo_surface_init (&surface->base, &cairo_paginated_surface_backend,
105
                         content);
106
 
107
    /* Override surface->base.type with target's type so we don't leak
108
     * evidence of the paginated wrapper out to the user. */
109
    surface->base.type = target->type;
110
 
111
    surface->target = cairo_surface_reference (target);
112
 
113
    surface->content = content;
114
    surface->backend = backend;
115
 
116
    surface->meta = _create_meta_surface_for_target (target, content);
117
    status = surface->meta->status;
118
    if (unlikely (status))
119
        goto FAIL_CLEANUP_SURFACE;
120
 
121
    surface->page_num = 1;
122
    surface->page_is_blank = TRUE;
123
 
124
    return &surface->base;
125
 
126
  FAIL_CLEANUP_SURFACE:
127
    cairo_surface_destroy (target);
128
    free (surface);
129
  FAIL:
130
    return _cairo_surface_create_in_error (status);
131
}
132
 
133
cairo_bool_t
134
_cairo_surface_is_paginated (cairo_surface_t *surface)
135
{
136
    return surface->backend == &cairo_paginated_surface_backend;
137
}
138
 
139
cairo_surface_t *
140
_cairo_paginated_surface_get_target (cairo_surface_t *surface)
141
{
142
    cairo_paginated_surface_t *paginated_surface;
143
 
144
    assert (_cairo_surface_is_paginated (surface));
145
 
146
    paginated_surface = (cairo_paginated_surface_t *) surface;
147
 
148
    return paginated_surface->target;
149
}
150
 
151
static cairo_status_t
152
_cairo_paginated_surface_finish (void *abstract_surface)
153
{
154
    cairo_paginated_surface_t *surface = abstract_surface;
155
    cairo_status_t status = CAIRO_STATUS_SUCCESS;
156
 
157
    if (surface->page_is_blank == FALSE || surface->page_num == 1) {
158
        cairo_surface_show_page (abstract_surface);
159
        status = cairo_surface_status (abstract_surface);
160
    }
161
 
162
     /* XXX We want to propagate any errors from destroy(), but those are not
163
      * returned via the api. So we need to explicitly finish the target,
164
      * and check the status afterwards. However, we can only call finish()
165
      * on the target, if we own it.
166
      */
167
    if (CAIRO_REFERENCE_COUNT_GET_VALUE (&surface->target->ref_count) == 1) {
168
        cairo_surface_finish (surface->target);
169
        if (status == CAIRO_STATUS_SUCCESS)
170
            status = cairo_surface_status (surface->target);
171
    }
172
    cairo_surface_destroy (surface->target);
173
 
174
    cairo_surface_finish (surface->meta);
175
    if (status == CAIRO_STATUS_SUCCESS)
176
        status = cairo_surface_status (surface->meta);
177
    cairo_surface_destroy (surface->meta);
178
 
179
    return status;
180
}
181
 
182
static cairo_surface_t *
183
_cairo_paginated_surface_create_image_surface (void            *abstract_surface,
184
                                               int              width,
185
                                               int              height)
186
{
187
    cairo_paginated_surface_t *surface = abstract_surface;
188
    cairo_surface_t *image;
189
    cairo_font_options_t options;
190
 
191
    image = _cairo_image_surface_create_with_content (surface->content,
192
                                                      width,
193
                                                      height);
194
 
195
    cairo_surface_get_font_options (&surface->base, &options);
196
    _cairo_surface_set_font_options (image, &options);
197
 
198
    return image;
199
}
200
 
201
static cairo_status_t
202
_cairo_paginated_surface_acquire_source_image (void            *abstract_surface,
203
                                               cairo_image_surface_t **image_out,
204
                                               void                **image_extra)
205
{
206
    cairo_paginated_surface_t *surface = abstract_surface;
207
    cairo_bool_t is_bounded;
208
    cairo_surface_t *image;
209
    cairo_status_t status;
210
    cairo_rectangle_int_t extents;
211
 
212
    is_bounded = _cairo_surface_get_extents (surface->target, &extents);
213
    if (! is_bounded)
214
        return CAIRO_INT_STATUS_UNSUPPORTED;
215
 
216
    image = _cairo_paginated_surface_create_image_surface (surface,
217
                                                           extents.width,
218
                                                           extents.height);
219
 
220
    status = cairo_meta_surface_replay (surface->meta, image);
221
    if (unlikely (status)) {
222
        cairo_surface_destroy (image);
223
        return status;
224
    }
225
 
226
    *image_out = (cairo_image_surface_t*) image;
227
    *image_extra = NULL;
228
 
229
    return CAIRO_STATUS_SUCCESS;
230
}
231
 
232
static void
233
_cairo_paginated_surface_release_source_image (void       *abstract_surface,
234
                                               cairo_image_surface_t *image,
235
                                               void            *image_extra)
236
{
237
    cairo_surface_destroy (&image->base);
238
}
239
 
240
static cairo_int_status_t
241
_paint_fallback_image (cairo_paginated_surface_t *surface,
242
                       cairo_rectangle_int_t     *rect)
243
{
244
    double x_scale = surface->base.x_fallback_resolution / surface->target->x_resolution;
245
    double y_scale = surface->base.y_fallback_resolution / surface->target->y_resolution;
246
    int x, y, width, height;
247
    cairo_status_t status;
248
    cairo_surface_t *image;
249
    cairo_surface_pattern_t pattern;
250
    cairo_clip_t clip;
251
 
252
    x = rect->x;
253
    y = rect->y;
254
    width = rect->width;
255
    height = rect->height;
256
    image = _cairo_paginated_surface_create_image_surface (surface,
257
                                                           ceil (width  * x_scale),
258
                                                           ceil (height * y_scale));
259
    _cairo_surface_set_device_scale (image, x_scale, y_scale);
260
    /* set_device_offset just sets the x0/y0 components of the matrix;
261
     * so we have to do the scaling manually. */
262
    cairo_surface_set_device_offset (image, -x*x_scale, -y*y_scale);
263
 
264
    status = cairo_meta_surface_replay (surface->meta, image);
265
    if (unlikely (status))
266
        goto CLEANUP_IMAGE;
267
 
268
    _cairo_pattern_init_for_surface (&pattern, image);
269
    cairo_matrix_init (&pattern.base.matrix,
270
                       x_scale, 0, 0, y_scale, -x*x_scale, -y*y_scale);
271
    /* the fallback should be rendered at native resolution, so disable
272
     * filtering (if possible) to avoid introducing potential artifacts. */
273
    pattern.base.filter = CAIRO_FILTER_NEAREST;
274
 
275
    status = _cairo_clip_init_rectangle (&clip, rect);
276
    if (unlikely (status))
277
        goto CLEANUP_IMAGE;
278
 
279
    status = _cairo_surface_paint (surface->target,
280
                                   CAIRO_OPERATOR_SOURCE,
281
                                   &pattern.base, &clip);
282
 
283
    _cairo_clip_reset (&clip);
284
 
285
    _cairo_pattern_fini (&pattern.base);
286
CLEANUP_IMAGE:
287
    cairo_surface_destroy (image);
288
 
289
    return status;
290
}
291
 
292
static cairo_int_status_t
293
_paint_page (cairo_paginated_surface_t *surface)
294
{
295
    cairo_surface_t *analysis;
296
    cairo_status_t status;
297
    cairo_bool_t has_supported, has_page_fallback, has_finegrained_fallback;
298
 
299
    if (unlikely (surface->target->status))
300
        return surface->target->status;
301
 
302
    analysis = _cairo_analysis_surface_create (surface->target);
303
    if (unlikely (analysis->status))
304
        return _cairo_surface_set_error (surface->target, analysis->status);
305
 
306
    surface->backend->set_paginated_mode (surface->target,
307
                                          CAIRO_PAGINATED_MODE_ANALYZE);
308
    status = _cairo_meta_surface_replay_and_create_regions (surface->meta,
309
                                                            analysis);
310
    if (status || analysis->status) {
311
        if (status == CAIRO_STATUS_SUCCESS)
312
            status = analysis->status;
313
        goto FAIL;
314
    }
315
 
316
     if (surface->backend->set_bounding_box) {
317
         cairo_box_t bbox;
318
 
319
         _cairo_analysis_surface_get_bounding_box (analysis, &bbox);
320
         status = surface->backend->set_bounding_box (surface->target, &bbox);
321
         if (unlikely (status))
322
             goto FAIL;
323
     }
324
 
325
    if (surface->backend->set_fallback_images_required) {
326
        cairo_bool_t has_fallbacks = _cairo_analysis_surface_has_unsupported (analysis);
327
 
328
        status = surface->backend->set_fallback_images_required (surface->target,
329
                                                                 has_fallbacks);
330
        if (unlikely (status))
331
            goto FAIL;
332
    }
333
 
334
    /* Finer grained fallbacks are currently only supported for some
335
     * surface types */
336
    if (surface->backend->supports_fine_grained_fallbacks != NULL &&
337
        surface->backend->supports_fine_grained_fallbacks (surface->target))
338
    {
339
        has_supported = _cairo_analysis_surface_has_supported (analysis);
340
        has_page_fallback = FALSE;
341
        has_finegrained_fallback = _cairo_analysis_surface_has_unsupported (analysis);
342
    }
343
    else
344
    {
345
        if (_cairo_analysis_surface_has_unsupported (analysis)) {
346
            has_supported = FALSE;
347
            has_page_fallback = TRUE;
348
        } else {
349
            has_supported = TRUE;
350
            has_page_fallback = FALSE;
351
        }
352
        has_finegrained_fallback = FALSE;
353
    }
354
 
355
    if (has_supported) {
356
        surface->backend->set_paginated_mode (surface->target,
357
                                              CAIRO_PAGINATED_MODE_RENDER);
358
 
359
        status = _cairo_meta_surface_replay_region (surface->meta,
360
                                                    surface->target,
361
                                                    CAIRO_META_REGION_NATIVE);
362
        assert (status != CAIRO_INT_STATUS_UNSUPPORTED);
363
        if (unlikely (status))
364
            goto FAIL;
365
    }
366
 
367
    if (has_page_fallback) {
368
        cairo_rectangle_int_t extents;
369
        cairo_bool_t is_bounded;
370
 
371
        surface->backend->set_paginated_mode (surface->target,
372
                                              CAIRO_PAGINATED_MODE_FALLBACK);
373
 
374
        is_bounded = _cairo_surface_get_extents (surface->target, &extents);
375
        if (! is_bounded) {
376
            status = CAIRO_INT_STATUS_UNSUPPORTED;
377
            goto FAIL;
378
        }
379
 
380
        status = _paint_fallback_image (surface, &extents);
381
        if (unlikely (status))
382
            goto FAIL;
383
    }
384
 
385
    if (has_finegrained_fallback) {
386
        cairo_region_t *region;
387
        int num_rects, i;
388
 
389
        surface->backend->set_paginated_mode (surface->target,
390
                                              CAIRO_PAGINATED_MODE_FALLBACK);
391
 
392
        region = _cairo_analysis_surface_get_unsupported (analysis);
393
 
394
        num_rects = cairo_region_num_rectangles (region);
395
        for (i = 0; i < num_rects; i++) {
396
            cairo_rectangle_int_t rect;
397
 
398
            cairo_region_get_rectangle (region, i, &rect);
399
            status = _paint_fallback_image (surface, &rect);
400
            if (unlikely (status))
401
                goto FAIL;
402
        }
403
    }
404
 
405
  FAIL:
406
    cairo_surface_destroy (analysis);
407
 
408
    return _cairo_surface_set_error (surface->target, status);
409
}
410
 
411
static cairo_status_t
412
_start_page (cairo_paginated_surface_t *surface)
413
{
414
    if (surface->target->status)
415
        return surface->target->status;
416
 
417
    if (! surface->backend->start_page)
418
        return CAIRO_STATUS_SUCCESS;
419
 
420
    return _cairo_surface_set_error (surface->target,
421
                                surface->backend->start_page (surface->target));
422
}
423
 
424
static cairo_int_status_t
425
_cairo_paginated_surface_copy_page (void *abstract_surface)
426
{
427
    cairo_status_t status;
428
    cairo_paginated_surface_t *surface = abstract_surface;
429
 
430
    status = _start_page (surface);
431
    if (unlikely (status))
432
        return status;
433
 
434
    status = _paint_page (surface);
435
    if (unlikely (status))
436
        return status;
437
 
438
    surface->page_num++;
439
 
440
    /* XXX: It might make sense to add some support here for calling
441
     * cairo_surface_copy_page on the target surface. It would be an
442
     * optimization for the output, but the interaction with image
443
     * fallbacks gets tricky. For now, we just let the target see a
444
     * show_page and we implement the copying by simply not destroying
445
     * the meta-surface. */
446
 
447
    cairo_surface_show_page (surface->target);
448
    return cairo_surface_status (surface->target);
449
}
450
 
451
static cairo_int_status_t
452
_cairo_paginated_surface_show_page (void *abstract_surface)
453
{
454
    cairo_status_t status;
455
    cairo_paginated_surface_t *surface = abstract_surface;
456
 
457
    status = _start_page (surface);
458
    if (unlikely (status))
459
        return status;
460
 
461
    status = _paint_page (surface);
462
    if (unlikely (status))
463
        return status;
464
 
465
    cairo_surface_show_page (surface->target);
466
    status = surface->target->status;
467
    if (unlikely (status))
468
        return status;
469
 
470
    status = surface->meta->status;
471
    if (unlikely (status))
472
        return status;
473
 
474
    cairo_surface_destroy (surface->meta);
475
 
476
    surface->meta = _create_meta_surface_for_target (surface->target,
477
                                                     surface->content);
478
    status = surface->meta->status;
479
    if (unlikely (status))
480
        return status;
481
 
482
    surface->page_num++;
483
    surface->page_is_blank = TRUE;
484
 
485
    return CAIRO_STATUS_SUCCESS;
486
}
487
 
488
static cairo_bool_t
489
_cairo_paginated_surface_get_extents (void                    *abstract_surface,
490
                                      cairo_rectangle_int_t   *rectangle)
491
{
492
    cairo_paginated_surface_t *surface = abstract_surface;
493
 
494
    return _cairo_surface_get_extents (surface->target, rectangle);
495
}
496
 
497
static void
498
_cairo_paginated_surface_get_font_options (void                  *abstract_surface,
499
                                           cairo_font_options_t  *options)
500
{
501
    cairo_paginated_surface_t *surface = abstract_surface;
502
 
503
    cairo_surface_get_font_options (surface->target, options);
504
}
505
 
506
static cairo_int_status_t
507
_cairo_paginated_surface_paint (void                    *abstract_surface,
508
                                cairo_operator_t         op,
509
                                const cairo_pattern_t   *source,
510
                                cairo_clip_t            *clip)
511
{
512
    cairo_paginated_surface_t *surface = abstract_surface;
513
 
514
    /* Optimize away erasing of nothing. */
515
    if (surface->page_is_blank && op == CAIRO_OPERATOR_CLEAR)
516
        return CAIRO_STATUS_SUCCESS;
517
 
518
    surface->page_is_blank = FALSE;
519
 
520
    return _cairo_surface_paint (surface->meta, op, source, clip);
521
}
522
 
523
static cairo_int_status_t
524
_cairo_paginated_surface_mask (void             *abstract_surface,
525
                               cairo_operator_t  op,
526
                               const cairo_pattern_t    *source,
527
                               const cairo_pattern_t    *mask,
528
                               cairo_clip_t             *clip)
529
{
530
    cairo_paginated_surface_t *surface = abstract_surface;
531
 
532
    /* Optimize away erasing of nothing. */
533
    if (surface->page_is_blank && op == CAIRO_OPERATOR_CLEAR)
534
        return CAIRO_STATUS_SUCCESS;
535
 
536
    surface->page_is_blank = FALSE;
537
 
538
    return _cairo_surface_mask (surface->meta, op, source, mask, clip);
539
}
540
 
541
static cairo_int_status_t
542
_cairo_paginated_surface_stroke (void                   *abstract_surface,
543
                                 cairo_operator_t        op,
544
                                 const cairo_pattern_t  *source,
545
                                 cairo_path_fixed_t     *path,
546
                                 cairo_stroke_style_t   *style,
547
                                 cairo_matrix_t         *ctm,
548
                                 cairo_matrix_t         *ctm_inverse,
549
                                 double                  tolerance,
550
                                 cairo_antialias_t       antialias,
551
                                 cairo_clip_t           *clip)
552
{
553
    cairo_paginated_surface_t *surface = abstract_surface;
554
 
555
    /* Optimize away erasing of nothing. */
556
    if (surface->page_is_blank && op == CAIRO_OPERATOR_CLEAR)
557
        return CAIRO_STATUS_SUCCESS;
558
 
559
    surface->page_is_blank = FALSE;
560
 
561
    return _cairo_surface_stroke (surface->meta, op, source,
562
                                  path, style,
563
                                  ctm, ctm_inverse,
564
                                  tolerance, antialias,
565
                                  clip);
566
}
567
 
568
static cairo_int_status_t
569
_cairo_paginated_surface_fill (void                     *abstract_surface,
570
                               cairo_operator_t          op,
571
                               const cairo_pattern_t    *source,
572
                               cairo_path_fixed_t       *path,
573
                               cairo_fill_rule_t         fill_rule,
574
                               double                    tolerance,
575
                               cairo_antialias_t         antialias,
576
                               cairo_clip_t             *clip)
577
{
578
    cairo_paginated_surface_t *surface = abstract_surface;
579
 
580
    /* Optimize away erasing of nothing. */
581
    if (surface->page_is_blank && op == CAIRO_OPERATOR_CLEAR)
582
        return CAIRO_STATUS_SUCCESS;
583
 
584
    surface->page_is_blank = FALSE;
585
 
586
    return _cairo_surface_fill (surface->meta, op, source,
587
                                path, fill_rule,
588
                                tolerance, antialias,
589
                                clip);
590
}
591
 
592
static cairo_bool_t
593
_cairo_paginated_surface_has_show_text_glyphs (void *abstract_surface)
594
{
595
    cairo_paginated_surface_t *surface = abstract_surface;
596
 
597
    return cairo_surface_has_show_text_glyphs (surface->target);
598
}
599
 
600
static cairo_int_status_t
601
_cairo_paginated_surface_show_text_glyphs (void                     *abstract_surface,
602
                                           cairo_operator_t          op,
603
                                           const cairo_pattern_t            *source,
604
                                           const char               *utf8,
605
                                           int                       utf8_len,
606
                                           cairo_glyph_t                    *glyphs,
607
                                           int                       num_glyphs,
608
                                           const cairo_text_cluster_t *clusters,
609
                                           int                       num_clusters,
610
                                           cairo_text_cluster_flags_t cluster_flags,
611
                                           cairo_scaled_font_t      *scaled_font,
612
                                           cairo_clip_t             *clip)
613
{
614
    cairo_paginated_surface_t *surface = abstract_surface;
615
 
616
    /* Optimize away erasing of nothing. */
617
    if (surface->page_is_blank && op == CAIRO_OPERATOR_CLEAR)
618
        return CAIRO_STATUS_SUCCESS;
619
 
620
    surface->page_is_blank = FALSE;
621
 
622
    return _cairo_surface_show_text_glyphs (surface->meta, op, source,
623
                                            utf8, utf8_len,
624
                                            glyphs, num_glyphs,
625
                                            clusters, num_clusters,
626
                                            cluster_flags,
627
                                            scaled_font,
628
                                            clip);
629
}
630
 
631
static cairo_surface_t *
632
_cairo_paginated_surface_snapshot (void *abstract_other)
633
{
634
    cairo_paginated_surface_t *other = abstract_other;
635
 
636
    return _cairo_surface_snapshot (other->meta);
637
}
638
 
639
static const cairo_surface_backend_t cairo_paginated_surface_backend = {
640
    CAIRO_INTERNAL_SURFACE_TYPE_PAGINATED,
641
    _cairo_paginated_surface_create_similar,
642
    _cairo_paginated_surface_finish,
643
    _cairo_paginated_surface_acquire_source_image,
644
    _cairo_paginated_surface_release_source_image,
645
    NULL, /* acquire_dest_image */
646
    NULL, /* release_dest_image */
647
    NULL, /* clone_similar */
648
    NULL, /* composite */
649
    NULL, /* fill_rectangles */
650
    NULL, /* composite_trapezoids */
651
    NULL, /* create_span_renderer */
652
    NULL, /* check_span_renderer */
653
    _cairo_paginated_surface_copy_page,
654
    _cairo_paginated_surface_show_page,
655
    _cairo_paginated_surface_get_extents,
656
    NULL, /* old_show_glyphs */
657
    _cairo_paginated_surface_get_font_options,
658
    NULL, /* flush */
659
    NULL, /* mark_dirty_rectangle */
660
    NULL, /* scaled_font_fini */
661
    NULL, /* scaled_glyph_fini */
662
    _cairo_paginated_surface_paint,
663
    _cairo_paginated_surface_mask,
664
    _cairo_paginated_surface_stroke,
665
    _cairo_paginated_surface_fill,
666
    NULL, /* show_glyphs */
667
    _cairo_paginated_surface_snapshot,
668
    NULL, /* is_similar */
669
    NULL, /* fill_stroke */
670
    NULL, /* create_solid_pattern_surface */
671
    NULL, /* can_repaint_solid_pattern_surface */
672
    _cairo_paginated_surface_has_show_text_glyphs,
673
    _cairo_paginated_surface_show_text_glyphs
674
};