diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2012-04-12 10:51:38 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2012-04-12 12:22:17 +0100 |
commit | 25abe582982caeb07d1e0af4acca53bb110a33bf (patch) | |
tree | 6854e4b2f2f0f53ebf26506378e269bafd8f2eac /boilerplate | |
parent | a3f97d1d2e77a0fee4ca03d5dc9968952a440561 (diff) |
pdf (debug API): Export the ability to force fallbacks
We need to occasionally force fallbacks whilst testing the PDF
output, so export a debug interface to do so in order to avoid poking
around inside cairo internals.
References: https://bugs.freedesktop.org/show_bug.cgi?id=48577
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'boilerplate')
-rw-r--r-- | boilerplate/cairo-boilerplate-pdf.c | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/boilerplate/cairo-boilerplate-pdf.c b/boilerplate/cairo-boilerplate-pdf.c index d76d13951..985540b2f 100644 --- a/boilerplate/cairo-boilerplate-pdf.c +++ b/boilerplate/cairo-boilerplate-pdf.c @@ -29,8 +29,6 @@ #if CAIRO_CAN_TEST_PDF_SURFACE #include <cairo-pdf.h> -#include <cairo-pdf-surface-private.h> -#include <cairo-paginated-surface-private.h> #if HAVE_SIGNAL_H #include <signal.h> @@ -221,23 +219,18 @@ _cairo_boilerplate_pdf_cleanup (void *closure) } static void -_cairo_boilerplate_pdf_force_fallbacks (cairo_surface_t *abstract_surface, +_cairo_boilerplate_pdf_force_fallbacks (cairo_surface_t *surface, double x_pixels_per_inch, double y_pixels_per_inch) { - pdf_target_closure_t *ptc = cairo_surface_get_user_data (abstract_surface, - &pdf_closure_key); - - cairo_paginated_surface_t *paginated; - cairo_pdf_surface_t *surface; + pdf_target_closure_t *ptc = + cairo_surface_get_user_data (surface, &pdf_closure_key); if (ptc->target) - abstract_surface = ptc->target; + surface = ptc->target; - paginated = (cairo_paginated_surface_t*) abstract_surface; - surface = (cairo_pdf_surface_t*) paginated->target; - surface->force_fallbacks = TRUE; - cairo_surface_set_fallback_resolution (&paginated->base, + cairo_pdf_surface_debug_force_fallbacks (surface); + cairo_surface_set_fallback_resolution (surface, x_pixels_per_inch, y_pixels_per_inch); } |