Commit e1f1c2e1 authored by Boudewijn Rempt's avatar Boudewijn Rempt

make blur benchmark work

svn path=/trunk/koffice/; revision=1080874
parent 6bc4f9c5
<!DOCTYPE params>
<params>
<param name="halfHeight"><![CDATA[5]]></param>
<param name="halfWidth"><![CDATA[5]]></param>
<param name="rotate"><![CDATA[0]]></param>
<param name="shape"><![CDATA[0]]></param>
<param name="strength"><![CDATA[0]]></param>
</params>
......@@ -38,17 +38,14 @@
#include "kis_selection.h"
// #define GMP_IMAGE_WIDTH 3274
// #define GMP_IMAGE_HEIGHT 2067
#define GMP_IMAGE_WIDTH 327
#define GMP_IMAGE_HEIGHT 206
#define GMP_IMAGE_WIDTH 3274
#define GMP_IMAGE_HEIGHT 2067
void KisBlurBenchmark::initTestCase()
{
m_colorSpace = KoColorSpaceRegistry::instance()->rgb8();
m_device = new KisPaintDevice(m_colorSpace);
m_color = new KoColor(m_colorSpace);
m_color = KoColor(m_colorSpace);
QColor qcolor(Qt::red);
srand(31524744);
......@@ -61,28 +58,22 @@ void KisBlurBenchmark::initTestCase()
g = rand() % 255;
b = rand() % 255;
m_color->fromQColor(QColor(r,g,b));
memcpy(it.rawData(), m_color->data(), m_colorSpace->pixelSize());
m_color.fromQColor(QColor(r,g,b));
memcpy(it.rawData(), m_color.data(), m_colorSpace->pixelSize());
++it;
}
qDebug() << m_device->exactBounds();
}
void KisBlurBenchmark::cleanupTestCase()
{
delete m_device;
delete m_color;
}
void KisBlurBenchmark::benchmarkProjection()
{
KisFilterSP filter = KisFilterRegistry::instance()->value("blur");
KisFilterConfiguration * kfc = filter->defaultConfiguration(m_device);
/* // Get the predefined configuration from a file
// Get the predefined configuration from a file
QFile file(QString(FILES_DATA_DIR) + QDir::separator() + filter->id() + ".cfg");
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
file.open(QIODevice::WriteOnly | QIODevice::Text);
......@@ -94,7 +85,6 @@ void KisBlurBenchmark::benchmarkProjection()
s = in.readAll();
kfc->fromXML(s);
}
*/
KisConstProcessingInformation src(m_device, QPoint(0, 0), 0);
KisProcessingInformation dst(m_device, QPoint(0, 0), 0);
......
......@@ -20,6 +20,8 @@
#define KIS_BLUR_BENCHMARK_H
#include <QtTest/QtTest>
#include <kis_types.h>
#include <KoColor.h>
class KisPaintDevice;
class KoColorSpace;
......@@ -30,8 +32,8 @@ class KisBlurBenchmark : public QObject
Q_OBJECT
private:
const KoColorSpace * m_colorSpace;
KisPaintDevice * m_device;
KoColor * m_color;
KisPaintDeviceSP m_device;
KoColor m_color;
private slots:
void initTestCase();
......
......@@ -15,20 +15,19 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include <qtest_kde.h>
#include "kis_projection_benchmark.h"
#include "kis_benchmark_values.h"
#include "kis_iterators_pixel.h"
#include "kis_paint_device.h"
#include <KoColorSpace.h>
#include <KoColorSpaceRegistry.h>
#include <KoColor.h>
#include "kis_doc2.h"
#include <kis_group_layer.h>
#include <kis_iterators_pixel.h>
#include <kis_paint_device.h>
#include <kis_doc2.h>
#include <kis_image.h>
void KisProjectionBenchmark::initTestCase()
......
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