diff options
Diffstat (limited to 'src/gui/opengl/qopengltexturecache_p.h')
-rw-r--r-- | src/gui/opengl/qopengltexturecache_p.h | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/src/gui/opengl/qopengltexturecache_p.h b/src/gui/opengl/qopengltexturecache_p.h index b9d7df91e3..88ef06e744 100644 --- a/src/gui/opengl/qopengltexturecache_p.h +++ b/src/gui/opengl/qopengltexturecache_p.h @@ -56,6 +56,7 @@ #include <QObject> #include <QCache> #include <private/qopenglcontext_p.h> +#include <private/qopengltextureuploader_p.h> #include <QtCore/qmutex.h> QT_BEGIN_NAMESPACE @@ -70,15 +71,10 @@ public: QOpenGLTextureCache(QOpenGLContext *); ~QOpenGLTextureCache(); - enum BindOption { - NoBindOption = 0x0000, - PremultipliedAlphaBindOption = 0x0001, - UseRedFor8BitBindOption = 0x0002, - }; - Q_DECLARE_FLAGS(BindOptions, BindOption) - - GLuint bindTexture(QOpenGLContext *context, const QPixmap &pixmap, QOpenGLTextureCache::BindOptions options = PremultipliedAlphaBindOption); - GLuint bindTexture(QOpenGLContext *context, const QImage &image, QOpenGLTextureCache::BindOptions options = PremultipliedAlphaBindOption); + GLuint bindTexture(QOpenGLContext *context, const QPixmap &pixmap, + QOpenGLTextureUploader::BindOptions options = QOpenGLTextureUploader::PremultipliedAlphaBindOption); + GLuint bindTexture(QOpenGLContext *context, const QImage &image, + QOpenGLTextureUploader::BindOptions options = QOpenGLTextureUploader::PremultipliedAlphaBindOption); void invalidate(qint64 key); @@ -86,26 +82,24 @@ public: void freeResource(QOpenGLContext *ctx) override; private: - GLuint bindTexture(QOpenGLContext *context, qint64 key, const QImage &image, QOpenGLTextureCache::BindOptions options); + GLuint bindTexture(QOpenGLContext *context, qint64 key, const QImage &image, QOpenGLTextureUploader::BindOptions options); QMutex m_mutex; QCache<quint64, QOpenGLCachedTexture> m_cache; }; -Q_DECLARE_OPERATORS_FOR_FLAGS(QOpenGLTextureCache::BindOptions) - class QOpenGLCachedTexture { public: - QOpenGLCachedTexture(GLuint id, QOpenGLTextureCache::BindOptions options, QOpenGLContext *context); + QOpenGLCachedTexture(GLuint id, QOpenGLTextureUploader::BindOptions options, QOpenGLContext *context); ~QOpenGLCachedTexture() { m_resource->free(); } GLuint id() const { return m_resource->id(); } - QOpenGLTextureCache::BindOptions options() const { return m_options; } + QOpenGLTextureUploader::BindOptions options() const { return m_options; } private: QOpenGLSharedResourceGuard *m_resource; - QOpenGLTextureCache::BindOptions m_options; + QOpenGLTextureUploader::BindOptions m_options; }; QT_END_NAMESPACE |