summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/eglfs/qeglfsscreen.cpp
diff options
context:
space:
mode:
authorGirish Ramakrishnan <girish.1.ramakrishnan@nokia.com>2012-06-01 12:04:35 -0700
committerQt by Nokia <qt-info@nokia.com>2012-06-05 18:48:16 +0200
commitf35470a442286018f91cc4cdc7571a5c99926d99 (patch)
treeb5d7221635aa4dd49c6d8078dd23b89c178a96cb /src/plugins/platforms/eglfs/qeglfsscreen.cpp
parente1774d202912b5d053872f242c61d964a5d69450 (diff)
eglfs refactor: Move egl initialization to the integration
Change-Id: If2c870538c742fd034fb9e5c115e4ac0bd8e2e03 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Diffstat (limited to 'src/plugins/platforms/eglfs/qeglfsscreen.cpp')
-rw-r--r--src/plugins/platforms/eglfs/qeglfsscreen.cpp42
1 files changed, 3 insertions, 39 deletions
diff --git a/src/plugins/platforms/eglfs/qeglfsscreen.cpp b/src/plugins/platforms/eglfs/qeglfsscreen.cpp
index 007829b682..8374ba5707 100644
--- a/src/plugins/platforms/eglfs/qeglfsscreen.cpp
+++ b/src/plugins/platforms/eglfs/qeglfsscreen.cpp
@@ -78,8 +78,9 @@ public:
}
};
-QEglFSScreen::QEglFSScreen()
- : m_depth(32)
+QEglFSScreen::QEglFSScreen(EGLDisplay dpy)
+ : m_dpy(dpy)
+ , m_depth(32)
, m_format(QImage::Format_Invalid)
, m_platformContext(0)
, m_surface(0)
@@ -90,39 +91,6 @@ QEglFSScreen::QEglFSScreen()
qWarning("QEglScreen %p\n", this);
#endif
- hooks->platformInit();
-
- EGLint major, minor;
-
- if (!eglBindAPI(EGL_OPENGL_ES_API)) {
- qWarning("Could not bind GL_ES API\n");
- qFatal("EGL error");
- }
-
- m_dpy = eglGetDisplay(hooks ? hooks->platformDisplay() : EGL_DEFAULT_DISPLAY);
- if (m_dpy == EGL_NO_DISPLAY) {
- qWarning("Could not open egl display\n");
- qFatal("EGL error");
- }
- qWarning("Opened display %p\n", m_dpy);
-
- if (!eglInitialize(m_dpy, &major, &minor)) {
- qWarning("Could not initialize egl display\n");
- qFatal("EGL error");
- }
-
- qWarning("Initialized display %d %d\n", major, minor);
-
- int swapInterval = 1;
- QByteArray swapIntervalString = qgetenv("QT_QPA_EGLFS_SWAPINTERVAL");
- if (!swapIntervalString.isEmpty()) {
- bool ok;
- swapInterval = swapIntervalString.toInt(&ok);
- if (!ok)
- swapInterval = 1;
- }
- eglSwapInterval(m_dpy, swapInterval);
-
static int hideCursor = qgetenv("QT_QPA_EGLFS_HIDECURSOR").toInt();
if (!hideCursor) {
if (QEglFSCursor *customCursor = hooks->createCursor(this))
@@ -140,10 +108,6 @@ QEglFSScreen::~QEglFSScreen()
eglDestroySurface(m_dpy, m_surface);
hooks->destroyNativeWindow(m_window);
-
- eglTerminate(m_dpy);
-
- hooks->platformDestroy();
}
void QEglFSScreen::createAndSetPlatformContext() const {