diff options
author | Vladimir Vukicevic <vladimir@pobox.com> | 2007-08-29 16:25:58 -0700 |
---|---|---|
committer | Vladimir Vukicevic <vladimir@pobox.com> | 2007-09-18 09:28:29 -0700 |
commit | ffc16c4be2fb5a0d214cb186dee52e74dbd584cf (patch) | |
tree | 18e1784d31d1c1161316ea7ea3ef794aa45188fc /src/cairo-paginated-surface.c | |
parent | 284ed91ee4418baf6dd1a437a904980a2156fa48 (diff) |
[win32] Add win32 printing surface
Add win32 surface intended for use with printer DCs; GDI will be used
as much as possible, and the surface will be a paginated surface
that supports fine-grained fallback.
(Original work from Adrian Johnson; additional fixes by me.)
Diffstat (limited to 'src/cairo-paginated-surface.c')
-rw-r--r-- | src/cairo-paginated-surface.c | 37 |
1 files changed, 21 insertions, 16 deletions
diff --git a/src/cairo-paginated-surface.c b/src/cairo-paginated-surface.c index bf4e3410..78b7e304 100644 --- a/src/cairo-paginated-surface.c +++ b/src/cairo-paginated-surface.c @@ -300,22 +300,27 @@ _paint_page (cairo_paginated_surface_t *surface) return status; } - /* Finer grained fallbacks are currently only supported for PDF - * and PostScript surfaces */ - if (surface->target->type == CAIRO_SURFACE_TYPE_PDF || - surface->target->type == CAIRO_SURFACE_TYPE_PS) { - has_supported = _cairo_analysis_surface_has_supported (analysis); - has_page_fallback = FALSE; - has_finegrained_fallback = _cairo_analysis_surface_has_unsupported (analysis); - } else { - if (_cairo_analysis_surface_has_unsupported (analysis)) { - has_supported = FALSE; - has_page_fallback = TRUE; - } else { - has_supported = TRUE; - has_page_fallback = FALSE; - } - has_finegrained_fallback = FALSE; + /* Finer grained fallbacks are currently only supported for some + * surface types */ + switch (surface->target->type) { + case CAIRO_SURFACE_TYPE_PDF: + case CAIRO_SURFACE_TYPE_PS: + case CAIRO_SURFACE_TYPE_WIN32_PRINTING: + has_supported = _cairo_analysis_surface_has_supported (analysis); + has_page_fallback = FALSE; + has_finegrained_fallback = _cairo_analysis_surface_has_unsupported (analysis); + break; + + default: + if (_cairo_analysis_surface_has_unsupported (analysis)) { + has_supported = FALSE; + has_page_fallback = TRUE; + } else { + has_supported = TRUE; + has_page_fallback = FALSE; + } + has_finegrained_fallback = FALSE; + break; } if (has_supported) { |