Bug 92018 - Implement caching for native widget rendering for Mac / OpenGL rendering
Summary: Implement caching for native widget rendering for Mac / OpenGL rendering
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: graphics stack (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: Other All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: difficultyInteresting, easyHack, skillCpp
Depends on:
Blocks: Impress-OpenGL
  Show dependency treegraph
 
Reported: 2015-06-12 01:05 UTC by Markus Mohrhard
Modified: 2020-08-28 12:24 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Mohrhard 2015-06-12 01:05:03 UTC
One of the slowest parts of our current OpenGL rendering is rendering the native widgets. They are currently rendered to a pixmap and later transferred as texture to the GPU. That is a slow process and costs valuable time in the rendering pipeline as it blocks the rendering and causes thousands of unnecessary OpenGL calls.

it might also benefit our normal rendering if we can cache some of the widgets that are rendered over and over again.

We should implement a cache for these native widgets that stores a texture id in the OpenGL case and maybe a pixmap in the normal case.

For the cache to work correctly we need to use all relevant information as cache key and have a mechanism to kick out unused entries from the cache.

In the OpenGL case we might also want to use a OpenGL texture atlas to avoid texture fragmentation which I'll add as a second easy hack.

The place to look for it is in GtkSalGraphics::drawNativeControl.
Comment 1 Commit Notification 2015-07-24 10:16:33 UTC
Tomaž Vajngerl committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=450727fdffa4a0dc3b2d4e635a5c1bc0411b3c36

tdf#92018 cache native controls for X11 OpenGL backend (for now)

It will be available in 5.1.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 2 Commit Notification 2015-08-07 09:34:42 UTC
Tomaž Vajngerl committed a patch related to this issue.
It has been pushed to "libreoffice-5-0":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=b4faa69e4a9a99cdd12b7999d95459b1a8639e9f&h=libreoffice-5-0

tdf#92018 cache native controls for X11 OpenGL backend (for now)

It will be available in 5.0.1.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 3 Michael Meeks 2015-08-19 12:32:30 UTC
commit dea885f80a80c6a5839ee5dbf8521487186a9522
Author: Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>
Date:   Mon Aug 3 15:06:55 2015 +0900

    opengl: cache native widget textures also for Windows

is the windows piece; I guess Mac is the last bit (?)
Comment 4 Markus Mohrhard 2015-08-19 13:26:08 UTC
(In reply to Michael Meeks from comment #3)
> commit dea885f80a80c6a5839ee5dbf8521487186a9522
> Author: Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>
> Date:   Mon Aug 3 15:06:55 2015 +0900
> 
>     opengl: cache native widget textures also for Windows
> 
> is the windows piece; I guess Mac is the last bit (?)

There is no OpenGL mac vcl backend. There is OpenGL support on mac and in general it should be a lot easier to implement the backend as we use a OpenGL enabled widget from the system. So we would just need to make sure that we only generate these and render to them through OpenGL.
Comment 5 Michael Meeks 2015-08-25 15:00:09 UTC
Dropping tracker for now - this is mac specific.
Comment 6 Robinson Tryon (qubit) 2015-12-14 06:59:36 UTC Comment hidden (obsolete)
Comment 7 Robinson Tryon (qubit) 2016-02-18 14:52:34 UTC Comment hidden (obsolete)
Comment 8 Buovjaga 2020-08-28 12:24:54 UTC
Let's call this fixed as it does not make sense to invest in OpenGL improvements anymore after Skia's success.