[gpu] Fix outdated os::Surface to show latest changes on the canvas

We have to mark the SkBitmap as modified (new generation ID) in
convert_image_to_surface() so we upload the bitmap changes as a new
texture in the GPU.
This commit is contained in:
David Capello 2024-06-17 14:11:14 -03:00
parent 84942175ca
commit 2827618786
2 changed files with 12 additions and 2 deletions

2
laf

@ -1 +1 @@
Subproject commit 968f0e4b935c77ec3701307ec963f5e058254424
Subproject commit feba52e4ca7855219044e9fdf936ecb6b9b4d1ca

View File

@ -1,5 +1,5 @@
// Aseprite
// Copyright (c) 2020 Igara Studio S.A.
// Copyright (c) 2020-2024 Igara Studio S.A.
// Copyright (c) 2001-2018 David Capello
//
// This program is distributed under the terms of
@ -20,6 +20,10 @@
#include "os/surface.h"
#include "os/surface_format.h"
#if LAF_SKIA
#include "os/skia/skia_surface.h"
#endif
#include <algorithm>
#include <stdexcept>
@ -205,6 +209,12 @@ void convert_image_to_surface(
ASSERT(false);
throw std::runtime_error("conversion not supported");
}
#if LAF_SKIA
// Increment SkBitmap generation ID so it's re-uploaded to the GPU
// as a texture if it's needed.
static_cast<os::SkiaSurface*>(surface)->bitmap().notifyPixelsChanged();
#endif
}
} // namespace app