Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 6a85ac08 authored by Dmitry Kazakov's avatar Dmitry Kazakov

Partly fix preview of some filter

The temporary device should have a transaction. If we do not create
a temporary device (which means src==dst), then this is a caller's
responsibility to create a transaction (this behavior is disputable).

Still, some filters have wrong preview, because they expect the whole
image to process
parent 3b00a086
......@@ -23,6 +23,7 @@
#include "kis_bookmarked_configuration_manager.h"
#include "filter/kis_filter_configuration.h"
#include "kis_processing_information.h"
#include "kis_transaction.h"
#include "kis_paint_device.h"
#include "kis_selection.h"
#include "kis_types.h"
......@@ -103,6 +104,8 @@ void KisFilter::process(const KisPaintDeviceSP src,
QRect nR = neededRect(applyRect, config);
// Create a temporary device that will be filtered, sharing the source data
KisPaintDeviceSP temporary;
KisTransaction *transaction = 0;
if(src == dst && sel == 0)
{
temporary = src;
......@@ -110,12 +113,15 @@ void KisFilter::process(const KisPaintDeviceSP src,
else {
temporary = new KisPaintDevice(src->colorSpace());
temporary->makeCloneFromRough(src, nR);
transaction = new KisTransaction("", temporary);
}
// Filter
process(temporary, applyRect, config, progressUpdater);
// Copy on destination, respecting the selection
if(temporary != src)
{
delete transaction;
KisPainter p(dst);
p.setSelection(sel);
p.bitBlt(applyRect.topLeft(), temporary, applyRect);
......
......@@ -38,7 +38,6 @@
#include "filter/kis_filter_configuration.h"
#include "filter/kis_filter_registry.h"
#include "kis_selection.h"
#include "kis_transaction.h"
#include "kis_clone_layer.h"
#include "kis_processing_information.h"
#include "kis_node_progress_proxy.h"
......
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