summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/platforms/blackberry/qbbglcontext.cpp31
-rw-r--r--src/plugins/platforms/blackberry/qbbglcontext.h6
2 files changed, 8 insertions, 29 deletions
diff --git a/src/plugins/platforms/blackberry/qbbglcontext.cpp b/src/plugins/platforms/blackberry/qbbglcontext.cpp
index 93930200ec..81ff0161d5 100644
--- a/src/plugins/platforms/blackberry/qbbglcontext.cpp
+++ b/src/plugins/platforms/blackberry/qbbglcontext.cpp
@@ -53,8 +53,6 @@
QT_BEGIN_NAMESPACE
EGLDisplay QBBGLContext::sEglDisplay = EGL_NO_DISPLAY;
-EGLConfig QBBGLContext::sEglConfig = 0;
-QPlatformWindowFormat QBBGLContext::sWindowFormat;
QBBGLContext::QBBGLContext(QBBWindow* platformWindow)
: QPlatformGLContext(),
@@ -127,18 +125,18 @@ QBBGLContext::QBBGLContext(QBBWindow* platformWindow)
format.setBlueBufferSize(blueSize);
// select EGL config based on requested window format
- sEglConfig = q_configFromQPlatformWindowFormat(sEglDisplay, format);
- if (sEglConfig == 0) {
+ mEglConfig = q_configFromQPlatformWindowFormat(sEglDisplay, format);
+ if (mEglConfig == 0) {
qFatal("QBB: failed to find EGL config");
}
- mEglContext = eglCreateContext(sEglDisplay, sEglConfig, EGL_NO_CONTEXT, contextAttrs());
+ mEglContext = eglCreateContext(sEglDisplay, mEglConfig, EGL_NO_CONTEXT, contextAttrs());
if (mEglContext == EGL_NO_CONTEXT) {
qFatal("QBB: failed to create EGL context, err=%d", eglGetError());
}
// query/cache window format of selected EGL config
- sWindowFormat = qt_qPlatformWindowFormatFromConfig(sEglDisplay, sEglConfig);
+ mWindowFormat = qt_qPlatformWindowFormatFromConfig(sEglDisplay, mEglConfig);
}
QBBGLContext::~QBBGLContext()
@@ -175,25 +173,6 @@ void QBBGLContext::initialize()
#else
EGLint renderableType = EGL_OPENGL_ES_BIT;
#endif
-
- // get EGL config compatible with window
- EGLint numConfig;
- EGLint configAttrs[] = { EGL_BUFFER_SIZE, 32,
- EGL_ALPHA_SIZE, 8,
- EGL_RED_SIZE, 8,
- EGL_GREEN_SIZE, 8,
- EGL_BLUE_SIZE, 8,
- EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
- EGL_RENDERABLE_TYPE, renderableType,
- EGL_NONE };
- eglResult = eglChooseConfig(sEglDisplay, configAttrs, &sEglConfig, 1, &numConfig);
- if (eglResult != EGL_TRUE || numConfig == 0) {
- qFatal("QBB: failed to find EGL config, err=%d, numConfig=%d", eglGetError(), numConfig);
- }
-
- // query/cache window format
- sWindowFormat = qt_qPlatformWindowFormatFromConfig(sEglDisplay, sEglConfig);
- sWindowFormat.setWindowApi(QPlatformWindowFormat::OpenGL);
}
void QBBGLContext::shutdown()
@@ -344,7 +323,7 @@ void QBBGLContext::createSurface()
#endif
// create EGL surface
- mEglSurface = eglCreateWindowSurface(sEglDisplay, sEglConfig, (EGLNativeWindowType)mPlatformWindow->winId(), NULL);
+ mEglSurface = eglCreateWindowSurface(sEglDisplay, mEglConfig, (EGLNativeWindowType)mPlatformWindow->winId(), NULL);
if (mEglSurface == EGL_NO_SURFACE) {
qFatal("QBB: failed to create EGL surface, err=%d", eglGetError());
}
diff --git a/src/plugins/platforms/blackberry/qbbglcontext.h b/src/plugins/platforms/blackberry/qbbglcontext.h
index 6a93c1f1ac..73825e97ff 100644
--- a/src/plugins/platforms/blackberry/qbbglcontext.h
+++ b/src/plugins/platforms/blackberry/qbbglcontext.h
@@ -66,16 +66,16 @@ public:
virtual void swapBuffers();
virtual void* getProcAddress(const QString& procName);
- virtual QPlatformWindowFormat platformWindowFormat() const { return sWindowFormat; }
+ virtual QPlatformWindowFormat platformWindowFormat() const { return mWindowFormat; }
void resizeSurface(const QSize &size);
QSize surfaceSize() const { return mSurfaceSize; }
private:
static EGLDisplay sEglDisplay;
- static EGLConfig sEglConfig;
- static QPlatformWindowFormat sWindowFormat;
+ QPlatformWindowFormat mWindowFormat;
+ EGLConfig mEglConfig;
QBBWindow *mPlatformWindow;
EGLContext mEglContext;
EGLSurface mEglSurface;