4#ifndef QSGGRADIENTCACHE_P_H
5#define QSGGRADIENTCACHE_P_H
18#include <QtCore/qhash.h>
19#include <QtGui/qbrush.h>
21#include <QtQuick/qtquickexports.h>
31 QSGGradientCacheKey(
const QGradientStops &stops, QGradient::Spread spread)
32 : stops(stops), spread(spread)
35 QGradient::Spread spread;
36 bool operator==(
const QSGGradientCacheKey &other)
const
38 return spread == other.spread && stops == other.stops;
42inline size_t qHash(
const QSGGradientCacheKey &v, size_t seed = 0)
44 size_t h = seed + v.spread;
45 for (
int i = 0; i < 3 && i < v.stops.size(); ++i)
46 h += v.stops[i].second.rgba();
55 QGradient::Spread spread = QGradient::PadSpread;
63 static QSGGradientCache *cacheForRhi(QRhi *rhi);
64 QSGTexture *get(
const QSGGradientCacheKey &grad);
67 QHash<QSGGradientCacheKey, QSGPlainTexture *> m_textures;
void updateSampledImage(RenderState &state, int binding, QSGTexture **texture, QSGMaterial *newMaterial, QSGMaterial *oldMaterial) override
This function is called by the scene graph to prepare use of sampled images in the shader,...
QSGCurveFillMaterialShader(QGradient::Type gradientType, bool useTextureFill, bool useDerivatives, int viewCount)
bool updateUniformData(RenderState &state, QSGMaterial *newEffect, QSGMaterial *oldEffect) override
This function is called by the scene graph to get the contents of the shader program's uniform buffer...
constexpr size_t qHash(const QSize &s, size_t seed=0) noexcept