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
qopengltextureblitter.cpp File Reference

(135a792940ed3a7ed2cfc632e2b11477edea7706)

#include "qopengltextureblitter.h"
#include <QtOpenGL/QOpenGLShaderProgram>
#include <QtOpenGL/QOpenGLVertexArrayObject>
#include <QtOpenGL/QOpenGLBuffer>
#include <QtGui/QOpenGLContext>
#include <QtGui/QOpenGLFunctions>
#include <QtGui/QOpenGLExtraFunctions>
+ Include dependency graph for qopengltextureblitter.cpp:

Go to the source code of this file.

Classes

class  QBlitterTextureBinder
 
class  QOpenGLTextureBlitterPrivate
 
struct  QOpenGLTextureBlitterPrivate::Program
 

Macros

#define GL_TEXTURE_EXTERNAL_OES   0x8D65
 
#define GL_TEXTURE_RECTANGLE   0x84F5
 
#define GL_TEXTURE_WIDTH   0x1000
 
#define GL_TEXTURE_HEIGHT   0x1001
 

Functions

static QOpenGLTextureBlitterPrivate::ProgramIndex targetToProgramIndex (GLenum target)
 

Variables

static const char vertex_shader150 []
 
static const char fragment_shader150 []
 
static const char vertex_shader []
 
static const char fragment_shader []
 
static const char fragment_shader_external_oes []
 
static const char fragment_shader_rectangle []
 
static const char fragment_shader150_rectangle []
 
static const GLfloat vertex_buffer_data []
 
static const GLfloat texture_buffer_data []
 

Macro Definition Documentation

◆ GL_TEXTURE_EXTERNAL_OES

#define GL_TEXTURE_EXTERNAL_OES   0x8D65

Definition at line 14 of file qopengltextureblitter.cpp.

Referenced by targetToProgramIndex().

◆ GL_TEXTURE_HEIGHT

#define GL_TEXTURE_HEIGHT   0x1001

◆ GL_TEXTURE_RECTANGLE

#define GL_TEXTURE_RECTANGLE   0x84F5

◆ GL_TEXTURE_WIDTH

#define GL_TEXTURE_WIDTH   0x1000

Function Documentation

◆ targetToProgramIndex()

Variable Documentation

◆ fragment_shader

const char fragment_shader[]
static
Initial value:
=
"varying highp vec2 uv;"
"uniform sampler2D textureSampler;"
"uniform bool swizzle;"
"uniform highp float opacity;"
"void main() {"
" highp vec4 tmpFragColor = texture2D(textureSampler,uv);"
" tmpFragColor.a *= opacity;"
" gl_FragColor = swizzle ? tmpFragColor.bgra : tmpFragColor;"
"}"

Definition at line 107 of file qopengltextureblitter.cpp.

Referenced by QOpenGLTextureBlitter::create().

◆ fragment_shader150

const char fragment_shader150[]
static
Initial value:
=
"#version 150 core\n"
"in vec2 uv;"
"out vec4 fragcolor;"
"uniform sampler2D textureSampler;"
"uniform bool swizzle;"
"uniform float opacity;"
"void main() {"
" vec4 tmpFragColor = texture(textureSampler, uv);"
" tmpFragColor.a *= opacity;"
" fragcolor = swizzle ? tmpFragColor.bgra : tmpFragColor;"
"}"

Definition at line 83 of file qopengltextureblitter.cpp.

Referenced by QOpenGLTextureBlitter::create().

◆ fragment_shader150_rectangle

const char fragment_shader150_rectangle[]
static
Initial value:
=
"#version 150 core\n"
"in vec2 uv;"
"out vec4 fragcolor;"
"uniform sampler2DRect textureSampler;"
"uniform bool swizzle;"
"uniform float opacity;"
"void main() {"
" vec4 tmpFragColor = texture(textureSampler, uv);"
" tmpFragColor.a *= opacity;"
" fragcolor = swizzle ? tmpFragColor.bgra : tmpFragColor;"
"}"

Definition at line 141 of file qopengltextureblitter.cpp.

Referenced by QOpenGLTextureBlitterPrivate::ensureProgram().

◆ fragment_shader_external_oes

const char fragment_shader_external_oes[]
static
Initial value:
=
"#extension GL_OES_EGL_image_external : require\n"
"varying highp vec2 uv;"
"uniform samplerExternalOES textureSampler;\n"
"uniform bool swizzle;"
"uniform highp float opacity;"
"void main() {"
" highp vec4 tmpFragColor = texture2D(textureSampler, uv);"
" tmpFragColor.a *= opacity;"
" gl_FragColor = swizzle ? tmpFragColor.bgra : tmpFragColor;"
"}"

Definition at line 118 of file qopengltextureblitter.cpp.

Referenced by QOpenGLTextureBlitterPrivate::ensureProgram().

◆ fragment_shader_rectangle

const char fragment_shader_rectangle[]
static
Initial value:
=
"varying highp vec2 uv;"
"uniform sampler2DRect textureSampler;"
"uniform bool swizzle;"
"uniform highp float opacity;"
"void main() {"
" highp vec4 tmpFragColor = texture2DRect(textureSampler,uv);"
" tmpFragColor.a *= opacity;"
" gl_FragColor = swizzle ? tmpFragColor.bgra : tmpFragColor;"
"}"

Definition at line 130 of file qopengltextureblitter.cpp.

Referenced by QOpenGLTextureBlitterPrivate::ensureProgram().

◆ texture_buffer_data

const GLfloat texture_buffer_data[]
static
Initial value:
= {
0, 0,
0, 1,
1, 0,
0, 1,
1, 0,
1, 1
}

Definition at line 163 of file qopengltextureblitter.cpp.

Referenced by QOpenGLTextureBlitter::create().

◆ vertex_buffer_data

const GLfloat vertex_buffer_data[]
static
Initial value:
= {
-1,-1, 0,
-1, 1, 0,
1,-1, 0,
-1, 1, 0,
1,-1, 0,
1, 1, 0
}

Definition at line 154 of file qopengltextureblitter.cpp.

Referenced by QOpenGLTextureBlitter::create().

◆ vertex_shader

const char vertex_shader[]
static
Initial value:
=
"attribute highp vec3 vertexCoord;"
"attribute highp vec2 textureCoord;"
"varying highp vec2 uv;"
"uniform highp mat4 vertexTransform;"
"uniform highp mat3 textureTransform;"
"void main() {"
" uv = (textureTransform * vec3(textureCoord,1.0)).xy;"
" gl_Position = vertexTransform * vec4(vertexCoord,1.0);"
"}"

Definition at line 96 of file qopengltextureblitter.cpp.

Referenced by QOpenGLTextureBlitter::create(), and QOpenGLTextureBlitterPrivate::ensureProgram().

◆ vertex_shader150

const char vertex_shader150[]
static
Initial value:
=
"#version 150 core\n"
"in vec3 vertexCoord;"
"in vec2 textureCoord;"
"out vec2 uv;"
"uniform mat4 vertexTransform;"
"uniform mat3 textureTransform;"
"void main() {"
" uv = (textureTransform * vec3(textureCoord,1.0)).xy;"
" gl_Position = vertexTransform * vec4(vertexCoord,1.0);"
"}"

Definition at line 71 of file qopengltextureblitter.cpp.

Referenced by QOpenGLTextureBlitter::create(), and QOpenGLTextureBlitterPrivate::ensureProgram().