Qt 4.8
Classes | Namespaces | Macros | Typedefs | Functions | Variables
qgl.cpp File Reference
#include "qapplication.h"
#include "qplatformdefs.h"
#include "qgl.h"
#include <qdebug.h>
#include "private/qt_x11_p.h"
#include "private/qpixmap_x11_p.h"
#include "qx11info_x11.h"
#include <qdatetime.h>
#include <stdlib.h>
#include "qpixmap.h"
#include "qimage.h"
#include "qgl_p.h"
#include "gl2paintengineex/qpaintengineex_opengl2_p.h"
#include <private/qwindowsurface_gl_p.h>
#include <private/qpaintengine_opengl_p.h>
#include <private/qglwindowsurface_qws_p.h>
#include <qglpixelbuffer.h>
#include <qglframebufferobject.h>
#include <private/qimage_p.h>
#include <private/qpixmapdata_p.h>
#include <private/qpixmapdata_gl_p.h>
#include <private/qglpixelbuffer_p.h>
#include <private/qimagepixmapcleanuphooks_p.h>
#include "qcolormap.h"
#include "qfile.h"
#include "qlibrary.h"
#include <qmutex.h>

Go to the source code of this file.

Classes

struct  DDSFormat
 
struct  PvrHeader
 
struct  QGLContextGroupList
 
class  QGLDefaultExtensions
 
class  QGLDefaultOverlayFormat
 
class  QGLEngineSelector
 
struct  QGLThreadContext
 

Namespaces

 QGL
 The QGL namespace specifies miscellaneous identifiers used in the Qt OpenGL module.
 

Macros

#define FOURCC_DXT1   0x31545844
 
#define FOURCC_DXT2   0x32545844
 
#define FOURCC_DXT3   0x33545844
 
#define FOURCC_DXT4   0x34545844
 
#define FOURCC_DXT5   0x35545844
 
#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT   0x83F0
 
#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT   0x83F1
 
#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT   0x83F2
 
#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT   0x83F3
 
#define INT32   dummy_INT32
 
#define INT8   dummy_INT8
 
#define M(row, col)   m[col*4+row]
 

Typedefs

typedef void(* _qt_image_cleanup_hook_64) (qint64)
 
typedef void(* _qt_pixmap_cleanup_hook_64) (qint64)
 

Functions

static void convertFromGLImage (QImage &img, int w, int h, bool alpha_format, bool include_alpha)
 
static void convertToGLFormatHelper (QImage &dst, const QImage &img, GLenum texture_format)
 
QDebug operator<< (QDebug dbg, const QGLFormat &f)
 
static void qDrawTextureRect (const QRectF &target, GLint textureWidth, GLint textureHeight, GLenum textureTarget)
 
static void qgl_byteSwapImage (QImage &img, GLenum pixel_type)
 
static GLint qgluProject (GLdouble objx, GLdouble objy, GLdouble objz, const GLdouble model[16], const GLdouble proj[16], const GLint viewport[4], GLdouble *winx, GLdouble *winy, GLdouble *winz)
 
QGLFormat::OpenGLVersionFlags Q_AUTOTEST_EXPORT qOpenGLVersionFlagsFromString (const QString &versionString)
 
void qt_add_rect_to_array (const QRectF &r, GLfloat *array)
 
void qt_add_texcoords_to_array (qreal x1, qreal y1, qreal x2, qreal y2, GLfloat *array)
 
QRgb qt_gl_convertToGLFormat (QRgb src_pixel, GLenum texture_format)
 
static QRgb qt_gl_convertToGLFormatHelper (QRgb src_pixel, GLenum texture_format)
 
bool qt_gl_preferGL2Engine ()
 
QImage qt_gl_read_framebuffer (const QSize &size, bool alpha_format, bool include_alpha)
 
QImage qt_gl_read_texture (const QSize &size, bool alpha_format, bool include_alpha)
 
const QGLContextqt_gl_transfer_context (const QGLContext *ctx)
 
int qt_next_power_of_two (int v)
 
const QX11Infoqt_x11Info (const QPaintDevice *pd)
 
static void transform_point (GLdouble out[4], const GLdouble m[16], const GLdouble in[4])
 

Variables

static QThreadStorage< QGLThreadContext * > qgl_context_storage
 
Q_GUI_EXPORT _qt_image_cleanup_hook_64 qt_image_cleanup_hook_64
 
Q_GUI_EXPORT _qt_pixmap_cleanup_hook_64 qt_pixmap_cleanup_hook_64
 
#define ctx   q_ptr
 
#define GL_NUM_EXTENSIONS   0x821D
 
#define PVR_MAGIC   0x21525650
 
#define PVR_FORMAT_MASK   0x000000FF
 
#define PVR_FORMAT_PVRTC2   0x00000018
 
#define PVR_FORMAT_PVRTC4   0x00000019
 
#define PVR_FORMAT_ETC1   0x00000036
 
#define PVR_HAS_MIPMAPS   0x00000100
 
#define PVR_TWIDDLED   0x00000200
 
#define PVR_NORMAL_MAP   0x00000400
 
#define PVR_BORDER_ADDED   0x00000800
 
#define PVR_CUBE_MAP   0x00001000
 
#define PVR_FALSE_COLOR_MIPMAPS   0x00002000
 
#define PVR_VOLUME_TEXTURE   0x00004000
 
#define PVR_ALPHA_IN_TEXTURE   0x00008000
 
#define PVR_VERTICAL_FLIP   0x00010000
 
#define GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG   0x8C00
 
#define GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG   0x8C01
 
#define GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG   0x8C02
 
#define GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG   0x8C03
 
#define GL_ETC1_RGB8_OES   0x8D64
 
#define ctx   QGLContext::currentContext()
 
typedef const GLubyte *(APIENTRYqt_glGetStringi) (GLenum, GLuint)
 
static void qt_save_gl_state ()
 
static void qt_restore_gl_state ()
 
static void qt_gl_draw_text (QPainter *p, int x, int y, const QString &str, const QFont &font)
 
Q_OPENGL_EXPORT QPaintEngineqt_qgl_paint_engine ()
 
Q_OPENGL_EXPORT void qt_set_gl_library_name (const QString &name)
 
Q_OPENGL_EXPORT const QString qt_gl_library_name ()
 

Macro Definition Documentation

◆ ctx [1/2]

#define ctx   q_ptr

Definition at line 6094 of file qgl.cpp.

Referenced by QScriptContext::backtrace(), QJSDebuggerAgent::backtrace(), QOpenGLPaintEngine::begin(), QGLPaintDevice::beginPaint(), QGLWindowSurface::beginPaint(), QGLFramebufferObject::bind(), QGLFramebufferObject::bindDefault(), QGLFramebufferObject::blitFramebuffer(), QGLGlyphCache::cacheGlyphs(), QScript::ClassObjectDelegate::call(), QGLFramebufferObjectPrivate::checkFramebufferStatus(), QGLContext::chooseContext(), QGLGlyphCache::cleanupContext(), QGLOffscreen::cleanupGLContextRefs(), QGLProgramCache::cleanupPrograms(), QGLPixelBufferPrivate::common_init(), QScript::ClassObjectDelegate::construct(), QEglContext::context(), QScriptDebuggerBackend::context(), QGLTextureGlyphCache::context(), QGLOffscreen::context(), QGLTextureGlyphCache::contextDeleted(), QGLPixmapData::copy(), QGLPixmapData::copyBackFromRenderFbo(), QMeeGoGraphicsSystem::createFenceSync(), QGLPixmapData::createPixmapForImage(), QMeeGoGraphicsSystem::createWindowSurface(), QMeeGoPixmapData::destroyEGLSharedImage(), QMeeGoGraphicsSystem::destroyFenceSync(), QScriptDebuggerBackend::doPendingEvaluate(), QGL2PaintEngineExPrivate::drawCachedGlyphs(), QTextDocument::drawContents(), QTextControl::drawContents(), QGL2PaintEngineEx::drawImage(), QGLTrapezoidMaskGenerator::drawMask(), QGLEllipseMaskGenerator::drawMask(), QGL2PaintEngineEx::drawPixmap(), QGL2PaintEngineExPrivate::drawPixmapFragments(), drawTexture(), QGL2PaintEngineEx::drawTexture(), QBidiControl::embed(), QOpenGLPaintEngine::end(), QGL2PaintEngineEx::end(), QGLPaintDevice::endPaint(), QGL2PaintEngineEx::ensureActive(), QGLPaintDevice::ensureActiveTarget(), QGLPixmapData::ensureCreated(), QScriptDebuggerCommandExecutor::execute(), QScript::QMetaObjectWrapperObject::execute(), QWaylandGLWindowSurface::flush(), QX11GLWindowSurface::flush(), QGLWindowSurface::flush(), QGLGlyphCache::fontEngineDestroyed(), QGLTextureGlyphCache::freeResource(), QGLPixmapData::fromData(), QMeeGoPixmapData::fromEGLSharedImage(), QGLPixmapData::fromFile(), QPixmap::fromMacCGImageRef(), QGLGradientCache::getBuffer(), QTextControl::getPaintContext(), QX11GLWindowSurface::grabWidget(), QGLTextureGlyphCache::height(), QGLWindowSurface::hijackWindow(), QFontEngineMac::imageForGlyph(), QMeeGoPixmapData::imageToEGLSharedImage(), QScriptEngine::importExtension(), QGLFramebufferObjectPrivate::init(), QMeeGoExtensions::initialize(), QGLOffscreen::initialize(), QMeeGoLivePixmapData::initializeThroughEGLImage(), QTextControlPrivate::inputContext(), QJSDebuggerAgent::localsAtFrame(), QMeeGoLivePixmapData::lock(), QGLWindowSurface::paintDevice(), QGLPixmapData::paintEngine(), QStaticTextPrivate::paintText(), QBidiControl::pdf(), QJSDebuggerAgentPrivate::positionChange(), printPage(), QGLPixmapBlurFilter::processGL(), QGLPixmapDropShadowFilter::processGL(), QScript::FunctionWrapper::proxyCall(), QScript::FunctionWithArgWrapper::proxyCall(), QScript::FunctionWrapper::proxyConstruct(), QScript::FunctionWithArgWrapper::proxyConstruct(), QGLShareContextScope::QGLShareContextScope(), QOCIDriver::QOCIDriver(), QScriptDebuggerAgent::QScriptDebuggerAgent(), qStringFromUcs2Le(), qt_mac_convert_iconref(), QMeeGoLivePixmapData::release(), QGLFramebufferObject::release(), QGLPixmapData::resize(), QX11GLWindowSurface::scroll(), QTextControlPrivate::sendMouseEventToInputContext(), QRasterPaintEngine::setCGContext(), QEglContext::setContext(), QOpenKODEIntegration::setMainGLContext(), QGLTextureGlyphCache::texture(), QGLPixmapData::toImage(), QFontEngineMac::type(), QCoreTextFontEngine::type(), QGL2PaintEngineExPrivate::updateClipScissorTest(), QGLWindowSurface::updateGeometry(), QGLTextureGlyphCache::width(), QGLFramebufferObject::~QGLFramebufferObject(), QGLGlyphTexture::~QGLGlyphTexture(), QGLPixmapData::~QGLPixmapData(), and QGLWindowSurface::~QGLWindowSurface().

◆ ctx [2/2]

#define ctx   QGLContext::currentContext()

Definition at line 6094 of file qgl.cpp.

◆ FOURCC_DXT1

#define FOURCC_DXT1   0x31545844

Definition at line 2018 of file qgl.cpp.

◆ FOURCC_DXT2

#define FOURCC_DXT2   0x32545844

Definition at line 2019 of file qgl.cpp.

◆ FOURCC_DXT3

#define FOURCC_DXT3   0x33545844

Definition at line 2020 of file qgl.cpp.

◆ FOURCC_DXT4

#define FOURCC_DXT4   0x34545844

Definition at line 2021 of file qgl.cpp.

◆ FOURCC_DXT5

#define FOURCC_DXT5   0x35545844

Definition at line 2022 of file qgl.cpp.

◆ GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG

#define GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG   0x8C01

Definition at line 6047 of file qgl.cpp.

◆ GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG

#define GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG   0x8C00

Definition at line 6046 of file qgl.cpp.

◆ GL_COMPRESSED_RGB_S3TC_DXT1_EXT

#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT   0x83F0

Definition at line 2025 of file qgl.cpp.

◆ GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG

#define GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG   0x8C03

Definition at line 6049 of file qgl.cpp.

◆ GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG

#define GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG   0x8C02

Definition at line 6048 of file qgl.cpp.

◆ GL_COMPRESSED_RGBA_S3TC_DXT1_EXT

#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT   0x83F1

Definition at line 2026 of file qgl.cpp.

◆ GL_COMPRESSED_RGBA_S3TC_DXT3_EXT

#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT   0x83F2

Definition at line 2027 of file qgl.cpp.

◆ GL_COMPRESSED_RGBA_S3TC_DXT5_EXT

#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT   0x83F3

Definition at line 2028 of file qgl.cpp.

◆ GL_ETC1_RGB8_OES

#define GL_ETC1_RGB8_OES   0x8D64

Definition at line 6053 of file qgl.cpp.

◆ GL_NUM_EXTENSIONS

#define GL_NUM_EXTENSIONS   0x821D

Definition at line 5616 of file qgl.cpp.

◆ INT32

#define INT32   dummy_INT32

Definition at line 50 of file qgl.cpp.

◆ INT8

#define INT8   dummy_INT8

Definition at line 51 of file qgl.cpp.

◆ M

#define M (   row,
  col 
)    m[col*4+row]

◆ PVR_ALPHA_IN_TEXTURE

#define PVR_ALPHA_IN_TEXTURE   0x00008000

Definition at line 6042 of file qgl.cpp.

◆ PVR_BORDER_ADDED

#define PVR_BORDER_ADDED   0x00000800

Definition at line 6038 of file qgl.cpp.

◆ PVR_CUBE_MAP

#define PVR_CUBE_MAP   0x00001000

Definition at line 6039 of file qgl.cpp.

◆ PVR_FALSE_COLOR_MIPMAPS

#define PVR_FALSE_COLOR_MIPMAPS   0x00002000

Definition at line 6040 of file qgl.cpp.

◆ PVR_FORMAT_ETC1

#define PVR_FORMAT_ETC1   0x00000036

Definition at line 6033 of file qgl.cpp.

◆ PVR_FORMAT_MASK

#define PVR_FORMAT_MASK   0x000000FF

Definition at line 6030 of file qgl.cpp.

◆ PVR_FORMAT_PVRTC2

#define PVR_FORMAT_PVRTC2   0x00000018

Definition at line 6031 of file qgl.cpp.

◆ PVR_FORMAT_PVRTC4

#define PVR_FORMAT_PVRTC4   0x00000019

Definition at line 6032 of file qgl.cpp.

◆ PVR_HAS_MIPMAPS

#define PVR_HAS_MIPMAPS   0x00000100

Definition at line 6035 of file qgl.cpp.

◆ PVR_MAGIC

#define PVR_MAGIC   0x21525650

Definition at line 6028 of file qgl.cpp.

◆ PVR_NORMAL_MAP

#define PVR_NORMAL_MAP   0x00000400

Definition at line 6037 of file qgl.cpp.

◆ PVR_TWIDDLED

#define PVR_TWIDDLED   0x00000200

Definition at line 6036 of file qgl.cpp.

◆ PVR_VERTICAL_FLIP

#define PVR_VERTICAL_FLIP   0x00010000

Definition at line 6043 of file qgl.cpp.

◆ PVR_VOLUME_TEXTURE

#define PVR_VOLUME_TEXTURE   0x00004000

Definition at line 6041 of file qgl.cpp.

Typedef Documentation

◆ _qt_image_cleanup_hook_64

typedef void(* _qt_image_cleanup_hook_64) (qint64)

Definition at line 1899 of file qgl.cpp.

◆ _qt_pixmap_cleanup_hook_64

typedef void(* _qt_pixmap_cleanup_hook_64) (qint64)

Definition at line 1898 of file qgl.cpp.

◆ qt_glGetStringi

typedef const GLubyte*(APIENTRY * qt_glGetStringi) (GLenum, GLuint)

Definition at line 5613 of file qgl.cpp.

Function Documentation

◆ convertFromGLImage()

static void convertFromGLImage ( QImage img,
int  w,
int  h,
bool  alpha_format,
bool  include_alpha 
)
static

Definition at line 1818 of file qgl.cpp.

1819 {
1820  if (QSysInfo::ByteOrder == QSysInfo::BigEndian) {
1821  // OpenGL gives RGBA; Qt wants ARGB
1822  uint *p = (uint*)img.bits();
1823  uint *end = p + w*h;
1824  if (alpha_format && include_alpha) {
1825  while (p < end) {
1826  uint a = *p << 24;
1827  *p = (*p >> 8) | a;
1828  p++;
1829  }
1830  } else {
1831  // This is an old legacy fix for PowerPC based Macs, which
1832  // we shouldn't remove
1833  while (p < end) {
1834  *p = 0xff000000 | (*p>>8);
1835  ++p;
1836  }
1837  }
1838  } else {
1839  // OpenGL gives ABGR (i.e. RGBA backwards); Qt wants ARGB
1840  for (int y = 0; y < h; y++) {
1841  uint *q = (uint*)img.scanLine(y);
1842  for (int x=0; x < w; ++x) {
1843  const uint pixel = *q;
1844  if (alpha_format && include_alpha) {
1845  *q = ((pixel << 16) & 0xff0000) | ((pixel >> 16) & 0xff)
1846  | (pixel & 0xff00ff00);
1847  } else {
1848  *q = 0xff000000 | ((pixel << 16) & 0xff0000)
1849  | ((pixel >> 16) & 0xff) | (pixel & 0x00ff00);
1850  }
1851 
1852  q++;
1853  }
1854  }
1855 
1856  }
1857  img = img.mirrored();
1858 }
long ASN1_INTEGER_get ASN1_INTEGER * a
unsigned int uint
Definition: qglobal.h:996
QImage mirrored(bool horizontally=false, bool vertically=true) const
Returns a mirror of the image, mirrored in the horizontal and/or the vertical direction depending on ...
Definition: qimage.cpp:4922
uchar * bits()
Returns a pointer to the first pixel data.
Definition: qimage.cpp:1946
static const KeyPair *const end
uchar * scanLine(int)
Returns a pointer to the pixel data at the scanline with index i.
Definition: qimage.cpp:1886

◆ convertToGLFormatHelper()

static void convertToGLFormatHelper ( QImage dst,
const QImage img,
GLenum  texture_format 
)
static

Definition at line 2286 of file qgl.cpp.

2287 {
2288  Q_ASSERT(dst.depth() == 32);
2289  Q_ASSERT(img.depth() == 32);
2290 
2291  if (dst.size() != img.size()) {
2292  int target_width = dst.width();
2293  int target_height = dst.height();
2294  qreal sx = target_width / qreal(img.width());
2295  qreal sy = target_height / qreal(img.height());
2296 
2297  quint32 *dest = (quint32 *) dst.scanLine(0); // NB! avoid detach here
2298  uchar *srcPixels = (uchar *) img.scanLine(img.height() - 1);
2299  int sbpl = img.bytesPerLine();
2300  int dbpl = dst.bytesPerLine();
2301 
2302  int ix = int(0x00010000 / sx);
2303  int iy = int(0x00010000 / sy);
2304 
2305  quint32 basex = int(0.5 * ix);
2306  quint32 srcy = int(0.5 * iy);
2307 
2308  // scale, swizzle and mirror in one loop
2309  while (target_height--) {
2310  const uint *src = (const quint32 *) (srcPixels - (srcy >> 16) * sbpl);
2311  int srcx = basex;
2312  for (int x=0; x<target_width; ++x) {
2313  dest[x] = qt_gl_convertToGLFormatHelper(src[srcx >> 16], texture_format);
2314  srcx += ix;
2315  }
2316  dest = (quint32 *)(((uchar *) dest) + dbpl);
2317  srcy += iy;
2318  }
2319  } else {
2320  const int width = img.width();
2321  const int height = img.height();
2322  const uint *p = (const uint*) img.scanLine(img.height() - 1);
2323  uint *q = (uint*) dst.scanLine(0);
2324 
2325  if (texture_format == GL_BGRA) {
2326  if (QSysInfo::ByteOrder == QSysInfo::BigEndian) {
2327  // mirror + swizzle
2328  for (int i=0; i < height; ++i) {
2329  const uint *end = p + width;
2330  while (p < end) {
2331  *q = ((*p << 24) & 0xff000000)
2332  | ((*p >> 24) & 0x000000ff)
2333  | ((*p << 8) & 0x00ff0000)
2334  | ((*p >> 8) & 0x0000ff00);
2335  p++;
2336  q++;
2337  }
2338  p -= 2 * width;
2339  }
2340  } else {
2341  const uint bytesPerLine = img.bytesPerLine();
2342  for (int i=0; i < height; ++i) {
2343  memcpy(q, p, bytesPerLine);
2344  q += width;
2345  p -= width;
2346  }
2347  }
2348  } else {
2349  if (QSysInfo::ByteOrder == QSysInfo::BigEndian) {
2350  for (int i=0; i < height; ++i) {
2351  const uint *end = p + width;
2352  while (p < end) {
2353  *q = (*p << 8) | ((*p >> 24) & 0xff);
2354  p++;
2355  q++;
2356  }
2357  p -= 2 * width;
2358  }
2359  } else {
2360  for (int i=0; i < height; ++i) {
2361  const uint *end = p + width;
2362  while (p < end) {
2363  *q = ((*p << 16) & 0xff0000) | ((*p >> 16) & 0xff) | (*p & 0xff00ff00);
2364  p++;
2365  q++;
2366  }
2367  p -= 2 * width;
2368  }
2369  }
2370  }
2371  }
2372 }
#define GL_BGRA
Definition: glfunctions.h:63
double qreal
Definition: qglobal.h:1193
int bytesPerLine() const
Returns the number of bytes per image scanline.
Definition: qimage.cpp:1812
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
unsigned char uchar
Definition: qglobal.h:994
unsigned int uint
Definition: qglobal.h:996
int depth() const
Returns the depth of the image.
Definition: qimage.cpp:1620
QSize size() const
Returns the size of the image, i.
Definition: qimage.cpp:1587
int width() const
Returns the width of the image.
Definition: qimage.cpp:1557
unsigned int quint32
Definition: qglobal.h:938
int height() const
Returns the height of the image.
Definition: qimage.cpp:1572
static QRgb qt_gl_convertToGLFormatHelper(QRgb src_pixel, GLenum texture_format)
Definition: qgl.cpp:2259
static const KeyPair *const end
uchar * scanLine(int)
Returns a pointer to the pixel data at the scanline with index i.
Definition: qimage.cpp:1886

◆ operator<<()

QDebug operator<< ( QDebug  dbg,
const QGLFormat f 
)

Definition at line 1620 of file qgl.cpp.

1621 {
1622  const QGLFormatPrivate * const d = f.d;
1623 
1624  dbg.nospace() << "QGLFormat("
1625  << "options " << d->opts
1626  << ", plane " << d->pln
1627  << ", depthBufferSize " << d->depthSize
1628  << ", accumBufferSize " << d->accumSize
1629  << ", stencilBufferSize " << d->stencilSize
1630  << ", redBufferSize " << d->redSize
1631  << ", greenBufferSize " << d->greenSize
1632  << ", blueBufferSize " << d->blueSize
1633  << ", alphaBufferSize " << d->alphaSize
1634  << ", samples " << d->numSamples
1635  << ", swapInterval " << d->swapInterval
1636  << ", majorVersion " << d->majorVersion
1637  << ", minorVersion " << d->minorVersion
1638  << ", profile " << d->profile
1639  << ')';
1640 
1641  return dbg.space();
1642 }
double d
Definition: qnumeric_p.h:62
int numSamples
Definition: qgl_p.h:165
QDebug & nospace()
Clears the stream&#39;s internal flag that records whether the last character was a space and returns a r...
Definition: qdebug.h:92
int minorVersion
Definition: qgl_p.h:168
int majorVersion
Definition: qgl_p.h:167
QGL::FormatOptions opts
Definition: qgl_p.h:156
QGLFormatPrivate * d
Definition: qgl.h:290
QGLFormat::OpenGLContextProfile profile
Definition: qgl_p.h:169
QDebug & space()
Writes a space character to the debug stream and returns a reference to the stream.
Definition: qdebug.h:91
int swapInterval
Definition: qgl_p.h:166
int stencilSize
Definition: qgl_p.h:160

◆ qDrawTextureRect()

static void qDrawTextureRect ( const QRectF target,
GLint  textureWidth,
GLint  textureHeight,
GLenum  textureTarget 
)
static

Definition at line 3003 of file qgl.cpp.

3004 {
3005  GLfloat tx = 1.0f;
3006  GLfloat ty = 1.0f;
3007 
3008 #ifdef QT_OPENGL_ES
3009  Q_UNUSED(textureWidth);
3010  Q_UNUSED(textureHeight);
3011  Q_UNUSED(textureTarget);
3012 #else
3013  if (textureTarget != GL_TEXTURE_2D) {
3014  if (textureWidth == -1 || textureHeight == -1) {
3015  glGetTexLevelParameteriv(textureTarget, 0, GL_TEXTURE_WIDTH, &textureWidth);
3016  glGetTexLevelParameteriv(textureTarget, 0, GL_TEXTURE_HEIGHT, &textureHeight);
3017  }
3018 
3019  tx = GLfloat(textureWidth);
3020  ty = GLfloat(textureHeight);
3021  }
3022 #endif
3023 
3024  GLfloat texCoordArray[4*2] = {
3025  0, ty, tx, ty, tx, 0, 0, 0
3026  };
3027 
3028  GLfloat vertexArray[4*2];
3029  qt_add_rect_to_array(target, vertexArray);
3030 
3031  glVertexPointer(2, GL_FLOAT, 0, vertexArray);
3032  glTexCoordPointer(2, GL_FLOAT, 0, texCoordArray);
3033 
3034  glEnableClientState(GL_VERTEX_ARRAY);
3035  glEnableClientState(GL_TEXTURE_COORD_ARRAY);
3036  glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
3037 
3038  glDisableClientState(GL_VERTEX_ARRAY);
3039  glDisableClientState(GL_TEXTURE_COORD_ARRAY);
3040 }
#define GL_TEXTURE_2D
void qt_add_rect_to_array(const QRectF &r, GLfloat *array)
Definition: qgl.cpp:2972
#define GL_TRIANGLE_FAN
#define GL_FLOAT
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Definition: qglobal.h:1729

◆ qgl_byteSwapImage()

static void qgl_byteSwapImage ( QImage img,
GLenum  pixel_type 
)
inlinestatic

Definition at line 2427 of file qgl.cpp.

2428 {
2429  const int width = img.width();
2430  const int height = img.height();
2431 
2432  if (pixel_type == GL_UNSIGNED_INT_8_8_8_8_REV
2433  || (pixel_type == GL_UNSIGNED_BYTE && QSysInfo::ByteOrder == QSysInfo::LittleEndian))
2434  {
2435  for (int i = 0; i < height; ++i) {
2436  uint *p = (uint *) img.scanLine(i);
2437  for (int x = 0; x < width; ++x)
2438  p[x] = ((p[x] << 16) & 0xff0000) | ((p[x] >> 16) & 0xff) | (p[x] & 0xff00ff00);
2439  }
2440  } else {
2441  for (int i = 0; i < height; ++i) {
2442  uint *p = (uint *) img.scanLine(i);
2443  for (int x = 0; x < width; ++x)
2444  p[x] = (p[x] << 8) | ((p[x] >> 24) & 0xff);
2445  }
2446  }
2447 }
#define GL_UNSIGNED_INT_8_8_8_8_REV
unsigned int uint
Definition: qglobal.h:996
int width() const
Returns the width of the image.
Definition: qimage.cpp:1557
#define GL_UNSIGNED_BYTE
int height() const
Returns the height of the image.
Definition: qimage.cpp:1572
uchar * scanLine(int)
Returns a pointer to the pixel data at the scanline with index i.
Definition: qimage.cpp:1886

◆ qgluProject()

static GLint qgluProject ( GLdouble  objx,
GLdouble  objy,
GLdouble  objz,
const GLdouble  model[16],
const GLdouble  proj[16],
const GLint  viewport[4],
GLdouble *  winx,
GLdouble *  winy,
GLdouble *  winz 
)
inlinestatic

Definition at line 402 of file qgl.cpp.

406 {
407  GLdouble in[4], out[4];
408 
409  in[0] = objx;
410  in[1] = objy;
411  in[2] = objz;
412  in[3] = 1.0;
413  transform_point(out, model, in);
414  transform_point(in, proj, out);
415 
416  if (in[3] == 0.0)
417  return GL_FALSE;
418 
419  in[0] /= in[3];
420  in[1] /= in[3];
421  in[2] /= in[3];
422 
423  *winx = viewport[0] + (1 + in[0]) * viewport[2] / 2;
424  *winy = viewport[1] + (1 + in[1]) * viewport[3] / 2;
425 
426  *winz = (1 + in[2]) / 2;
427  return GL_TRUE;
428 }
#define GL_TRUE
#define GL_FALSE
static void transform_point(GLdouble out[4], const GLdouble m[16], const GLdouble in[4])
Definition: qgl.cpp:381

◆ qOpenGLVersionFlagsFromString()

QGLFormat::OpenGLVersionFlags Q_AUTOTEST_EXPORT qOpenGLVersionFlagsFromString ( const QString versionString)

Definition at line 1320 of file qgl.cpp.

1321 {
1322  QGLFormat::OpenGLVersionFlags versionFlags = QGLFormat::OpenGL_Version_None;
1323 
1324  if (versionString.startsWith(QLatin1String("OpenGL ES"))) {
1325  QStringList parts = versionString.split(QLatin1Char(' '));
1326  if (parts.size() >= 3) {
1327  if (parts[2].startsWith(QLatin1String("1."))) {
1328  if (parts[1].endsWith(QLatin1String("-CM"))) {
1329  versionFlags |= QGLFormat::OpenGL_ES_Common_Version_1_0 |
1331  if (parts[2].startsWith(QLatin1String("1.1")))
1332  versionFlags |= QGLFormat::OpenGL_ES_Common_Version_1_1 |
1334  } else {
1335  // Not -CM, must be CL, CommonLite
1337  if (parts[2].startsWith(QLatin1String("1.1")))
1339  }
1340  } else {
1341  // OpenGL ES version 2.0 or higher
1342  versionFlags |= QGLFormat::OpenGL_ES_Version_2_0;
1343  }
1344  } else {
1345  // if < 3 parts to the name, it is an unrecognised OpenGL ES
1346  qWarning("Unrecognised OpenGL ES version");
1347  }
1348  } else {
1349  // not ES, regular OpenGL, the version numbers are first in the string
1350  if (versionString.startsWith(QLatin1String("1."))) {
1351  switch (versionString[2].toAscii()) {
1352  case '5':
1353  versionFlags |= QGLFormat::OpenGL_Version_1_5;
1354  case '4':
1355  versionFlags |= QGLFormat::OpenGL_Version_1_4;
1356  case '3':
1357  versionFlags |= QGLFormat::OpenGL_Version_1_3;
1358  case '2':
1359  versionFlags |= QGLFormat::OpenGL_Version_1_2;
1360  case '1':
1361  versionFlags |= QGLFormat::OpenGL_Version_1_1;
1362  default:
1363  break;
1364  }
1365  } else if (versionString.startsWith(QLatin1String("2."))) {
1366  versionFlags |= QGLFormat::OpenGL_Version_1_1 |
1372  if (versionString[2].toAscii() == '1')
1373  versionFlags |= QGLFormat::OpenGL_Version_2_1;
1374  } else if (versionString.startsWith(QLatin1String("3."))) {
1375  versionFlags |= QGLFormat::OpenGL_Version_1_1 |
1383  switch (versionString[2].toAscii()) {
1384  case '3':
1385  versionFlags |= QGLFormat::OpenGL_Version_3_3;
1386  case '2':
1387  versionFlags |= QGLFormat::OpenGL_Version_3_2;
1388  case '1':
1389  versionFlags |= QGLFormat::OpenGL_Version_3_1;
1390  case '0':
1391  break;
1392  default:
1393  versionFlags |= QGLFormat::OpenGL_Version_3_1 |
1396  break;
1397  }
1398  } else if (versionString.startsWith(QLatin1String("4."))) {
1399  versionFlags |= QGLFormat::OpenGL_Version_1_1 |
1411  } else {
1412  versionFlags |= QGLFormat::OpenGL_Version_1_1 |
1424  }
1425  }
1426  return versionFlags;
1427 }
bool startsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the string starts with s; otherwise returns false.
Definition: qstring.cpp:3734
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
The QStringList class provides a list of strings.
Definition: qstringlist.h:66
Q_CORE_EXPORT void qWarning(const char *,...)
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal...
Definition: qstring.h:654
int size() const
Returns the number of items in the list.
Definition: qlist.h:137
QStringList split(const QString &sep, SplitBehavior behavior=KeepEmptyParts, Qt::CaseSensitivity cs=Qt::CaseSensitive) const Q_REQUIRED_RESULT
Splits the string into substrings wherever sep occurs, and returns the list of those strings...
Definition: qstring.cpp:6526
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
Definition: qchar.h:55

◆ qt_add_rect_to_array()

void qt_add_rect_to_array ( const QRectF r,
GLfloat *  array 
)

Definition at line 2972 of file qgl.cpp.

Referenced by QOpenGLPaintEnginePrivate::composite(), QOpenGLPaintEnginePrivate::drawFastRect(), QGLTrapezoidMaskGenerator::drawMask(), QGLEllipseMaskGenerator::drawMask(), QOpenGLPaintEngine::drawStaticTextItem(), drawTexture(), QOpenGLPaintEngine::drawTextureRect(), QOpenGLPaintEngine::drawTiledPixmap(), and QGLTrapezoidMaskGenerator::QGLTrapezoidMaskGenerator().

2973 {
2974  qreal left = r.left();
2975  qreal right = r.right();
2976  qreal top = r.top();
2977  qreal bottom = r.bottom();
2978 
2979  array[0] = left;
2980  array[1] = top;
2981  array[2] = right;
2982  array[3] = top;
2983  array[4] = right;
2984  array[5] = bottom;
2985  array[6] = left;
2986  array[7] = bottom;
2987 }
qreal right() const
Returns the x-coordinate of the rectangle&#39;s right edge.
Definition: qrect.h:527
double qreal
Definition: qglobal.h:1193
qreal left() const
Returns the x-coordinate of the rectangle&#39;s left edge.
Definition: qrect.h:525
QTextStream & right(QTextStream &stream)
Calls QTextStream::setFieldAlignment(QTextStream::AlignRight) on stream and returns stream...
qreal top() const
Returns the y-coordinate of the rectangle&#39;s top edge.
Definition: qrect.h:526
qreal bottom() const
Returns the y-coordinate of the rectangle&#39;s bottom edge.
Definition: qrect.h:528
QTextStream & left(QTextStream &stream)
Calls QTextStream::setFieldAlignment(QTextStream::AlignLeft) on stream and returns stream...

◆ qt_add_texcoords_to_array()

void qt_add_texcoords_to_array ( qreal  x1,
qreal  y1,
qreal  x2,
qreal  y2,
GLfloat *  array 
)

Definition at line 2989 of file qgl.cpp.

