You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The intent behind calling load is that we will attempt to load the highest resolution of the image but fall back to any already loaded resolutions if they exist (see rest of method body).
This wouldn't be a problem if getImageOrLoaded was called in the rendering logic which only runs for the visible splits. However, this method is actually called in the message layout logic, which runs for all splits as messages are added:
I wanted to detail this problem and my investigation into it here so we can find a good solution for properly doing lazy loading. I couldn't immediately think of a solution that uses already-loaded images while queueing up higher resolution images.
This problem reduces the effectiveness of #3915 too, and fixing this problem should also lead to a reduction in memory usage by images.
OS and Chatterino Version
Chatterino 7.3.5 DEBUG (commit 2234670) built with Qt 5.15.2 Running on macOS 12.3, kernel: 21.4.0
The text was updated successfully, but these errors were encountered:
Checklist
Describe your issue
As @pajlada hinted at in #3915 (comment), lazy loading for images that aren't visible (e.g. in a different split tab) is broken.
Currently, images are supposed to be accessed by the
pixmapOrLoad
method inImage
:chatterino2/src/messages/Image.cpp
Lines 334 to 341 in c204332
This lazy loading works as long as no other code calls
Image::load
. However, inImageSet
, we callload
manually:chatterino2/src/messages/ImageSet.cpp
Lines 87 to 92 in c204332
The intent behind calling load is that we will attempt to load the highest resolution of the image but fall back to any already loaded resolutions if they exist (see rest of method body).
This wouldn't be a problem if
getImageOrLoaded
was called in the rendering logic which only runs for the visible splits. However, this method is actually called in the message layout logic, which runs for all splits as messages are added:chatterino2/src/messages/MessageElement.cpp
Lines 179 to 189 in c204332
I wanted to detail this problem and my investigation into it here so we can find a good solution for properly doing lazy loading. I couldn't immediately think of a solution that uses already-loaded images while queueing up higher resolution images.
This problem reduces the effectiveness of #3915 too, and fixing this problem should also lead to a reduction in memory usage by images.
OS and Chatterino Version
Chatterino 7.3.5 DEBUG (commit 2234670) built with Qt 5.15.2 Running on macOS 12.3, kernel: 21.4.0
The text was updated successfully, but these errors were encountered: