ANN: ongoing emf+ parser & rendering rework
Thorsten Behrens
thb at libreoffice.org
Thu Jul 20 01:00:36 UTC 2017
Dear fellow hackers,
as of Saturday, a first cut of a new emf+ parser & rendering framework
from Armin has hit master (thx to Moggi and Stephan for fixing up the
ODR / unit test breakage fallout!).
The old implementation is a source of significant pain & issues
(separate implementation, only able to render into offscreen bitmaps,
no real vector, incomplete import etc etc). There have been various
efforts & plans in the past to address that (some of the heroes of
fixing the existing impl, and those interested in a rewrite in Cc) -
so I'm most happy to announce that the Technical University Dresden /
Germany stepped up & in the person of Prof. Oliver Sander is funding
this re-factoring.
That out of the way, here's how to play with it & hack it:
* in recent master (Tuesday or later, to avoid unit test issues)
* get yourself a dbgutil build
* either change in the cxx, or set in the debugger:
bTestEMFPDecomposition to true
(drawinglayer/source/processor2d/vclpixelprocessor2d.cxx:500
currently)
* of course stick an emf+ graphic into your document ;)
* for directly comparing old vs. new, also set bUseChangedColorObject
to true (gets you a blended overlay for new and old renderer)
Right now, it's all pretty bare-bones - technically, wmf/emf/emf+
parsers have been moved to emfio, and code is in place to convert wmf
& friends data into a vector scene graph just like svg is currently
imported & rendered. End-to-end, currently only polygons and colors
are working though - any help to expand functionality there
appreciated. But the framework & preparation work has landed now,
including carrying the original binary files around for proper
roundtrips, and holding a buffered preview graphic for quick repaints.
Next steps (again, help much appreciated!):
- add more GraphicPrimitive generators, complete up to a state that
the filter at least covers what the current direct canvas renderer
delivers:
* clip regions
* text rendering - it's parsed, but graphic primitive generation is
missing
* gradients/hatches
- once this works, cut over to new impl, bin the old code in cppcanvas
(there's sadly a small amount of duplicate code now in the parsers)
- iteratively expand, to cover near-100% of EMF+ (mostly lacking around
gradients & effects):
* more complex fill types like bitmaps/tiles
* path gradient
* xor & stuff
Cheers,
-- Thorsten
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 949 bytes
Desc: Digital signature
URL: <https://lists.freedesktop.org/archives/libreoffice/attachments/20170720/42b13f16/attachment.sig>
More information about the LibreOffice
mailing list