Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
QOpenGLMultiGroupSharedResource Class Reference

The QOpenGLMultiGroupSharedResource keeps track of a shared resource that might be needed from multiple contexts, like a glyph cache or gradient cache. One instance of the object is created for each group when necessary. The shared resource instance should have a constructor that takes a QOpenGLContext *. To get an instance for a given context one calls T *QOpenGLMultiGroupSharedResourcevalue<T>(context), where T is a sub-class of QOpenGLSharedResource. \inmodule QtGui. More...

#include <qopenglcontext_p.h>

+ Collaboration diagram for QOpenGLMultiGroupSharedResource:

Public Member Functions

 QOpenGLMultiGroupSharedResource ()
 
 ~QOpenGLMultiGroupSharedResource ()
 
void insert (QOpenGLContext *context, QOpenGLSharedResource *value)
 
void cleanup (QOpenGLContextGroup *group, QOpenGLSharedResource *value)
 
QOpenGLSharedResourcevalue (QOpenGLContext *context)
 
QList< QOpenGLSharedResource * > resources () const
 
template<typename T >
T * value (QOpenGLContext *context)
 

Detailed Description

The QOpenGLMultiGroupSharedResource keeps track of a shared resource that might be needed from multiple contexts, like a glyph cache or gradient cache. One instance of the object is created for each group when necessary. The shared resource instance should have a constructor that takes a QOpenGLContext *. To get an instance for a given context one calls T *QOpenGLMultiGroupSharedResourcevalue<T>(context), where T is a sub-class of QOpenGLSharedResource. \inmodule QtGui.

Since
5.0

You should not call free() on QOpenGLSharedResources owned by a QOpenGLMultiGroupSharedResource instance.

Definition at line 124 of file qopenglcontext_p.h.

Constructor & Destructor Documentation

◆ QOpenGLMultiGroupSharedResource()

QOpenGLMultiGroupSharedResource::QOpenGLMultiGroupSharedResource ( )

Definition at line 1193 of file qopenglcontext.cpp.

References qDebug.

◆ ~QOpenGLMultiGroupSharedResource()

QOpenGLMultiGroupSharedResource::~QOpenGLMultiGroupSharedResource ( )

Definition at line 1201 of file qopenglcontext.cpp.

References QList< T >::at(), QList< T >::constFirst(), context, QBasicAtomicInteger< T >::deref(), QOpenGLSharedResource::free(), i, QList< T >::isEmpty(), QBasicAtomicInteger< T >::loadRelaxed(), qDebug, qWarning, QOpenGLContextGroup::shares(), and QList< T >::size().

+ Here is the call graph for this function:

Member Function Documentation

◆ cleanup()

void QOpenGLMultiGroupSharedResource::cleanup ( QOpenGLContextGroup group,
QOpenGLSharedResource value 
)

Definition at line 1254 of file qopenglcontext.cpp.

References QListSpecialMethodsBase< T >::contains(), QThread::currentThread(), QBasicAtomicInteger< T >::deref(), Q_ASSERT, qDebug, and QList< T >::removeOne().

+ Here is the call graph for this function:

◆ insert()

void QOpenGLMultiGroupSharedResource::insert ( QOpenGLContext context,
QOpenGLSharedResource value 
)

Definition at line 1225 of file qopenglcontext.cpp.

References QList< T >::append(), context, Q_ASSERT, qDebug, and QBasicAtomicInteger< T >::ref().

+ Here is the call graph for this function:

◆ resources()

QList< QOpenGLSharedResource * > QOpenGLMultiGroupSharedResource::resources ( ) const

Definition at line 1243 of file qopenglcontext.cpp.

References QList< T >::constBegin(), QList< T >::constEnd(), and it.

+ Here is the call graph for this function:

◆ value() [1/2]

QOpenGLSharedResource * QOpenGLMultiGroupSharedResource::value ( QOpenGLContext context)

Definition at line 1237 of file qopenglcontext.cpp.

References context.

Referenced by QOpenGL2GradientCacheWrapper::cacheForContext(), QOpenGLTextureCacheWrapper::cacheForContext(), and QOpenGLProgramBinarySupportCheckWrapper::get().

+ Here is the caller graph for this function:

◆ value() [2/2]

template<typename T >
T * QOpenGLMultiGroupSharedResource::value ( QOpenGLContext context)
inline

Definition at line 138 of file qopenglcontext_p.h.

References context, and insert().

+ Here is the call graph for this function:

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