Commit 51a7b123 authored by Dmitry Kazakov's avatar Dmitry Kazakov
Browse files

Fix FreehandStrokeBenchmark

parent 02444b5b
......@@ -18,6 +18,10 @@
#include "kis_image.h"
#include <brushengine/kis_paint_information.h>
#include "testutil.h"
#include "KisResourceModel.h"
#include "KisGlobalResourcesInterface.h"
class FreehandStrokeBenchmarkTester : public utils::StrokeTester
{
......@@ -101,7 +105,7 @@ void benchmarkBrushUnthreaded(const QString &presetName)
FreehandStrokeBenchmarkTester tester(presetName);
Q_FOREACH(int i, QVector<int>({/*1,*/ QThread::idealThreadCount()})) {
Q_FOREACH(int i, QVector<int>({1, QThread::idealThreadCount()})) {
tester.setCpuCoresLimit(i);
tester.benchmark();
......@@ -123,32 +127,42 @@ void FreehandStrokeBenchmark::testDefaultTip()
void FreehandStrokeBenchmark::testSoftTip()
{
benchmarkBrush("testing_1000px_auto_soft.kpp");
benchmarkBrushUnthreaded("testing_1000px_auto_soft.kpp");
}
void FreehandStrokeBenchmark::testGaussianTip()
{
benchmarkBrush("testing_1000px_auto_gaussian.kpp");
benchmarkBrushUnthreaded("testing_1000px_auto_gaussian.kpp");
}
void FreehandStrokeBenchmark::testRectangularTip()
{
benchmarkBrush("testing_1000px_auto_rectangular.kpp");
benchmarkBrushUnthreaded("testing_1000px_auto_rectangular.kpp");
}
void FreehandStrokeBenchmark::testRectGaussianTip()
{
benchmarkBrush("testing_1000px_auto_gaussian_rect.kpp");
benchmarkBrushUnthreaded("testing_1000px_auto_gaussian_rect.kpp");
}
void FreehandStrokeBenchmark::testRectSoftTip()
{
benchmarkBrush("testing_1000px_auto_soft_rect.kpp");
benchmarkBrushUnthreaded("testing_1000px_auto_soft_rect.kpp");
}
void FreehandStrokeBenchmark::testStampTip()
{
benchmarkBrush("testing_1000px_stamp_450_rotated.kpp");
QString fullFileName = TestUtil::fetchDataFileLazy("3_texture.png");
KIS_ASSERT(!fullFileName.isEmpty());
KIS_ASSERT(QFileInfo(fullFileName).exists());
KisResourceModel model(ResourceType::Brushes);
KisBrushSP brush(new KisPngBrush(fullFileName));
brush->load(KisGlobalResourcesInterface::instance());
model.addResource(brush);
benchmarkBrushUnthreaded("testing_1000px_stamp_450_rotated.kpp");
}
void FreehandStrokeBenchmark::testColorsmudgeDefaultTip_dull_old_sa()
......
......@@ -15,7 +15,7 @@ class FreehandStrokeBenchmark : public QObject
private Q_SLOTS:
void initTestCase();
private:
private Q_SLOTS:
void testDefaultTip();
void testSoftTip();
void testGaussianTip();
......@@ -25,7 +25,7 @@ private:
void testRectSoftTip();
void testStampTip();
private Q_SLOTS:
void testColorsmudgeDefaultTip_dull_old_sa();
void testColorsmudgeDefaultTip_dull_old_nsa();
void testColorsmudgeDefaultTip_dull_new_sa();
......
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