plugins/paintops/libpaintop
#include <kis_dab_cache_base.h>

Public Member Functions | |
KisDabCacheBase () | |
~KisDabCacheBase () | |
void | disableSubpixelPrecision () |
bool | needSeparateOriginal (KisTextureProperties *textureOption, KisPressureSharpnessOption *sharpnessOption) const |
void | setMirrorPostprocessing (KisPressureMirrorOption *option) |
void | setPrecisionOption (KisPrecisionOption *option) |
Protected Member Functions | |
void | fetchDabGenerationInfo (bool hasDabInCache, KisDabCacheUtils::DabRenderingResources *resources, const KisDabCacheUtils::DabRequestInfo &request, KisDabCacheUtils::DabGenerationInfo *di, bool *shouldUseCache) |
Detailed Description
The KisDabCacheBase class provides caching for dabs into the brush paintop.
This class adds caching of the dabs to the paintop system of Krita. Such cache makes the execution of the benchmarks up to 2 times faster. Subjectively, the real painting becomes much faster, especially with huge brushes. Artists report up to 20% speed gain while painting.
Of course, such caching makes the painting a bit less precise: we need to tolerate subpixel differences to allow the cache to work. Sometimes small difference in the size of a dab can also be acceptable. That is why I introduced levels of precision. They are graded from 1 to 5: from the fastest and less precise to the slowest, but with the best quality. You can see the slider in the paintop settings dialog. The ToolTip text explains which features of the brush are sacrificed on each precision level.
The texturing and mirroring problems are solved.
Definition at line 42 of file kis_dab_cache_base.h.
Constructor & Destructor Documentation
◆ KisDabCacheBase()
KisDabCacheBase::KisDabCacheBase | ( | ) |
Definition at line 90 of file kis_dab_cache_base.cpp.
◆ ~KisDabCacheBase()
KisDabCacheBase::~KisDabCacheBase | ( | ) |
Definition at line 95 of file kis_dab_cache_base.cpp.
Member Function Documentation
◆ disableSubpixelPrecision()
void KisDabCacheBase::disableSubpixelPrecision | ( | ) |
Disables handling of the subPixelX and subPixelY values, this is needed at least for the Color Smudge paint op, which reads aligned areas from image, so additional offsets generated by the subpixel precision should be avoided.
Definition at line 110 of file kis_dab_cache_base.cpp.
◆ fetchDabGenerationInfo()
|
protected |
Fetches all the necessary information for dab generation and tells if the caller must should reuse the preciously returned dab.
- Please note that KisDabCacheBase has an internal state, that keeps the parameters of the previously generated (on a cache-miss) dab. This function automatically updates this state when 'shouldUseCache == false'. Therefore, the caller must generate the dab if and only if when 'shouldUseCache == false'. Otherwise the internal state will become inconsistent.
- Parameters
-
hasDabInCache shows if the caller has something in its cache resources rendering resources available for this dab request the request information di (OUT) calculated dab generation information shouldUseCache (OUT) shows whether the caller must use cache or not
Definition at line 231 of file kis_dab_cache_base.cpp.
◆ needSeparateOriginal()
bool KisDabCacheBase::needSeparateOriginal | ( | KisTextureProperties * | textureOption, |
KisPressureSharpnessOption * | sharpnessOption | ||
) | const |
Return true if the dab needs postprocessing by special options like 'texture' or 'sharpness'.
Definition at line 142 of file kis_dab_cache_base.cpp.
◆ setMirrorPostprocessing()
void KisDabCacheBase::setMirrorPostprocessing | ( | KisPressureMirrorOption * | option | ) |
Definition at line 100 of file kis_dab_cache_base.cpp.
◆ setPrecisionOption()
void KisDabCacheBase::setPrecisionOption | ( | KisPrecisionOption * | option | ) |
Definition at line 105 of file kis_dab_cache_base.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2021 The KDE developers.
Generated on Tue Apr 20 2021 23:38:14 by doxygen 1.8.16 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.