ImageTexturesCache Class Reference

#include <KQuickAddons/ImageTexturesCache>

Public Member Functions

QSharedPointer< QSGTextureloadTexture (QQuickWindow *window, const QImage &image, QQuickWindow::CreateTextureOptions options)
QSharedPointer< QSGTextureloadTexture (QQuickWindow *window, const QImage &image)

Detailed Description

Helps to manage textures by creating images and reference counts them.

Use this class as a factory for textures, when creating them from a QImage instance. Keeps track of all the created textures in a map between the QImage::cacheKey() and the cached texture until it gets de-referenced.

See also

Definition at line 44 of file imagetexturescache.h.

Member Function Documentation

QSharedPointer< QSGTexture > ImageTexturesCache::loadTexture ( QQuickWindow window,
const QImage image,
QQuickWindow::CreateTextureOptions  options 
the texture for a given window and image.

If an image id is the same as one already provided before, we won't create a new texture and return a shared pointer to the existing texture.

Definition at line 40 of file imagetexturescache.cpp.

The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Fri Jul 3 2020 22:37:53 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.