A significant refactoring in the Predefined Brush engine

Desktop / KDE / Calligra - Dmitry Kazakov [gmail.com] - 16 July 2013 05:45 UTC

This patch ports the predefined brush engine to the new capabilities of Qt. It removes a huge chunk of hand-written code. Here is a short list of changes:

1) All the operations are now performed on non-premultiplied RGB values. The use of premultiplication resulted in instability of the color, which caused artifacts on scaling and rotation of the brushes.

2) Trilinear filtering of the brushes is now substituted with simple bilinear filtering from the nearest pyramid level.

It turned out that trilinear filtering not only impacted the performance, but also introduced heavy aliasing artifacts on specific zoom levels.

3) After the patch the speed of the dab generation raised 3-5 times. Here are the values for 512px brush: Before patch: Scaling: 34 ms Rotation: 19 ms After patch: Scaling: 6 ms Rotation: 9 ms

CCBUG:320651 BUG:320368,319944,300665 CCMAIL:kimageshop@kde.org

b9d749e A significant refactoring in the Predefined Brush engine
krita/plugins/paintops/libbrush/CMakeLists.txt | 3 +-
krita/plugins/paintops/libbrush/kis_abr_brush.cpp | 1 -
krita/plugins/paintops/libbrush/kis_auto_brush.cpp | 2 +-
krita/plugins/paintops/libbrush/kis_brush.cpp | 848 ++------------------
krita/plugins/paintops/libbrush/kis_brush.h | 29 +-
krita/plugins/paintops/libbrush/kis_gbr_brush.cpp | 5 +-
.../plugins/paintops/libbrush/kis_qimage_mask.cpp | 135 ----
krita/plugins/paintops/libbrush/kis_qimage_mask.h | 138 ----
.../paintops/libbrush/kis_qimage_pyramid.cpp | 196 +++++
.../plugins/paintops/libbrush/kis_qimage_pyramid.h | 52 ++
.../plugins/paintops/libbrush/kis_scaled_brush.cpp | 64 --
krita/plugins/paintops/libbrush/kis_scaled_brush.h | 62 --
...rush_0_sc_0.871853_rot_3.55731_sub_0.137199.png | Bin 0 -> 248531 bytes
...brush_1_sc_0.861342_rot_3.45867_sub_0.20933.png | Bin 0 -> 244698 bytes
...brush_2_sc_1.80941_rot_4.97706_sub_0.113862.png | Bin 0 -> 722017 bytes
...brush_3_sc_0.46124_rot_4.18791_sub_0.167627.png | Bin 0 -> 105678 bytes
...rush_4_sc_0.963137_rot_2.82314_sub_0.444059.png | Bin 0 -> 299691 bytes
...rush_5_sc_0.592981_rot_0.439579_sub_0.45074.png | Bin 0 -> 137808 bytes
...brush_6_sc_1.86775_rot_3.12606_sub_0.365777.png | Bin 0 -> 648146 bytes
...brush_7_sc_1.13937_rot_3.47854_sub_0.458733.png | Bin 0 -> 361161 bytes
...brush_8_sc_1.53198_rot_3.68719_sub_0.410264.png | Bin 0 -> 559771 bytes
...brush_9_sc_1.46566_rot_2.88023_sub_0.474873.png | Bin 0 -> 549349 bytes
.../libbrush/tests/data/result_autobrush_3.png | Bin 139 -> 141 bytes
.../libbrush/tests/data/result_autobrush_4.png | Bin 147 -> 149 bytes
.../libbrush/tests/data/testing_brush_512_bars.gbr | Bin 0 -> 1048627 bytes
.../libbrush/tests/kis_auto_brush_test.cpp | 52 +-
.../paintops/libbrush/tests/kis_brush_test.cpp | 108 ++-
.../paintops/libbrush/tests/kis_brush_test.h | 9 +-
.../libbrush/tests/kis_imagepipe_brush_test.cpp | 9 +-
29 files changed, 452 insertions(+), 1261 deletions(-)

Upstream: quickgit.kde.org


  • Share