Hi Armin,
Il 09/07/24 22:26, Michael Meeks ha scritto:
Hi Armin,
Currently we're in a bit of a rush; but we have some code that can
render individual elements of a slide; and I believe we're currently
doing this by rendering via to a GDI meta-file and then re-rendering to
pixels.
I would expect that we could do this rather better in future by
rendering with primitives directly to an outputdevice of some kind.
Would appreciate a quick poke at Marco's code to see how easy that
is to do - at least if it doesn't slow us down coding time-wise =)
Marco - do you have some pointers ?
I'm trying to subdivide a slide in layers and render them separately:
background, master page objects, static shapes, animated shapes, etc.
In order to do so I adapted the rendering code in the slideshow module
which uses GDI meta-file.
For instance in
https://git.libreoffice.org/core/+/refs/heads/distro/collabora/co-24.04/slideshow/source/engine/slide/slideimpl.cxx,
you can see LOKSlideRenderer::createLayerBitmap and
LOKSlideRenderer::renderLayerBitmapImpl methods. In the latter the call
to pBitmap->draw(pDevicePixelCanvas) resolves in executing meta actions
belonging to a gdi meta-file. In the end it is the same done for
rendering the bitmap when the slideshow is running in Impress:
https://git.libreoffice.org/core/+/refs/heads/distro/collabora/co-24.04/slideshow/source/engine/slide/slideimpl.cxx#942.
I'm not sure at which stage this GDI meta-file is generated and if it's
possible to render an XShape instance in another way. In fact the
slideshow module is very isolated wrt the other LibreOffice modules.
Thanks,
Marco