Commit 8a97a54e authored by Dmitry Kazakov's avatar Dmitry Kazakov

Activate 'external frame' feature only for real projection devices

NOTE: if you see some artifacts while rendering frames, please check twice
      if all the static probjection devices are declared as used
      in projection.
parent 35a07eb4
......@@ -70,6 +70,7 @@ KisGroupLayer::KisGroupLayer(const KisGroupLayer &rhs) :
m_d->x = rhs.m_d->x;
m_d->y = rhs.m_d->y;
m_d->paintDevice->setDefaultPixel(const_cast<KisGroupLayer*>(&rhs)->m_d->paintDevice->defaultPixel());
m_d->paintDevice->setProjectionDevice(true);
}
KisGroupLayer::~KisGroupLayer()
......@@ -174,6 +175,7 @@ void KisGroupLayer::resetCache(const KoColorSpace *colorSpace)
dev->setX(this->x());
dev->setY(this->y());
m_d->paintDevice = dev;
m_d->paintDevice->setProjectionDevice(true);
}
else if(!(*m_d->paintDevice->colorSpace() == *colorSpace)) {
......@@ -189,6 +191,7 @@ void KisGroupLayer::resetCache(const KoColorSpace *colorSpace)
dev->setDefaultPixel(defaultPixel);
delete[] defaultPixel;
m_d->paintDevice = dev;
m_d->paintDevice->setProjectionDevice(true);
} else {
m_d->paintDevice->clear();
......
......@@ -64,6 +64,7 @@ public:
!(*m_projection->colorSpace() == *prototype->colorSpace())) {
m_projection = m_reusablePaintDevice;
m_projection->makeCloneFromRough(prototype, prototype->extent());
m_projection->setProjectionDevice(true);
}
return m_projection;
......
......@@ -88,6 +88,7 @@ public:
QScopedPointer<KisPaintDeviceStrategy> basicStrategy;
QScopedPointer<KisPaintDeviceWrappedStrategy> wrappedStrategy;
QScopedPointer<KisPaintDeviceFramesInterface> framesInterface;
bool isProjectionDevice;
KisPaintDeviceStrategy* currentStrategy();
......@@ -339,7 +340,7 @@ private:
// sanity check!
KIS_ASSERT_RECOVER_NOOP(!m_data);
} else if (defaultBounds->externalFrameActive()) {
} else if (isProjectionDevice && defaultBounds->externalFrameActive()) {
if (!m_externalFrameData) {
QMutexLocker l(&m_dataSwitchLock);
if (!m_externalFrameData) {
......@@ -429,7 +430,8 @@ KisPaintDevice::Private::Private(KisPaintDevice *paintDevice)
: q(paintDevice),
basicStrategy(new KisPaintDeviceStrategy(paintDevice, this)),
m_data(new Data(paintDevice)),
nextFreeFrameId(0)
nextFreeFrameId(0),
isProjectionDevice(false)
{
}
......@@ -789,6 +791,11 @@ KisPaintDevice::~KisPaintDevice()
delete m_d;
}
void KisPaintDevice::setProjectionDevice(bool value)
{
m_d->isProjectionDevice = value;
}
void KisPaintDevice::prepareClone(KisPaintDeviceSP src)
{
m_d->prepareClone(src);
......
......@@ -796,6 +796,7 @@ public:
public:
QRegion syncLodCache(int levelOfDetail);
void setProjectionDevice(bool value);
void tesingFetchLodDevice(KisPaintDeviceSP targetDevice);
private:
......
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