File: kis_stroke_benchmark.h

package info (click to toggle)
krita 1%3A3.1.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 430,944 kB
  • ctags: 68,203
  • sloc: cpp: 798,916; xml: 7,448; ansic: 3,844; perl: 434; sh: 140; makefile: 20
file content (133 lines) | stat: -rw-r--r-- 3,248 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
/*
 *  Copyright (c) 2010 Lukáš Tvrdý lukast.dev@gmail.com
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 */

#ifndef KIS_STROKE_BENCHMARK_H
#define KIS_STROKE_BENCHMARK_H

#include <QtTest>
#include <kis_types.h>
#include <KoColor.h>
#include <kis_painter.h>
#include <brushengine/kis_paint_information.h>
#include <kis_image.h>
#include <kis_layer.h>


const QString PRESET_FILE_NAME = "hairy-benchmark1.kpp";

class KisStrokeBenchmark : public QObject
{
    Q_OBJECT
private:
    const KoColorSpace * m_colorSpace;
    KoColor m_color;
    KisImageSP m_image;
    KisLayerSP m_layer;

    KisPainter * m_painter;

    KisPaintInformation m_pi1;
    KisPaintInformation m_pi2;
    KisPaintInformation m_pi3;

    QPointF m_c1;
    QPointF m_c2;

    QVector<QPointF> m_startPoints;
    QVector<QPointF> m_endPoints;

    void initCurvePoints(int width, int height);
    void initLines(int width, int height);

    QString m_dataPath;
    QString m_outputPath;

    private:
        inline void benchmarkRandomLines(QString presetFileName);
        inline void benchmarkStroke(QString presetFileName);
        inline void benchmarkLine(QString presetFileName);
        inline void benchmarkCircle(QString presetFileName);

private Q_SLOTS:
    void initTestCase();
    void cleanupTestCase();

    void init();

    // AutoBrush
    void pixelbrush300px();
    void pixelbrush300pxRL();

    // Soft brush benchmarks
    void softbrushDefault30();
    void softbrushDefault30RL();
    void softbrushCircle30();
    void softbrushFullFeatures30();
    void softbrushFullFeatures30RL();

    void softbrushSoftness();
    void softbrushOpacity();

    // Hairy brush benchmarks
    void hairy30pxDefault();
    void hairy30pxDefaultRL();

    void hairy30pxAntiAlias();
    void hairy30pxAntiAliasRL();

    void hairy30px30density();
    void hairy30px30densityRL();

    void hairy30InkDepletion();
    void hairy30InkDepletionRL();

    // Spray brush benchmark1
    void spray30px21particles();
    void spray30px21particlesRL();

    void sprayPencil();
    void sprayPencilRL();

    void sprayPixels();
    void sprayPixelsRL();

    void sprayTexture();
    void sprayTextureRL();

    void dynabrush();
    void dynabrushRL();

    void deformBrush();
    void deformBrushRL();

    void experimental();
    void experimentalCircle();

    void colorsmudge();
    void colorsmudgeRL();
/*
    void predefinedBrush();
    void predefinedBrushRL();
*/
    void benchmarkRand();
    void benchmarkRand48();

    void becnhmarkPresetCloning();
};

#endif