Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2018-07-02 20:39:50 +0300
committerClément Foucault <foucault.clem@gmail.com>2018-07-03 14:36:04 +0300
commit433e3db8d89130531424e2468dedcfb36f6eb592 (patch)
tree3cca0f1b72dac75dbc512473b7645284aed03d00 /intern/ghost
parent6c9fe9cd8ca0ac0bfbe00463d73d3c79b1bff6f3 (diff)
Revert "GHOST: Delay opengl context initialization"
This reverts commit 128926a41b368e166af63515370d9c9367e3dda2.
Diffstat (limited to 'intern/ghost')
-rw-r--r--intern/ghost/intern/GHOST_ContextGLX.cpp30
-rw-r--r--intern/ghost/intern/GHOST_ContextGLX.h2
2 files changed, 6 insertions, 26 deletions
diff --git a/intern/ghost/intern/GHOST_ContextGLX.cpp b/intern/ghost/intern/GHOST_ContextGLX.cpp
index 1365a1a9c24..815189b9098 100644
--- a/intern/ghost/intern/GHOST_ContextGLX.cpp
+++ b/intern/ghost/intern/GHOST_ContextGLX.cpp
@@ -110,9 +110,6 @@ GHOST_TSuccess GHOST_ContextGLX::swapBuffers()
GHOST_TSuccess GHOST_ContextGLX::activateDrawingContext()
{
- if (m_init == false) {
- initContext();
- }
if (m_display) {
return ::glXMakeCurrent(m_display, m_window, m_context) ? GHOST_kSuccess : GHOST_kFailure;
}
@@ -187,8 +184,7 @@ const bool GLXEW_ARB_create_context_robustness =
glxewInit();
#endif /* USE_GLXEW_INIT_WORKAROUND */
- /* Only init the non-offscreen context directly */
- const bool do_init = (m_window != None);
+
if (GLXEW_ARB_create_context) {
int profileBitCore = m_contextProfileMask & GLX_CONTEXT_CORE_PROFILE_BIT_ARB;
@@ -308,27 +304,12 @@ const bool GLXEW_ARB_create_context_robustness =
GHOST_TSuccess success;
if (m_context != NULL) {
+ const unsigned char *version;
+
if (!s_sharedContext)
s_sharedContext = m_context;
s_sharedCount++;
- }
-
- if (do_init) {
- success = initContext();
- }
-
- GHOST_X11_ERROR_HANDLERS_RESTORE(handler_store);
-
- return success;
-}
-
-GHOST_TSuccess GHOST_ContextGLX::initContext()
-{
- GHOST_TSuccess success;
-
- if (m_context != NULL) {
- const unsigned char *version;
glXMakeCurrent(m_display, m_window, m_context);
@@ -360,12 +341,13 @@ GHOST_TSuccess GHOST_ContextGLX::initContext()
success = GHOST_kFailure;
}
- /* We tag as init even if it fails. */
- m_init = true;
+
+ GHOST_X11_ERROR_HANDLERS_RESTORE(handler_store);
return success;
}
+
GHOST_TSuccess GHOST_ContextGLX::releaseNativeHandles()
{
m_window = 0;
diff --git a/intern/ghost/intern/GHOST_ContextGLX.h b/intern/ghost/intern/GHOST_ContextGLX.h
index b4d6a841d72..ded1b293659 100644
--- a/intern/ghost/intern/GHOST_ContextGLX.h
+++ b/intern/ghost/intern/GHOST_ContextGLX.h
@@ -116,7 +116,6 @@ public:
private:
void initContextGLXEW();
- GHOST_TSuccess initContext();
Display *m_display;
GLXFBConfig m_fbconfig;
@@ -129,7 +128,6 @@ private:
const int m_contextResetNotificationStrategy;
GLXContext m_context;
- bool m_init;
/** The first created OpenGL context (for sharing display lists) */
static GLXContext s_sharedContext;