Fix crash showing color selector when GPU is enabled

It looks like the internal surface has a nullptr color space.
master
David Capello 2022-08-09 16:11:57 -03:00
parent 19b18d2a63
commit 3a917492ee
2 changed files with 5 additions and 3 deletions

2
laf

@ -1 +1 @@
Subproject commit f0bb81ae19517ff8a74cbb00461d3fc5314349f9
Subproject commit a1982c4cea9f69742b9b8a03a4b97ce6964ad5d3

View File

@ -444,8 +444,10 @@ void ColorSelector::onPaint(ui::PaintEvent& ev)
SkCanvas* canvas;
bool isSRGB;
// TODO compare both color spaces
if (get_current_color_space()->isSRGB() &&
g->getInternalSurface()->colorSpace()->isSRGB()) {
if ((!get_current_color_space() ||
get_current_color_space()->isSRGB()) &&
(!g->getInternalSurface()->colorSpace() ||
g->getInternalSurface()->colorSpace()->isSRGB())) {
// We can render directly in the ui::Graphics surface
canvas = &static_cast<os::SkiaSurface*>(g->getInternalSurface())->canvas();
isSRGB = true;