Bug 88302

Summary: Embedding graphics slows down scrolling massively
Product: LibreOffice Reporter: barade.barade
Component: WriterAssignee: Not Assigned <libreoffice-bugs>
Status: RESOLVED DUPLICATE    
Severity: normal CC: aron.budea, ilmari.lauhakangas, robinson.libreoffice
Priority: medium Keywords: perf
Version: 4.2.6.3 release   
Hardware: Other   
OS: All   
See Also: https://bugs.documentfoundation.org/show_bug.cgi?id=78529
Whiteboard:
Crash report or crash signature: Regression By:
Attachments: Test document with bg image that slows down scrolling

Description barade.barade 2015-01-11 22:05:36 UTC
The embedded graphic is a JPEG file with a resolution of 2480x3507 but scaled down to a DINA page. scrolling through the document is slow as hell.
Comment 1 barade.barade 2015-01-11 23:07:46 UTC
Scrolling is only that slow when a part of the image is visible. Scrolling through other pages works fine.
Comment 2 Robinson Tryon (qubit) 2015-01-14 20:11:49 UTC
(In reply to barade.barade from comment #0)
> The embedded graphic is a JPEG file with a resolution of 2480x3507 but
> scaled down to a DINA page. scrolling through the document is slow as hell.

Hi barade,
Please attach a test document that demonstrates the slow-down problem, then change Status back to 'UNCONFIRMED'. Thanks!

Status -> NEEDINFO
Comment 3 Hannes 2015-03-24 00:32:57 UTC
Created attachment 114286 [details]
Test document with bg image that slows down scrolling
Comment 4 Hannes 2015-03-24 00:34:17 UTC
Attached a test document.
Comment 5 Buovjaga 2015-03-25 20:01:20 UTC
(In reply to Hannes from comment #3)
> Created attachment 114286 [details]
> Test document with bg image that slows down scrolling

Yep, this is slow.

Win 7 Pro 64-bit, LibO Version: 4.4.1.2
Build ID: 45e2de17089c24a1fa810c8f975a7171ba4cd432
Locale: fi_FI
Comment 6 Robinson Tryon (qubit) 2015-12-09 18:08:12 UTC Comment hidden (obsolete)
Comment 7 Aron Budea 2016-05-03 15:00:29 UTC
Profiling points to function scalePallete8bit2(ScaleContext &rCtx, long nStartY, long nEndY):
http://opengrok.libreoffice.org/xref/core/vcl/source/bitmap/bitmapscalesuper.cxx#285

4 levels of nested loops... yummy.
Comment 8 Aron Budea 2016-05-03 15:49:52 UTC
However, since different image types, where this function is not involved also show similar behavior during scrolling (eg. bug 96880), the real issue could be in how repainting is done.
Comment 9 Michael Meeks 2016-09-30 07:53:10 UTC
Aaron is basically right - we should be caching interpolated-down images - even if we have H/W acceleration enabled - on Windows you can enable OpenGL and get fast rendering and interpolation of that if your GL driver is supported but ... ;-)

Looks like a dup; thanks for the report !

*** This bug has been marked as a duplicate of bug 80659 ***