mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-04-20 11:36:13 +00:00
Qt: release scaled pixmaps from memory if possible
This commit is contained in:
parent
4d70c483b2
commit
2fb68bfc03
3 changed files with 16 additions and 5 deletions
|
@ -17,10 +17,10 @@ struct gui_game_info
|
|||
compat::status compat;
|
||||
QPixmap icon;
|
||||
QPixmap pxmap;
|
||||
bool hasCustomConfig;
|
||||
bool hasCustomPadConfig;
|
||||
bool has_hover_gif;
|
||||
movie_item* item;
|
||||
bool hasCustomConfig = false;
|
||||
bool hasCustomPadConfig = false;
|
||||
bool has_hover_gif = false;
|
||||
movie_item* item = nullptr;
|
||||
};
|
||||
|
||||
typedef std::shared_ptr<gui_game_info> game_info;
|
||||
|
|
|
@ -2289,7 +2289,7 @@ void game_list_frame::PopulateGameList()
|
|||
|
||||
icon_item->set_icon_func([this, icon_item, game](int)
|
||||
{
|
||||
ensure(icon_item);
|
||||
ensure(icon_item && game);
|
||||
|
||||
if (QMovie* movie = icon_item->movie(); movie && icon_item->get_active())
|
||||
{
|
||||
|
@ -2298,6 +2298,12 @@ void game_list_frame::PopulateGameList()
|
|||
else
|
||||
{
|
||||
icon_item->setData(Qt::DecorationRole, game->pxmap);
|
||||
|
||||
if (!game->has_hover_gif)
|
||||
{
|
||||
game->pxmap = {};
|
||||
}
|
||||
|
||||
if (movie)
|
||||
{
|
||||
movie->stop();
|
||||
|
|
|
@ -114,6 +114,11 @@ movie_item* game_list_grid::addItem(const game_info& app, const QString& name, c
|
|||
painter.drawImage(offset, bg_img);
|
||||
painter.drawPixmap(offset, app->pxmap);
|
||||
|
||||
if (!app->has_hover_gif)
|
||||
{
|
||||
app->pxmap = {};
|
||||
}
|
||||
|
||||
if (movie)
|
||||
{
|
||||
movie->stop();
|
||||
|
|
Loading…
Add table
Reference in a new issue