Commit 2a089719 authored by Thorsten Zachmann's avatar Thorsten Zachmann

Speedup brightness contrast filter.

Use the KisColorTransformationConfiguration to only create the transformation once.
parent 8791bfaa
......@@ -37,7 +37,7 @@
#include "kis_selection.h"
#include <kis_iterator_ng.h>
#include "krita_utils.h"
void KisBContrastBenchmark::initTestCase()
{
......@@ -84,8 +84,13 @@ void KisBContrastBenchmark::benchmarkFilter()
kfc->fromXML(s);
}
QSize size = KritaUtils::optimalPatchSize();
QVector<QRect> rects = KritaUtils::splitRectIntoPatches(QRect(0, 0, GMP_IMAGE_WIDTH,GMP_IMAGE_HEIGHT), size);
QBENCHMARK{
filter->process(m_device, QRect(0, 0, GMP_IMAGE_WIDTH,GMP_IMAGE_HEIGHT), kfc);
foreach(const QRect &rc, rects) {
filter->process(m_device, rc, kfc);
}
}
}
......
......@@ -55,7 +55,7 @@
#include <kis_canvas_resource_provider.h>
KisBrightnessContrastFilterConfiguration::KisBrightnessContrastFilterConfiguration()
: KisFilterConfiguration("brightnesscontrast", 1)
: KisColorTransformationConfiguration("brightnesscontrast", 1)
{
}
......
......@@ -26,7 +26,7 @@
#include "filter/kis_color_transformation_filter.h"
#include "kis_config_widget.h"
#include "ui_wdg_brightness_contrast.h"
#include <filter/kis_filter_configuration.h>
#include <filter/kis_color_transformation_configuration.h>
#include <kis_selection.h>
#include <kis_paint_device.h>
#include <kis_processing_information.h>
......@@ -45,7 +45,7 @@ public:
}
};
class KisBrightnessContrastFilterConfiguration : public KisFilterConfiguration
class KisBrightnessContrastFilterConfiguration : public KisColorTransformationConfiguration
{
public:
......
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