From f091eccf9124f951fc41cfaa6b4be68e7379a5d6 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Mon, 5 Dec 2011 22:30:32 +0800 Subject: directfbegl: Add unimplemented QDirectFbWindow::eglSurface, build fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit QDirectFbScreen needs to have the full QDirectFbCursor definition, include the header file directly instead of a forward declaration. Impelement QDirectFbWindowEGL::eglSurface to return the EGLSurface of the underlying DirectFBWindow. Change-Id: Ib6765331ffea6e0b5f10f738d9e05320b7f8155f Reviewed-by: Jørgen Lind --- src/plugins/platforms/directfb/qdirectfb_egl.cpp | 15 +++++++++++++++ src/plugins/platforms/directfb/qdirectfbscreen.h | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/plugins/platforms/directfb/qdirectfb_egl.cpp b/src/plugins/platforms/directfb/qdirectfb_egl.cpp index 399e90a9fb..958a3be5e3 100644 --- a/src/plugins/platforms/directfb/qdirectfb_egl.cpp +++ b/src/plugins/platforms/directfb/qdirectfb_egl.cpp @@ -48,6 +48,7 @@ #include #include +#include #include @@ -158,6 +159,20 @@ QDirectFbWindowEGL::~QDirectFbWindowEGL() } } +EGLSurface QDirectFbWindowEGL::eglSurface() +{ + if (m_eglSurface == EGL_NO_SURFACE) { + QDirectFbScreenEGL *dfbScreen = static_cast(screen()); + EGLConfig config = q_configFromGLFormat(dfbScreen->eglDisplay(), format(), true); + m_eglSurface = eglCreateWindowSurface(dfbScreen->eglDisplay(), config, dfbSurface(), NULL); + + if (m_eglSurface == EGL_NO_SURFACE) + eglGetError(); + } + + return m_eglSurface; +} + QSurfaceFormat QDirectFbWindowEGL::format() const { return window()->requestedFormat(); diff --git a/src/plugins/platforms/directfb/qdirectfbscreen.h b/src/plugins/platforms/directfb/qdirectfbscreen.h index b719146c90..b9d53beaa5 100644 --- a/src/plugins/platforms/directfb/qdirectfbscreen.h +++ b/src/plugins/platforms/directfb/qdirectfbscreen.h @@ -43,6 +43,7 @@ #define QDIRECTFBSCREEN_H #include "qdirectfbconvenience.h" +#include "qdirectfbcursor.h" #include @@ -50,7 +51,6 @@ QT_BEGIN_NAMESPACE -class QDirectFBCursor; class QDirectFbScreen : public QPlatformScreen { -- cgit v1.2.3