Qt 4.8
Classes | Macros | Functions
qgl_p.h File Reference
#include "QtOpenGL/qgl.h"
#include "QtOpenGL/qglcolormap.h"
#include "QtCore/qmap.h"
#include "QtCore/qthread.h"
#include "QtCore/qthreadstorage.h"
#include "QtCore/qhash.h"
#include "QtCore/qatomic.h"
#include "private/qwidget_p.h"
#include "qcache.h"
#include "qglpaintdevice_p.h"
#include <QtGui/private/qegl_p.h>
#include <AGL/agl.h>
#include <QtOpenGL/private/qglextensions_p.h>

Go to the source code of this file.

Classes

class  QGLContextGroup
 
class  QGLContextGroupResource< T >
 
class  QGLContextGroupResourceBase
 
class  QGLContextPrivate
 
class  QGLContextResource< T >
 
class  QGLContextResourceBase
 
class  QGLEngineThreadStorage< T >
 
class  QGLExtensionMatcher
 
class  QGLExtensions
 
class  QGLFormatPrivate
 
class  QGLShareContextScope
 
class  QGLSharedResourceGuard
 
class  QGLSignalProxy
 
class  QGLTemporaryContext
 
class  QGLTexture
 
class  QGLTextureCache
 
struct  QGLTextureCacheKey
 
class  QGLTextureDestroyer
 
class  QGLWidgetPrivate
 

Macros

#define QT_GL_VERTEX_ARRAY_TRACKED_COUNT   3
 

Functions

bool operator== (const QGLTextureCacheKey &a, const QGLTextureCacheKey &b)
 
uint qHash (const QGLTextureCacheKey &key)
 
bool qt_gl_preferGL2Engine ()
 
GLenum qt_gl_preferredTextureFormat ()
 
GLenum qt_gl_preferredTextureTarget ()
 
Q_OPENGL_EXPORT const QGLContextqt_gl_transfer_context (const QGLContext *)
 
Q_OPENGL_EXPORT QPaintEngineqt_qgl_paint_engine ()
 

Macro Definition Documentation

◆ QT_GL_VERTEX_ARRAY_TRACKED_COUNT

#define QT_GL_VERTEX_ARRAY_TRACKED_COUNT   3

Definition at line 343 of file qgl_p.h.

Referenced by QGL2PaintEngineEx::beginNativePainting().

Function Documentation

◆ operator==()

bool operator== ( const QGLTextureCacheKey a,
const QGLTextureCacheKey b 
)
inline

Definition at line 645 of file qgl_p.h.

646 {
647  return a.key == b.key && a.group == b.group;
648 }
QGLContextGroup * group
Definition: qgl_p.h:642

◆ qHash()

uint qHash ( const QGLTextureCacheKey key)
inline

Definition at line 650 of file qgl_p.h.

651 {
652  return qHash(key.key) ^ qHash(key.group);
653 }
QGLContextGroup * group
Definition: qgl_p.h:642
uint qHash(const QUrl &url)
Definition: qurl.h:285

◆ qt_gl_preferGL2Engine()

bool qt_gl_preferGL2Engine ( )

◆ qt_gl_preferredTextureFormat()

GLenum qt_gl_preferredTextureFormat ( )
inline

Definition at line 709 of file qgl_p.h.

Referenced by QGLPixmapData::bind(), and QGLPixmapData::ensureCreated().

710 {
711  return (QGLExtensions::glExtensions() & QGLExtensions::BGRATextureFormat) && QSysInfo::ByteOrder == QSysInfo::LittleEndian
712  ? GL_BGRA : GL_RGBA;
713 }
#define GL_BGRA
Definition: glfunctions.h:63
static Extensions glExtensions()
Definition: qgl.cpp:5781
#define GL_RGBA

◆ qt_gl_preferredTextureTarget()

GLenum qt_gl_preferredTextureTarget ( )
inline

Definition at line 715 of file qgl_p.h.

Referenced by QOpenGLPaintEngine::drawImage(), and QOpenGLPaintEngine::drawPixmap().

716 {
717 #if defined(QT_OPENGL_ES_2)
718  return GL_TEXTURE_2D;
719 #else
723  : GL_TEXTURE_2D;
724 #endif
725 }
bool qt_gl_preferGL2Engine()
Definition: qgl.cpp:218
#define GL_TEXTURE_2D
#define GL_TEXTURE_RECTANGLE_NV
static Extensions glExtensions()
Definition: qgl.cpp:5781

◆ qt_gl_transfer_context()

Q_OPENGL_EXPORT const QGLContext* qt_gl_transfer_context ( const QGLContext )

Definition at line 1716 of file qgl.cpp.

1717 {
1718  if (!ctx)
1719  return 0;
1721  (QGLContextPrivate::contextGroup(ctx)->shares());
1722  if (shares.size() >= 2)
1723  return (ctx == shares.at(0)) ? shares.at(1) : shares.at(0);
1724  else
1725  return 0;
1726 }
static QGLContextGroup * contextGroup(const QGLContext *ctx)
Definition: qgl_p.h:464
#define ctx
Definition: qgl.cpp:6094
The QList class is a template class that provides lists.
Definition: qdatastream.h:62

◆ qt_qgl_paint_engine()

Q_OPENGL_EXPORT QPaintEngine* qt_qgl_paint_engine ( )

Definition at line 5530 of file qgl.cpp.

Referenced by QGLTextureCache::getTexture(), QBBGLPaintDevice::paintEngine(), QEglFSPaintDevice::paintEngine(), QGLWindowSurfaceGLPaintDevice::paintEngine(), and EAGLPaintDevice::paintEngine().

5531 {
5532 #if defined(QT_OPENGL_ES_1)
5533  return qt_gl_engine()->engine();
5534 #elif defined(QT_OPENGL_ES_2)
5535  return qt_gl_2_engine()->engine();
5536 #else
5537  if (qt_gl_preferGL2Engine())
5538  return qt_gl_2_engine()->engine();
5539  else
5540  return qt_gl_engine()->engine();
5541 #endif
5542 }
bool qt_gl_preferGL2Engine()
Definition: qgl.cpp:218