summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/eglfs
diff options
context:
space:
mode:
authorJorgen Lind <jorgen.lind@digia.com>2013-11-12 10:50:42 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-11-19 10:14:30 +0100
commitf087ffdc53254fbab438180cd2da750d54c2be76 (patch)
tree21020327d916926bd01c7db4cd17e9ef1fa8754c /src/plugins/platforms/eglfs
parent7e768dde39f9365a4e1fc45afc492b74744a44e6 (diff)
Remove the GLES 2 dependency for eglfs and kms
Change-Id: If7b80487e01db726367f5a67d2860073f60a0844 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Diffstat (limited to 'src/plugins/platforms/eglfs')
-rw-r--r--src/plugins/platforms/eglfs/qeglfsbackingstore.cpp1
-rw-r--r--src/plugins/platforms/eglfs/qeglfsbackingstore.h3
-rw-r--r--src/plugins/platforms/eglfs/qeglfscompositor.cpp7
-rw-r--r--src/plugins/platforms/eglfs/qeglfscompositor.h6
-rw-r--r--src/plugins/platforms/eglfs/qeglfscursor.cpp5
-rw-r--r--src/plugins/platforms/eglfs/qeglfscursor.h7
6 files changed, 21 insertions, 8 deletions
diff --git a/src/plugins/platforms/eglfs/qeglfsbackingstore.cpp b/src/plugins/platforms/eglfs/qeglfsbackingstore.cpp
index 9de5960fdb..03531916cf 100644
--- a/src/plugins/platforms/eglfs/qeglfsbackingstore.cpp
+++ b/src/plugins/platforms/eglfs/qeglfsbackingstore.cpp
@@ -139,6 +139,7 @@ void QEglFSBackingStore::resize(const QSize &size, const QRegion &staticContents
m_window->create();
rootWin->screen()->rootContext()->makeCurrent(rootWin->window());
+ initializeOpenGLFunctions();
if (m_texture)
glDeleteTextures(1, &m_texture);
diff --git a/src/plugins/platforms/eglfs/qeglfsbackingstore.h b/src/plugins/platforms/eglfs/qeglfsbackingstore.h
index 535428aac1..9af856e8e7 100644
--- a/src/plugins/platforms/eglfs/qeglfsbackingstore.h
+++ b/src/plugins/platforms/eglfs/qeglfsbackingstore.h
@@ -43,6 +43,7 @@
#define QEGLFSBACKINGSTORE_H
#include <qpa/qplatformbackingstore.h>
+#include <QtGui/QOpenGLFunctions>
#include <QImage>
#include <QRegion>
@@ -52,7 +53,7 @@ QT_BEGIN_NAMESPACE
class QOpenGLPaintDevice;
class QEglFSWindow;
-class QEglFSBackingStore : public QPlatformBackingStore
+class QEglFSBackingStore : public QPlatformBackingStore, public QOpenGLFunctions
{
public:
QEglFSBackingStore(QWindow *window);
diff --git a/src/plugins/platforms/eglfs/qeglfscompositor.cpp b/src/plugins/platforms/eglfs/qeglfscompositor.cpp
index 9db43a57a1..845bb5b3b5 100644
--- a/src/plugins/platforms/eglfs/qeglfscompositor.cpp
+++ b/src/plugins/platforms/eglfs/qeglfscompositor.cpp
@@ -53,7 +53,8 @@ static QEglFSCompositor *compositor = 0;
QEglFSCompositor::QEglFSCompositor()
: m_screen(0),
- m_program(0)
+ m_program(0),
+ m_initialized(false)
{
Q_ASSERT(!compositor);
m_updateTimer.setSingleShot(true);
@@ -86,6 +87,10 @@ void QEglFSCompositor::renderAll()
Q_ASSERT(context);
context->makeCurrent(rootWin->window());
+ if (!m_initialized) {
+ initializeOpenGLFunctions();
+ m_initialized = true;
+ }
ensureProgram();
m_program->bind();
diff --git a/src/plugins/platforms/eglfs/qeglfscompositor.h b/src/plugins/platforms/eglfs/qeglfscompositor.h
index ade2e06031..0d5daafa2c 100644
--- a/src/plugins/platforms/eglfs/qeglfscompositor.h
+++ b/src/plugins/platforms/eglfs/qeglfscompositor.h
@@ -42,7 +42,8 @@
#ifndef QEGLFSCOMPOSITOR_H
#define QEGLFSCOMPOSITOR_H
-#include <QTimer>
+#include <QtCore/QTimer>
+#include <QtGui/QOpenGLFunctions>
QT_BEGIN_NAMESPACE
@@ -50,7 +51,7 @@ class QEglFSScreen;
class QEglFSWindow;
class QOpenGLShaderProgram;
-class QEglFSCompositor : public QObject
+class QEglFSCompositor : public QObject, public QOpenGLFunctions
{
Q_OBJECT
@@ -76,6 +77,7 @@ private:
int m_vertexCoordEntry;
int m_textureCoordEntry;
int m_isRasterEntry;
+ bool m_initialized;
};
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/eglfs/qeglfscursor.cpp b/src/plugins/platforms/eglfs/qeglfscursor.cpp
index c00e86de35..0066426769 100644
--- a/src/plugins/platforms/eglfs/qeglfscursor.cpp
+++ b/src/plugins/platforms/eglfs/qeglfscursor.cpp
@@ -79,7 +79,7 @@ void QEglFSCursor::resetResources()
m_cursorAtlas.texture = 0;
}
-static GLuint createShader(GLenum shaderType, const char *program)
+GLuint QEglFSCursor::createShader(GLenum shaderType, const char *program)
{
GLuint shader = glCreateShader(shaderType);
glShaderSource(shader, 1 /* count */, &program, NULL /* lengths */);
@@ -98,7 +98,7 @@ static GLuint createShader(GLenum shaderType, const char *program)
return 0;
}
-static GLuint createProgram(GLuint vshader, GLuint fshader)
+GLuint QEglFSCursor::createProgram(GLuint vshader, GLuint fshader)
{
GLuint program = glCreateProgram();
glAttachShader(program, vshader);
@@ -286,6 +286,7 @@ void QEglFSCursor::draw(const QRectF &r)
{
if (!m_program) {
// one time initialization
+ initializeOpenGLFunctions();
createShaderPrograms();
if (!m_cursorAtlas.texture) {
diff --git a/src/plugins/platforms/eglfs/qeglfscursor.h b/src/plugins/platforms/eglfs/qeglfscursor.h
index 51a34e041d..71ff73b8f3 100644
--- a/src/plugins/platforms/eglfs/qeglfscursor.h
+++ b/src/plugins/platforms/eglfs/qeglfscursor.h
@@ -43,15 +43,15 @@
#define QEGLFSCURSOR_H
#include <qpa/qplatformcursor.h>
+#include <QtGui/QOpenGLFunctions>
#include "qeglfsscreen.h"
-#include <GLES2/gl2.h>
QT_BEGIN_NAMESPACE
class QOpenGLShaderProgram;
class QEglFSScreen;
-class QEglFSCursor : public QPlatformCursor
+class QEglFSCursor : public QPlatformCursor, public QOpenGLFunctions
{
public:
QEglFSCursor(QEglFSScreen *screen);
@@ -78,6 +78,9 @@ protected:
void draw(const QRectF &rect);
void update(const QRegion &region);
+ GLuint createShader(GLenum shaderType, const char *program);
+ GLuint createProgram(GLuint vshader, GLuint fshader);
+
QEglFSScreen *m_screen;
// current cursor information