Revision b9d749e...

Go back to digest for 21st July 2013

Optimization in Office

Dmitry Kazakov committed changes in [calligra] /plugins/paintops/libbrush:

A significant refactoring in the Predefined Brush engine

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


,319944,300665

File Changes

Added 2 files
  • /plugins/paintops/libbrush
  •   krita/kis_qimage_pyramid.cpp
  •   krita/kis_qimage_pyramid.h
Deleted 4 files
  • /plugins/paintops/libbrush
  •   krita/kis_qimage_mask.cpp
  •   krita/kis_qimage_mask.h
  •   krita/kis_scaled_brush.cpp
  •   krita/kis_scaled_brush.h
Modified 10 files
  • /plugins/paintops/libbrush
  •   krita/CMakeLists.txt
  •   krita/kis_abr_brush.cpp
  •   krita/kis_auto_brush.cpp
  •   krita/kis_brush.cpp
  •   krita/kis_brush.h
  •   krita/kis_gbr_brush.cpp
  •   krita/tests/kis_auto_brush_test.cpp
  •   krita/tests/kis_brush_test.cpp
  •   krita/tests/kis_brush_test.h
  •   krita/tests/kis_imagepipe_brush_test.cpp
16 files changed in total