[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-kimageshop
Subject: are selections part of kispaintdevice or aren't they?
From: Boudewijn Rempt <boud () valdyas ! org>
Date: 2007-10-04 20:26:40
Message-ID: 200710042226.42111.boud () valdyas ! org
[Download RAW message or body]
[Attachment #2 (multipart/signed)]
That's the question...
Right now they are, but that gives a problem with the following bit of code
from KisFilterMask, especially when filters take the selection from the paint
device during KisFilter::process()
void KisFilterMask::apply( KisPaintDeviceSP projection, const QRect & rc )
const
{
Q_ASSERT( m_d->filterConfig );
if (!m_d->filterConfig) return;
selection()->updateProjection();
// XXX: This is actually a problem when we're running multithreaded, so we
need to make
// selection a paramenter of KisFilter::process
KisSelectionSP oldSelection = 0;
if (projection->hasSelection())
oldSelection = projection->selection();
projection->setSelection( selection() );
KisFilterSP filter = KisFilterRegistry::instance()->value(
m_d->filterConfig->name() );
if (!filter) {
kWarning() << "Could not retrieve filter with name " <<
m_d->filterConfig->name();
return;
}
filter->process( projection, rc, m_d->filterConfig);
projection->setSelection( oldSelection );
}
If a layer has more than one filter mask, and if we split up a recomposition
task in chunks, then it is very likely that there will be more than one
KisFilterMask active on the same projection paint device. Which means that
they change the selection while another iterator from another filter is
accessing them.
Poof!
My feeling is that the only solution is to take KisSelection away from
KisPaintDevice, but that means that the iterator's isSelected methods no
longer work and that we have to manually create an iterator on a selection
every time we access a paint device.
Any ideas?
--
Boudewijn Rempt
http://www.valdyas.org/fading/index.cgi
["signature.asc" (application/pgp-signature)]
_______________________________________________
kimageshop mailing list
kimageshop@kde.org
https://mail.kde.org/mailman/listinfo/kimageshop
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic