Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qopenglprogrambinarycache.cpp File Reference

(05fc3aef53348fb58be6308076e000825b704e58)

#include "qopenglprogrambinarycache_p.h"
#include <QOpenGLContext>
#include <QOpenGLExtraFunctions>
#include <QSysInfo>
#include <QStandardPaths>
#include <QDir>
#include <QSaveFile>
#include <QCoreApplication>
#include <QCryptographicHash>
+ Include dependency graph for qopenglprogrambinarycache.cpp:

Go to the source code of this file.

Classes

class  DeferredFileRemove
 

Macros

#define GL_CONTEXT_LOST   0x0507
 
#define GL_PROGRAM_BINARY_LENGTH   0x8741
 
#define GL_NUM_PROGRAM_BINARY_FORMATS   0x87FE
 
#define BASE_HEADER_SIZE   (int(4 * sizeof(quint32)))
 
#define FULL_HEADER_SIZE(stringsSize)   (BASE_HEADER_SIZE + 12 + stringsSize + 8)
 
#define PADDING_SIZE(fullHeaderSize)   (((fullHeaderSize + 3) & ~3) - fullHeaderSize)
 

Functions

static bool qt_ensureWritableDir (const QString &name)
 
static quint32 readUInt (const uchar **p)
 
static QByteArray readStr (const uchar **p)
 
static void writeUInt (uchar **p, quint32 value)
 
static void writeStr (uchar **p, const QByteArray &str)
 
static bool writeFile (const QString &filename, const QByteArray &data)
 

Variables

const quint32 BINSHADER_MAGIC = 0x5174
 
const quint32 BINSHADER_VERSION = 0x3
 
const quint32 BINSHADER_QTVERSION = QT_VERSION
 

Macro Definition Documentation

◆ BASE_HEADER_SIZE

#define BASE_HEADER_SIZE   (int(4 * sizeof(quint32)))

Definition at line 108 of file qopenglprogrambinarycache.cpp.

Referenced by QOpenGLProgramBinaryCache::load().

◆ FULL_HEADER_SIZE

#define FULL_HEADER_SIZE ( stringsSize)    (BASE_HEADER_SIZE + 12 + stringsSize + 8)

◆ GL_CONTEXT_LOST

#define GL_CONTEXT_LOST   0x0507

Definition at line 26 of file qopenglprogrambinarycache.cpp.

◆ GL_NUM_PROGRAM_BINARY_FORMATS

#define GL_NUM_PROGRAM_BINARY_FORMATS   0x87FE

Definition at line 34 of file qopenglprogrambinarycache.cpp.

◆ GL_PROGRAM_BINARY_LENGTH

#define GL_PROGRAM_BINARY_LENGTH   0x8741

Definition at line 30 of file qopenglprogrambinarycache.cpp.

◆ PADDING_SIZE

#define PADDING_SIZE ( fullHeaderSize)    (((fullHeaderSize + 3) & ~3) - fullHeaderSize)

Function Documentation

◆ qt_ensureWritableDir()

static bool qt_ensureWritableDir ( const QString & name)
inlinestatic

Definition at line 77 of file qopenglprogrambinarycache.cpp.

References QFileInfo::isWritable(), and QDir::root().

Referenced by QOpenGLProgramBinaryCache::QOpenGLProgramBinaryCache(), and QOpenGLProgramBinaryCache::save().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ readStr()

static QByteArray readStr ( const uchar ** p)
inlinestatic

Definition at line 120 of file qopenglprogrambinarycache.cpp.

References ba, QByteArray::fromRawData(), and readUInt().

Referenced by QOpenGLProgramBinaryCache::load().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ readUInt()

static quint32 readUInt ( const uchar ** p)
inlinestatic

Definition at line 112 of file qopenglprogrambinarycache.cpp.

Referenced by readStr().

+ Here is the caller graph for this function:

◆ writeFile()

static bool writeFile ( const QString & filename,
const QByteArray & data )
inlinestatic

◆ writeStr()

static void writeStr ( uchar ** p,
const QByteArray & str )
inlinestatic

Definition at line 327 of file qopenglprogrambinarycache.cpp.

References QString::constData(), QString::size(), str, and writeUInt().

Referenced by qSaveQmlJSUnitAsCpp(), and QOpenGLProgramBinaryCache::save().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ writeUInt()

static void writeUInt ( uchar ** p,
quint32 value )
inlinestatic

Definition at line 321 of file qopenglprogrambinarycache.cpp.

Referenced by writeStr().

+ Here is the caller graph for this function:

Variable Documentation

◆ BINSHADER_MAGIC

const quint32 BINSHADER_MAGIC = 0x5174

Definition at line 37 of file qopenglprogrambinarycache.cpp.

Referenced by QOpenGLProgramBinaryCache::save().

◆ BINSHADER_QTVERSION

const quint32 BINSHADER_QTVERSION = QT_VERSION

Definition at line 39 of file qopenglprogrambinarycache.cpp.

Referenced by QOpenGLProgramBinaryCache::save().

◆ BINSHADER_VERSION

const quint32 BINSHADER_VERSION = 0x3

Definition at line 38 of file qopenglprogrambinarycache.cpp.

Referenced by QOpenGLProgramBinaryCache::save().