diff options
author | Adrian Johnson <ajohnson@redneon.com> | 2008-01-11 22:07:26 +1030 |
---|---|---|
committer | Adrian Johnson <ajohnson@redneon.com> | 2008-01-11 22:07:26 +1030 |
commit | 2574cc35b3478e7333bd4953e90a3edc5f7c4f16 (patch) | |
tree | 4f1fb09994e6b3487aeef6a1e87949d0be522539 /src/cairo-win32-printing-surface.c | |
parent | 7ef4caaf11379cb50a08520f729552553de60660 (diff) |
win32-printing: Do not clip and paint with an empty path
For non solid patterns _fill and _show_glyphs sets a clip
path then paints the pattern. Previously if the path is empty
SelectClipPath did not set clip. This was probably the cause
of bug 13657 where the entire page was black.
Fix this by not painting anything if the path is empty.
Diffstat (limited to 'src/cairo-win32-printing-surface.c')
-rw-r--r-- | src/cairo-win32-printing-surface.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/cairo-win32-printing-surface.c b/src/cairo-win32-printing-surface.c index ac41e903..3a5a3b88 100644 --- a/src/cairo-win32-printing-surface.c +++ b/src/cairo-win32-printing-surface.c @@ -874,6 +874,7 @@ _cairo_win32_printing_surface_path_line_to (void *closure, cairo_point_t *point) { win32_path_info_t *path_info = closure; + path_info->surface->path_empty = FALSE; if (path_info->surface->has_ctm) { double x, y; @@ -899,6 +900,7 @@ _cairo_win32_printing_surface_path_curve_to (void *closure, win32_path_info_t *path_info = closure; POINT points[3]; + path_info->surface->path_empty = FALSE; if (path_info->surface->has_ctm) { double x, y; @@ -1244,6 +1246,7 @@ _cairo_win32_printing_surface_fill (void *abstract_surface, assert (_cairo_win32_printing_surface_operation_supported (surface, op, source)); + surface->path_empty = TRUE; BeginPath (surface->dc); status = _cairo_win32_printing_surface_emit_path (surface, path); EndPath (surface->dc); @@ -1266,7 +1269,7 @@ _cairo_win32_printing_surface_fill (void *abstract_surface, FillPath (surface->dc); _cairo_win32_printing_surface_done_solid_brush (surface); - } else { + } else if (surface->path_empty == FALSE) { SaveDC (surface->dc); SelectClipPath (surface->dc, RGN_AND); status = _cairo_win32_printing_surface_paint_pattern (surface, source); @@ -1358,6 +1361,7 @@ _cairo_win32_printing_surface_show_glyphs (void *abstract_surfac old_ctm = surface->ctm; old_has_ctm = surface->has_ctm; surface->has_ctm = TRUE; + surface->path_empty = TRUE; BeginPath (surface->dc); for (i = 0; i < num_glyphs; i++) { status = _cairo_scaled_glyph_lookup (scaled_font, @@ -1373,7 +1377,7 @@ _cairo_win32_printing_surface_show_glyphs (void *abstract_surfac EndPath (surface->dc); surface->ctm = old_ctm; surface->has_ctm = old_has_ctm; - if (status == CAIRO_STATUS_SUCCESS) { + if (status == CAIRO_STATUS_SUCCESS && surface->path_empty == FALSE) { if (source->type == CAIRO_PATTERN_TYPE_SOLID) { status = _cairo_win32_printing_surface_select_solid_brush (surface, source); if (status) |