Commit 1ba0a6ba authored by Dmitry Kazakov's avatar Dmitry Kazakov

Fix color space of onion skins cache device

BUG:407251
parent adafa8b7
......@@ -27,6 +27,7 @@
#include "kis_onion_skin_compositor.h"
#include "kis_default_bounds.h"
#include "kis_image.h"
#include "KoColorSpace.h"
#include "kis_raster_keyframe_channel.h"
......@@ -86,13 +87,19 @@ KisPaintDeviceSP KisOnionSkinCache::projection(KisPaintDeviceSP source)
readLocker.unlock();
QWriteLocker writeLocker(&m_d->lock);
cachedProjection = m_d->cachedProjection;
if (!cachedProjection || !m_d->checkCacheValid(source, compositor)) {
if (!cachedProjection ||
!m_d->checkCacheValid(source, compositor) ||
*cachedProjection->colorSpace() != *source->colorSpace()) {
if (!cachedProjection) {
cachedProjection = new KisPaintDevice(source->colorSpace());
} else {
cachedProjection->setDefaultBounds(new KisDefaultBounds());
cachedProjection->clear();
if (*cachedProjection->colorSpace() != *source->colorSpace()) {
cachedProjection->convertTo(source->colorSpace());
}
}
const QRect extent = compositor->calculateExtent(source);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment