Commit e7364e67 authored by Jehan's avatar Jehan Committed by Albert Astals Cid

Fix setting antialiasing by editing Cairo context.

Commit 853e9499 added setAntialias() to CairoOutputDev, in particular
to allow setting up antialiasing on the pdftocairo utils through a CLI
option (-antialias).
Unfortunately this broke applications which used the glib API and used
to simply set the antialiasing through the Cairo context, and now always
get the default antialiasing (even if we added a new API, it would break
API behavior and simplicity).

Instead only use the `antialias` member if it is set to non-default,
which means it has been changed explicitly by some means. Keep the cairo
context as-is otherwise.
parent fb5d8000
Pipeline #25489 passed with stages
in 40 minutes and 38 seconds
......@@ -208,7 +208,12 @@ void CairoOutputDev::setCairo(cairo_t *cairo)
/* save the initial matrix so that we can use it for type3 fonts. */
//XXX: is this sufficient? could we miss changes to the matrix somehow?
cairo_get_matrix(cairo, &orig_matrix);
setContextAntialias(cairo, antialias);
/* Only use the antialias member if it has been explicitly set to
* non-default. This allows software using poppler API to set the
* antialiasing through cairo context.
* */
setContextAntialias(cairo, antialias);
} else {
this->cairo = nullptr;
this->cairo_shape = nullptr;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment