201 if (filterFrameData) {
210 if (shared->shouldSwitchTime()) {
211 runAndSaveCommand( toQShared( new KisLayerUtils::SwitchFrameCommand(shared->image(), shared->frameTime(), false, shared->storage()) )
212 , KisStrokeJobData::BARRIER, KisStrokeJobData::NORMAL);
216 shared->filterDevice =
new KisPaintDevice(*shared->targetDevice());
219 shared->filterDeviceBounds = shared->filterDevice->exactBounds();
221 if (shared->filter()->needsTransparentPixels(shared->filterConfig().data(), shared->targetDevice()->colorSpace())) {
222 shared->filterDeviceBounds |= shared->targetDevice()->defaultBounds()->bounds();
225 shared->processRect = shared->filter()->changedRect(shared->filterDeviceBounds, shared->filterConfig(), shared->levelOfDetail());
226 shared->processRect &= shared->targetDevice()->defaultBounds()->bounds();
230 if (shared->selection() ||
231 (shared->targetDevice()->colorSpace() != shared->targetDevice()->compositionSourceColorSpace() &&
232 *shared->targetDevice()->colorSpace() != *shared->targetDevice()->compositionSourceColorSpace())) {
234 shared->filterDevice = shared->targetDevice()->createCompositionSourceDevice(shared->targetDevice());
236 if (shared->selection()) {
237 shared->filterDeviceBounds &= shared->selection()->selectedRect();
242 shared->filterDeviceTransaction.reset(
new KisTransaction(shared->filterDevice));
249 if (shared->filter()->supportsThreading()) {
254 Q_FOREACH (
const QRect &patch, patches) {
255 if (!patch.isEmpty()) {
257 shared->filter()->processImpl(shared->filterDevice, patch,
258 shared->filterConfig().data(),
259 progress->updater());
264 if (!shared->processRect.isEmpty()) {
266 shared->filter()->processImpl(shared->filterDevice, shared->processRect,
267 shared->filterConfig().data(),
268 progress->updater());
280 shared->filterDeviceTransaction.reset();
282 if (!shared->filterDeviceBounds.intersects(
283 shared->filter()->neededRect(shared->processRect, shared->filterConfig().data(), shared->levelOfDetail()))) {
289 QScopedPointer<KisTransaction> workingTransaction(
new KisTransaction(shared->targetDevice()) );
290 KisPainter::copyAreaOptimized(shared->processRect.topLeft(), shared->filterDevice, shared->targetDevice(), shared->processRect, shared->selection());
293 if (shared->shouldRedraw()) {
294 QRect extraUpdateRect;
297 shared->node()->setDirty(shared->processRect | extraUpdateRect);
309 shared->image()->animationInterface()->invalidateFrame(shared->frameTime(), shared->node());
310 if (shared->shouldSwitchTime()) {
320 }
else if (jobData) {
SubTaskSharedData(KisImageSP image, KisNodeSP node, int levelOfDetail, KisSelectionSP selection, KisFilterSP filter, KisFilterConfigurationSP config, KisFilterStrokeStrategy::FilterJobData *filterFrameData)