vcl: split jpeg import into two parts

Desktop / LibreOffice - Miklos Vajna [collabora.co.uk] - 8 May 2017 13:20 EDT

Split the import into two:

1) Just create the bitmap, this part is not thread-safe (e.g. OpenGLContext::makeCurrent() is called when OpenGL is enabled).

2) Import the image into an existing bitmap.

The point is that the second part takes much more time than the first, and in the future that part may be executed on a thread, while without such a split the whole ImportJPEG() can't do that. For now GraphicFilter::ImportGraphic() simply invokes the two parts after each other, so no real functional changes yet.

Change-Id: Iee742a2cd3c581aeaf1a1ed9f55cd543955a85e0 Reviewed-on: https://gerrit.libreoffice.org/37397

e8a0510 vcl: split jpeg import into two parts
include/vcl/bitmapex.hxx | 2 ++
include/vcl/graph.hxx | 2 ++
include/vcl/graphicfilter.hxx | 6 ++++-
vcl/inc/impgraph.hxx | 2 ++
vcl/source/filter/graphicfilter.cxx | 13 +++++++++--
vcl/source/filter/jpeg/JpegReader.cxx | 44 +++++++++++++++++++++--------------
vcl/source/filter/jpeg/JpegReader.hxx | 13 +++++++----
vcl/source/filter/jpeg/jpeg.cxx | 6 ++---
vcl/source/filter/jpeg/jpeg.h | 5 +++-
vcl/source/filter/jpeg/jpeg.hxx | 3 ++-
vcl/source/filter/jpeg/jpegc.cxx | 24 +++++++++++++++----
vcl/source/gdi/bitmapex.cxx | 5 ++++
vcl/source/gdi/graph.cxx | 5 ++++
vcl/source/gdi/impgraph.cxx | 5 ++++
vcl/workben/fftester.cxx | 2 +-
vcl/workben/jpgfuzzer.cxx | 2 +-
16 files changed, 101 insertions(+), 38 deletions(-)

Upstream: cgit.freedesktop.org


  • Share