Referenced by QOpenGLPaintEngine::drawStaticTextItem(), QOpenGLPaintEngine::drawTextureRect(), QOpenGLPaintEngine::drawTiledPixmap(), and QGLTrapezoidMaskGenerator::QGLTrapezoidMaskGenerator().

2990 {
2991  array[0] = x1;
2992  array[1] = y1;
2993  array[2] = x2;
2994  array[3] = y1;
2995  array[4] = x2;
2996  array[5] = y2;
2997  array[6] = x1;
2998  array[7] = y2;
2999 }

◆ qt_gl_convertToGLFormat()

QRgb qt_gl_convertToGLFormat ( QRgb  src_pixel,
GLenum  texture_format 
)

Definition at line 2281 of file qgl.cpp.

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

2282 {
2283  return qt_gl_convertToGLFormatHelper(src_pixel, texture_format);
2284 }
static QRgb qt_gl_convertToGLFormatHelper(QRgb src_pixel, GLenum texture_format)
Definition: qgl.cpp:2259

◆ qt_gl_convertToGLFormatHelper()

static QRgb qt_gl_convertToGLFormatHelper ( QRgb  src_pixel,
GLenum  texture_format 
)
inlinestatic

Definition at line 2259 of file qgl.cpp.

2260 {
2261  if (texture_format == GL_BGRA) {
2262  if (QSysInfo::ByteOrder == QSysInfo::BigEndian) {
2263  return ((src_pixel << 24) & 0xff000000)
2264  | ((src_pixel >> 24) & 0x000000ff)
2265  | ((src_pixel << 8) & 0x00ff0000)
2266  | ((src_pixel >> 8) & 0x0000ff00);
2267  } else {
2268  return src_pixel;
2269  }
2270  } else { // GL_RGBA
2271  if (QSysInfo::ByteOrder == QSysInfo::BigEndian) {
2272  return (src_pixel << 8) | ((src_pixel >> 24) & 0xff);
2273  } else {
2274  return ((src_pixel << 16) & 0xff0000)
2275  | ((src_pixel >> 16) & 0xff)
2276  | (src_pixel & 0xff00ff00);
2277  }
2278  }
2279 }
#define GL_BGRA
Definition: glfunctions.h:63

◆ qt_gl_draw_text()

static void qt_gl_draw_text ( QPainter p,
int  x,
int  y,
const QString str,
const QFont font 
)
static

Definition at line 5061 of file qgl.cpp.

5063 {
5064  GLfloat color[4];
5065  glGetFloatv(GL_CURRENT_COLOR, &color[0]);
5066 
5067  QColor col;
5068  col.setRgbF(color[0], color[1], color[2],color[3]);
5069  QPen old_pen = p->pen();
5070  QFont old_font = p->font();
5071 
5072  p->setPen(col);
5073  p->setFont(font);
5074  p->drawText(x, y, str);
5075 
5076  p->setPen(old_pen);
5077  p->setFont(old_font);
5078 }
The QColor class provides colors based on RGB, HSV or CMYK values.
Definition: qcolor.h:67
void setRgbF(qreal r, qreal g, qreal b, qreal a=1.0)
Sets the color channels of this color to r (red), g (green), b (blue) and a (alpha, transparency).
Definition: qcolor.cpp:954
The QPen class defines how a QPainter should draw lines and outlines of shapes.
Definition: qpen.h:64
void drawText(const QPointF &p, const QString &s)
Draws the given text with the currently defined text direction, beginning at the given position...
Definition: qpainter.cpp:6231
const QPen & pen() const
Returns the painter&#39;s current pen.
Definition: qpainter.cpp:4152
const QFont & font() const
Returns the currently set font used for drawing text.
Definition: qpainter.cpp:4312
The QFont class specifies a font used for drawing text.
Definition: qfont.h:64
void setPen(const QColor &color)
Sets the painter&#39;s pen to have style Qt::SolidLine, width 0 and the specified color.
Definition: qpainter.cpp:4047
void setFont(const QFont &f)
Sets the painter&#39;s font to the given font.
Definition: qpainter.cpp:4288

◆ qt_gl_library_name()

Q_OPENGL_EXPORT const QString qt_gl_library_name ( )

Definition at line 5827 of file qgl.cpp.

Referenced by QGLXContext::getProcAddress(), qgl_use_font(), qglx_getProcAddress(), and QGLXContext::QGLXContext().

5828 {
5829  if (qt_gl_lib_name()->isNull()) {
5830 #ifdef Q_WS_MAC
5831  return QLatin1String("/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib");
5832 #else
5833 # if defined(QT_OPENGL_ES_1)
5834  return QLatin1String("GLES_CM");
5835 # elif defined(QT_OPENGL_ES_2)
5836  return QLatin1String("GLESv2");
5837 # else
5838  return QLatin1String("GL");
5839 # endif
5840 #endif // defined Q_WS_MAC
5841  }
5842  return *qt_gl_lib_name();
5843 }
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
static bool isNull(const QVariant::Private *d)
Definition: qvariant.cpp:300

◆ qt_gl_preferGL2Engine()

bool qt_gl_preferGL2Engine ( )

◆ qt_gl_read_framebuffer()

QImage qt_gl_read_framebuffer ( const QSize size,
bool  alpha_format,
bool  include_alpha 
)

Definition at line 1860 of file qgl.cpp.

Referenced by QGLPixelBuffer::toImage(), and QGLFramebufferObject::toImage().

