Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QGradientCache Class Reference
+ Collaboration diagram for QGradientCache:

Classes

struct  CacheInfo
 

Public Types

using QGradientColorTableHash = QMultiHash<quint64, std::shared_ptr<const CacheInfo>>
 

Public Member Functions

std::shared_ptr< const CacheInfogetBuffer (const QGradient &gradient, int opacity)
 
int paletteSize () const
 

Protected Member Functions

int maxCacheSize () const
 
void generateGradientColorTable (const QGradient &g, QRgba64 *colorTable, int size, int opacity) const
 
std::shared_ptr< const CacheInfoaddCacheElement (quint64 hash_val, const QGradient &gradient, int opacity)
 

Protected Attributes

QGradientColorTableHash cache
 
QMutex mutex
 

Detailed Description

Definition at line 4202 of file qpaintengine_raster.cpp.

Member Typedef Documentation

◆ QGradientColorTableHash

Definition at line 4216 of file qpaintengine_raster.cpp.

Member Function Documentation

◆ addCacheElement()

std::shared_ptr< const CacheInfo > QGradientCache::addCacheElement ( quint64 hash_val,
const QGradient & gradient,
int opacity )
inlineprotected

Definition at line 4248 of file qpaintengine_raster.cpp.

References QMultiHash< Key, T >::begin(), cache, QMultiHash< Key, T >::erase(), generateGradientColorTable(), QRandomGenerator::global(), GRADIENT_STOPTABLE_SIZE, i, QMultiHash< Key, T >::insert(), QGradient::interpolationMode(), maxCacheSize(), paletteSize(), QMultiHash< Key, T >::size(), and QGradient::stops().

Referenced by getBuffer().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ generateGradientColorTable()

void QGradientCache::generateGradientColorTable ( const QGradient & g,
QRgba64 * colorTable,
int size,
int opacity ) const
inlineprotected

Definition at line 4264 of file qpaintengine_raster.cpp.

References QGradient::ColorInterpolation, combineAlpha256(), dist(), QList< T >::first(), GRADIENT_STOPTABLE_SIZE, i, interpolate256(), QGradient::interpolationMode(), pos, Q_ASSERT, qMin(), qPremultiply(), qRgba64(), qRound(), qSwap(), QList< T >::size(), and QGradient::stops().

Referenced by addCacheElement().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getBuffer()

std::shared_ptr< const CacheInfo > QGradientCache::getBuffer ( const QGradient & gradient,
int opacity )
inline

Definition at line 4218 of file qpaintengine_raster.cpp.

References addCacheElement(), cache, QMultiHash< quint64, std::shared_ptr< const CacheInfo > >::const_iterator, QMultiHash< Key, T >::constEnd(), QMultiHash< Key, T >::constFind(), i, QGradient::interpolationMode(), it, lock, mutex, QList< T >::size(), and QGradient::stops().

+ Here is the call graph for this function:

◆ maxCacheSize()

int QGradientCache::maxCacheSize ( ) const
inlineprotected

Definition at line 4244 of file qpaintengine_raster.cpp.

Referenced by addCacheElement().

+ Here is the caller graph for this function:

◆ paletteSize()

int QGradientCache::paletteSize ( ) const
inline

Definition at line 4242 of file qpaintengine_raster.cpp.

References GRADIENT_STOPTABLE_SIZE.

Referenced by addCacheElement().

+ Here is the caller graph for this function:

Member Data Documentation

◆ cache

QGradientColorTableHash QGradientCache::cache
protected

Definition at line 4260 of file qpaintengine_raster.cpp.

Referenced by addCacheElement(), and getBuffer().

◆ mutex

QMutex QGradientCache::mutex
protected

Definition at line 4261 of file qpaintengine_raster.cpp.

Referenced by getBuffer().


The documentation for this class was generated from the following file: