https://bugs.documentfoundation.org/show_bug.cgi?id=150551

--- Comment #9 from Armin Le Grand <[email protected]> ---
Hi Rafael,
I took a look:

Export starts by recording a Metafle (unfortunately still the base for PDF
export, no Primitive processor for that). At
drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx:2004 in
processPolyPolygonGradientPrimitive2D the fallback to the 'old' vcl-paint is
taken.

The PDF exporter in vcl/source/gdi/pdfwriter_impl2.cxx:681 in playMetafile sees
the created MetaCommentAction containing the gradient as "XPATHFILL_SEQ_BEGIN",
but that is no used (here are two stacked XPATHFILL_SEQ_BEGIN/XPATHFILL_SEQ_END
pairs here created from he old former paint). This is no used.

It continues to the 2nd pair at ln 555 and detects the comment as
MetaGradientExAction. There ln 581 implWriteGradient is taken. That creates the
MetafileAcions temporarily (AddGradientActions) and plays them inside the
PDFWriterImpl using playMetafile.

Gradient::AddGradientActions uses Gradient::DrawComplexGradientToMetafile. That
(old) stuff creates a stepped bunch of 'donuts'. These get written as filled
polyPolygons to the PDF.

What we see is not directly an error, but bad quality of the 'overlapping' of
those 'donuts' building the gradient.

The gradient cannot directly be exported to PDF since our old gradient
definitions cannot be matched to PDF definitions, so this geometric
representation is created and exported.

For non-transparent gradients it is possible (and simpler) to not use 'donuts'
but the whole stack of overlapping ellipses.

We could try to balance around with the sizes of the 'donuts' to get a better
overlapping - problem is the AntiAliased paint in the PDF renderer(s) here - it
sees only a bunch of 'donuts' and does not know that it's supposed to be a
gradient. We did that a lot - experience tells that his will probably create
another problem somewhere else (Gradient::AddGradientActions is no only used
for PDF export).

It's ugly but there is unfortunately no simple, good solution. A bigger
redesign would be needed to generally solve that stuff. When debugging you can
see many places where fixes/changes were already done, too - very dangerous and
unstable (unfortunately).

Sorry, no simple fix available...

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to