|
Krita Source Code Documentation
|
The KisDabCache class provides caching for dabs into the brush paintop. More...
#include <kis_dab_cache.h>
Inheritance diagram for KisDabCache:Classes | |
| struct | Private |
Public Member Functions | |
| KisFixedPaintDeviceSP | fetchDab (const KoColorSpace *cs, const KoColor &color, const QPointF &cursorPoint, KisDabShape const &, const KisPaintInformation &info, qreal softnessFactor, QRect *dstDabRect, qreal lightnessStrength=1.0) |
| KisFixedPaintDeviceSP | fetchDab (const KoColorSpace *cs, KisColorSource *colorSource, const QPointF &cursorPoint, KisDabShape const &, const KisPaintInformation &info, qreal softnessFactor, QRect *dstDabRect, qreal lightnessStrength=1.0) |
| KisFixedPaintDeviceSP | fetchNormalizedImageDab (const KoColorSpace *cs, const QPointF &cursorPoint, KisDabShape const &shape, const KisPaintInformation &info, qreal softnessFactor, QRect *dstDabRect) |
| KisDabCache (KisBrushSP brush) | |
| bool | needSeparateOriginal () const |
| void | setSharpnessPostprocessing (KisSharpnessOption *option) |
| void | setTexturePostprocessing (KisTextureOption *option) |
| ~KisDabCache () | |
Public Member Functions inherited from KisDabCacheBase | |
| void | disableSubpixelPrecision () |
| KisDabCacheBase () | |
| bool | needSeparateOriginal (KisTextureOption *textureOption, KisSharpnessOption *sharpnessOption) const |
| void | setMirrorPostprocessing (KisMirrorOption *option) |
| void | setPrecisionOption (KisPrecisionOption *option) |
| ~KisDabCacheBase () | |
Private Member Functions | |
| KisFixedPaintDeviceSP | fetchDabCommon (const KoColorSpace *cs, KisColorSource *colorSource, const KoColor &color, const QPointF &cursorPoint, KisDabShape, const KisPaintInformation &info, qreal softnessFactor, QRect *dstDabRect, qreal lightnessStrength=1.0, bool forceNormalizedRGBAImageStamp=false) |
| KisFixedPaintDeviceSP | fetchFromCache (KisDabCacheUtils::DabRenderingResources *resources, const KisPaintInformation &info, QRect *dstDabRect) |
Private Attributes | |
| Private *const | m_d |
Additional Inherited Members | |
Protected Member Functions inherited from KisDabCacheBase | |
| void | fetchDabGenerationInfo (bool hasDabInCache, KisDabCacheUtils::DabRenderingResources *resources, const KisDabCacheUtils::DabRequestInfo &request, KisDabCacheUtils::DabGenerationInfo *di, bool *shouldUseCache) |
The KisDabCache 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 41 of file kis_dab_cache.h.
| KisDabCache::KisDabCache | ( | KisBrushSP | brush | ) |
Definition at line 39 of file kis_dab_cache.cpp.
| KisDabCache::~KisDabCache | ( | ) |
| KisFixedPaintDeviceSP KisDabCache::fetchDab | ( | const KoColorSpace * | cs, |
| const KoColor & | color, | ||
| const QPointF & | cursorPoint, | ||
| KisDabShape const & | shape, | ||
| const KisPaintInformation & | info, | ||
| qreal | softnessFactor, | ||
| QRect * | dstDabRect, | ||
| qreal | lightnessStrength = 1.0 ) |
Definition at line 85 of file kis_dab_cache.cpp.
References fetchDabCommon().
| KisFixedPaintDeviceSP KisDabCache::fetchDab | ( | const KoColorSpace * | cs, |
| KisColorSource * | colorSource, | ||
| const QPointF & | cursorPoint, | ||
| KisDabShape const & | shape, | ||
| const KisPaintInformation & | info, | ||
| qreal | softnessFactor, | ||
| QRect * | dstDabRect, | ||
| qreal | lightnessStrength = 1.0 ) |
Definition at line 65 of file kis_dab_cache.cpp.
References fetchDabCommon().
|
inlineprivate |
Definition at line 153 of file kis_dab_cache.cpp.
References KisDabCache::Private::brush, KisDabCacheUtils::DabRenderingResources::brush, KisDabCacheUtils::DabRenderingResources::colorSource, KisDabCache::Private::colorSourceDevice, KisDabCacheUtils::DabRenderingResources::colorSourceDevice, KisFixedPaintDevice::colorSpace(), KisDabCache::Private::dab, KisDabCache::Private::dabOriginal, KisDabCacheUtils::DabGenerationInfo::dstDabRect, KisDabCacheBase::fetchDabGenerationInfo(), fetchFromCache(), m_d, KisDabCacheUtils::DabGenerationInfo::needsPostprocessing, KisDabCache::Private::seqNo, KisDabCache::Private::sharpnessOption, KisDabCacheUtils::DabRenderingResources::sharpnessOption, KisDabCache::Private::textureOption, and KisDabCacheUtils::DabRenderingResources::textureOption.
|
inlineprivate |
Definition at line 121 of file kis_dab_cache.cpp.
References KisFixedPaintDevice::bounds(), KisDabCacheUtils::correctDabRectWhenFetchedFromCache(), KisDabCache::Private::dab, KisDabCache::Private::dabOriginal, m_d, needSeparateOriginal(), and KisDabCacheUtils::postProcessDab().
| KisFixedPaintDeviceSP KisDabCache::fetchNormalizedImageDab | ( | const KoColorSpace * | cs, |
| const QPointF & | cursorPoint, | ||
| KisDabShape const & | shape, | ||
| const KisPaintInformation & | info, | ||
| qreal | softnessFactor, | ||
| QRect * | dstDabRect ) |
Definition at line 103 of file kis_dab_cache.cpp.
References fetchDabCommon().
| bool KisDabCache::needSeparateOriginal | ( | ) | const |
Definition at line 59 of file kis_dab_cache.cpp.
References m_d, KisDabCacheBase::needSeparateOriginal(), KisDabCache::Private::sharpnessOption, and KisDabCache::Private::textureOption.
| void KisDabCache::setSharpnessPostprocessing | ( | KisSharpnessOption * | option | ) |
Definition at line 49 of file kis_dab_cache.cpp.
References m_d, and KisDabCache::Private::sharpnessOption.
| void KisDabCache::setTexturePostprocessing | ( | KisTextureOption * | option | ) |
Definition at line 54 of file kis_dab_cache.cpp.
References m_d, and KisDabCache::Private::textureOption.
|
private |
Definition at line 97 of file kis_dab_cache.h.