Introduce a per-DPR LRU pixmap cache for the scaled avatars. This
should ensure ruqola uses the correct pixmap even in heterogeneous
multi-screen setups with different per-screen DPR values.
Details
Diff Detail
- Repository
- R865 Ruqola
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
the layout uses the larger scale size now for the line height which is wrong, it needs to take the dpr into account - will fix
src/widgets/room/delegate/messagelistdelegate.cpp | ||
---|---|---|
129 | Why does this still use QPixmapCache, if we're caching the pixmap in mScaledAvatars anyway? AFAICT we're not going to go into the first if() more than once for a given avatar. | |
src/widgets/room/delegate/messagelistdelegate.h | ||
69 | two spaces after "QWidget" |
src/widgets/room/delegate/messagelistdelegate.cpp | ||
---|---|---|
129 | yes you are right, it's probably overkill - I'll remove it. we'd be able to share across screens but that's very uncommon so let's remove that. and while at it - I'll also not use a QHash for the per-dpr but only keep one cache and check if the DPR matches the current one |
src/core/lrucache.h | ||
---|---|---|
100 | Oh, it's a std::array, I thought it was some sort of vector. OK then this probably isn't necessary, sorry for the wrong request. |
src/core/lrucache.h | ||
---|---|---|
100 | I'll keep it to free the memory of the previously-used pixmaps |