1861 {
1862  QImage img(size, (alpha_format && include_alpha) ? QImage::Format_ARGB32_Premultiplied
1864  int w = size.width();
1865  int h = size.height();
1866  glReadPixels(0, 0, w, h, GL_RGBA, GL_UNSIGNED_BYTE, img.bits());
1867  convertFromGLImage(img, w, h, alpha_format, include_alpha);
1868  return img;
1869 }
int width() const
Returns the width.
Definition: qsize.h:126
static void convertFromGLImage(QImage &img, int w, int h, bool alpha_format, bool include_alpha)
Definition: qgl.cpp:1818
The QImage class provides a hardware-independent image representation that allows direct access to th...
Definition: qimage.h:87
#define GL_UNSIGNED_BYTE
int height() const
Returns the height.
Definition: qsize.h:129
#define GL_RGBA

◆ qt_gl_read_texture()

QImage qt_gl_read_texture ( const QSize size,
bool  alpha_format,
bool  include_alpha 
)

Definition at line 1871 of file qgl.cpp.

Referenced by QGLPixmapData::fillImage(), and QGLPixmapData::toImage().

1872 {
1874  int w = size.width();
1875  int h = size.height();
1876 #if !defined(QT_OPENGL_ES_2) && !defined(QT_OPENGL_ES_1)
1877  //### glGetTexImage not in GL ES 2.0, need to do something else here!
1878  glGetTexImage(GL_TEXTURE_2D, 0, GL_RGBA, GL_UNSIGNED_BYTE, img.bits());
1879 #endif
1880  convertFromGLImage(img, w, h, alpha_format, include_alpha);
1881  return img;
1882 }
#define GL_TEXTURE_2D
int width() const
Returns the width.
Definition: qsize.h:126
static void convertFromGLImage(QImage &img, int w, int h, bool alpha_format, bool include_alpha)
Definition: qgl.cpp:1818
The QImage class provides a hardware-independent image representation that allows direct access to th...
Definition: qimage.h:87
#define GL_UNSIGNED_BYTE
int height() const
Returns the height.
Definition: qsize.h:129
#define GL_RGBA

◆ qt_gl_transfer_context()

const QGLContext* qt_gl_transfer_context ( const QGLContext ctx)

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
The QList class is a template class that provides lists.
Definition: qdatastream.h:62

◆ qt_next_power_of_two()

int qt_next_power_of_two ( int  v)

Definition at line 1886 of file qgl.cpp.

Referenced by areaDiff(), QOpenGLPaintEngine::begin(), QGLGlyphCache::cacheGlyphs(), QGLOffscreen::initialize(), maybeRoundToNextPowerOfTwo(), and QGLMaskTextureCache::quadtreeFindExistingLocation().

1887 {
1888  v--;
1889  v |= v >> 1;
1890  v |= v >> 2;
1891  v |= v >> 4;
1892  v |= v >> 8;
1893  v |= v >> 16;
1894  ++v;
1895  return v;
1896 }

◆ 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

◆ qt_restore_gl_state()

static void qt_restore_gl_state ( )
static

Definition at line 5049 of file qgl.cpp.

5050 {
5051  glMatrixMode(GL_TEXTURE);
5052  glPopMatrix();
5053  glMatrixMode(GL_PROJECTION);
5054  glPopMatrix();
5055  glMatrixMode(GL_MODELVIEW);
5056  glPopMatrix();
5057  glPopAttrib();
5058  glPopClientAttrib();
5059 }
#define GL_TEXTURE

◆ qt_save_gl_state()

static void qt_save_gl_state ( )
static

Definition at line 5028 of file qgl.cpp.

5029 {
5030  glPushClientAttrib(GL_CLIENT_ALL_ATTRIB_BITS);
5031  glPushAttrib(GL_ALL_ATTRIB_BITS);
5032  glMatrixMode(GL_TEXTURE);
5033  glPushMatrix();
5034  glLoadIdentity();
5035  glMatrixMode(GL_PROJECTION);
5036  glPushMatrix();
5037  glMatrixMode(GL_MODELVIEW);
5038  glPushMatrix();
5039 
5040  glShadeModel(GL_FLAT);
5041  glDisable(GL_CULL_FACE);
5042  glDisable(GL_LIGHTING);
5043  glDisable(GL_STENCIL_TEST);
5044  glDisable(GL_DEPTH_TEST);
5045  glEnable(GL_BLEND);
5046  glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
5047 }
#define GL_ONE_MINUS_SRC_ALPHA
#define GL_DEPTH_TEST
#define GL_STENCIL_TEST
#define GL_TEXTURE
#define GL_BLEND
#define GL_CULL_FACE
#define GL_ONE

◆ qt_set_gl_library_name()

Q_OPENGL_EXPORT void qt_set_gl_library_name ( const QString name)

Definition at line 5822 of file qgl.cpp.

5823 {
5824  qt_gl_lib_name()->operator=(name);
5825 }
const char * name

◆ qt_x11Info()

const QX11Info* qt_x11Info ( const QPaintDevice pd)
related

◆ transform_point()

static void transform_point ( GLdouble  out[4],
const GLdouble  m[16],
const GLdouble  in[4] 
)
inlinestatic

Definition at line 381 of file qgl.cpp.

Referenced by qgluProject().

382 {
383 #if defined(Q_CC_GNU) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 406)
384 # pragma GCC diagnostic push
385 # pragma GCC diagnostic ignored "-Warray-bounds"
386 #endif
387 #define M(row,col) m[col*4+row]
388  out[0] =
389  M(0, 0) * in[0] + M(0, 1) * in[1] + M(0, 2) * in[2] + M(0, 3) * in[3];
390  out[1] =
391  M(1, 0) * in[0] + M(1, 1) * in[1] + M(1, 2) * in[2] + M(1, 3) * in[3];
392  out[2] =
393  M(2, 0) * in[0] + M(2, 1) * in[1] + M(2, 2) * in[2] + M(2, 3) * in[3];
394  out[3] =
395  M(3, 0) * in[0] + M(3, 1) * in[1] + M(3, 2) * in[2] + M(3, 3) * in[3];
396 #undef M
397 #if defined(Q_CC_GNU) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 406)
398 # pragma GCC diagnostic pop
399 #endif
400 }
#define M(row, col)

Variable Documentation

◆ qgl_context_storage

QThreadStorage<QGLThreadContext *> qgl_context_storage
static

Definition at line 130 of file qgl.cpp.

◆ qt_image_cleanup_hook_64

Q_GUI_EXPORT _qt_image_cleanup_hook_64 qt_image_cleanup_hook_64

◆ qt_pixmap_cleanup_hook_64

Q_GUI_EXPORT _qt_pixmap_cleanup_hook_64 qt_pixmap_cleanup_hook_64