SHA256
1
0
forked from pool/cairo
cairo/cairo-pdf-add-missing-flush.patch
Dominique Leuenberger b2d3511d45 Accepting request 778621 from home:mwilck:branches:GNOME:Factory
- Add an upstream bug fix
  + cairo-pdf-add-missing-flush.patch: Fixes PDF generation
    see https://gitlab.freedesktop.org/cairo/cairo/issues/342

I have a PDF document here that prints as total bogus when processed
with cups filters (using libcairo, e.g. from evince) without this patch.
Unfortunately I can't share the file for privacy reasons. 
See also https://github.com/OpenPrinting/cups-filters/issues/93.

OBS-URL: https://build.opensuse.org/request/show/778621
OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/cairo?expand=0&rev=149
2020-02-27 15:49:14 +00:00

30 lines
910 B
Diff

From 4c8813f0eaacc32c27126ad2296951a626300b89 Mon Sep 17 00:00:00 2001
From: Adrian Johnson <ajohnson@redneon.com>
Date: Thu, 25 Oct 2018 18:46:17 +1030
Subject: [PATCH] pdf: add missing flush
Issue #342
---
src/cairo-pdf-surface.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/cairo-pdf-surface.c b/src/cairo-pdf-surface.c
index 7eb61aa..939b2d2 100644
--- a/src/cairo-pdf-surface.c
+++ b/src/cairo-pdf-surface.c
@@ -7711,6 +7711,11 @@ _cairo_pdf_surface_mask (void *abstract_surface,
* and most common, case to handle. */
if (_cairo_pattern_is_constant_alpha (mask, &extents.bounded, &alpha) &&
_can_paint_pattern (source)) {
+
+ status = _cairo_pdf_operators_flush (&surface->pdf_operators);
+ if (unlikely (status))
+ goto cleanup;
+
_cairo_output_stream_printf (surface->output, "q\n");
status = _cairo_pdf_surface_paint_pattern (surface,
op,
--
2.25.0