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:
authorChristian Rauch <Rauch.Christian@gmx.de>2021-06-23 02:01:04 +0300
committerChristian Rauch <Rauch.Christian@gmx.de>2021-06-24 20:40:05 +0300
commit5f27a5fff7f24d57c39e4b79feeeb4c408c89139 (patch)
treebe67107766cdea8a520b4169a898c4bdaf08a836
parentb801db11811ddd5c9639ff8e701cf5462dde4139 (diff)
GHOST/EGL: store pointer to GHOST_System for downcast tests
-rw-r--r--intern/ghost/intern/GHOST_ContextEGL.cpp4
-rw-r--r--intern/ghost/intern/GHOST_ContextEGL.h6
-rw-r--r--intern/ghost/intern/GHOST_SystemWayland.cpp6
-rw-r--r--intern/ghost/intern/GHOST_SystemX11.cpp6
-rw-r--r--intern/ghost/intern/GHOST_WindowWayland.cpp6
-rw-r--r--intern/ghost/intern/GHOST_WindowX11.cpp4
6 files changed, 23 insertions, 9 deletions
diff --git a/intern/ghost/intern/GHOST_ContextEGL.cpp b/intern/ghost/intern/GHOST_ContextEGL.cpp
index 770ead5962e..0fee200ea1a 100644
--- a/intern/ghost/intern/GHOST_ContextEGL.cpp
+++ b/intern/ghost/intern/GHOST_ContextEGL.cpp
@@ -202,7 +202,8 @@ template<typename T> T &choose_api(EGLenum api, T &a, T &b, T &c)
}
}
-GHOST_ContextEGL::GHOST_ContextEGL(bool stereoVisual,
+GHOST_ContextEGL::GHOST_ContextEGL(const GHOST_System *const system,
+ bool stereoVisual,
EGLNativeWindowType nativeWindow,
EGLNativeDisplayType nativeDisplay,
EGLint contextProfileMask,
@@ -212,6 +213,7 @@ GHOST_ContextEGL::GHOST_ContextEGL(bool stereoVisual,
EGLint contextResetNotificationStrategy,
EGLenum api)
: GHOST_Context(stereoVisual),
+ m_system(system),
m_nativeDisplay(nativeDisplay),
m_nativeWindow(nativeWindow),
m_contextProfileMask(contextProfileMask),
diff --git a/intern/ghost/intern/GHOST_ContextEGL.h b/intern/ghost/intern/GHOST_ContextEGL.h
index 170647177c2..00c8e33ebdf 100644
--- a/intern/ghost/intern/GHOST_ContextEGL.h
+++ b/intern/ghost/intern/GHOST_ContextEGL.h
@@ -24,6 +24,7 @@
#pragma once
#include "GHOST_Context.h"
+#include "GHOST_System.h"
#include <GL/eglew.h>
@@ -43,7 +44,8 @@ class GHOST_ContextEGL : public GHOST_Context {
/**
* Constructor.
*/
- GHOST_ContextEGL(bool stereoVisual,
+ GHOST_ContextEGL(const GHOST_System *const system,
+ bool stereoVisual,
EGLNativeWindowType nativeWindow,
EGLNativeDisplayType nativeDisplay,
EGLint contextProfileMask,
@@ -112,6 +114,8 @@ class GHOST_ContextEGL : public GHOST_Context {
private:
bool initContextEGLEW();
+ const GHOST_System *const m_system;
+
EGLNativeDisplayType m_nativeDisplay;
EGLNativeWindowType m_nativeWindow;
diff --git a/intern/ghost/intern/GHOST_SystemWayland.cpp b/intern/ghost/intern/GHOST_SystemWayland.cpp
index 16a6c93417e..f54a022f249 100644
--- a/intern/ghost/intern/GHOST_SystemWayland.cpp
+++ b/intern/ghost/intern/GHOST_SystemWayland.cpp
@@ -1593,7 +1593,8 @@ GHOST_IContext *GHOST_SystemWayland::createOffscreenContext(GHOST_GLSettings /*g
GHOST_Context *context;
for (int minor = 6; minor >= 0; --minor) {
- context = new GHOST_ContextEGL(false,
+ context = new GHOST_ContextEGL(this,
+ false,
EGLNativeWindowType(os_egl_window),
EGLNativeDisplayType(d->display),
EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT,
@@ -1609,7 +1610,8 @@ GHOST_IContext *GHOST_SystemWayland::createOffscreenContext(GHOST_GLSettings /*g
delete context;
}
- context = new GHOST_ContextEGL(false,
+ context = new GHOST_ContextEGL(this,
+ false,
EGLNativeWindowType(os_egl_window),
EGLNativeDisplayType(d->display),
EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT,
diff --git a/intern/ghost/intern/GHOST_SystemX11.cpp b/intern/ghost/intern/GHOST_SystemX11.cpp
index ee312e2fc40..2a1dd890ac2 100644
--- a/intern/ghost/intern/GHOST_SystemX11.cpp
+++ b/intern/ghost/intern/GHOST_SystemX11.cpp
@@ -441,7 +441,8 @@ GHOST_IContext *GHOST_SystemX11::createOffscreenContext(GHOST_GLSettings glSetti
for (int minor = 5; minor >= 0; --minor) {
#if defined(WITH_GL_EGL)
- context = new GHOST_ContextEGL(false,
+ context = new GHOST_ContextEGL(this,
+ false,
EGLNativeWindowType(nullptr),
EGLNativeDisplayType(m_display),
profile_mask,
@@ -471,7 +472,8 @@ GHOST_IContext *GHOST_SystemX11::createOffscreenContext(GHOST_GLSettings glSetti
}
#if defined(WITH_GL_EGL)
- context = new GHOST_ContextEGL(false,
+ context = new GHOST_ContextEGL(this,
+ false,
EGLNativeWindowType(nullptr),
EGLNativeDisplayType(m_display),
profile_mask,
diff --git a/intern/ghost/intern/GHOST_WindowWayland.cpp b/intern/ghost/intern/GHOST_WindowWayland.cpp
index 1b9c29fc2c9..5be7724fd86 100644
--- a/intern/ghost/intern/GHOST_WindowWayland.cpp
+++ b/intern/ghost/intern/GHOST_WindowWayland.cpp
@@ -533,7 +533,8 @@ GHOST_Context *GHOST_WindowWayland::newDrawingContext(GHOST_TDrawingContextType
break;
case GHOST_kDrawingContextTypeOpenGL:
for (int minor = 6; minor >= 0; --minor) {
- context = new GHOST_ContextEGL(m_wantStereoVisual,
+ context = new GHOST_ContextEGL(this->m_system,
+ m_wantStereoVisual,
EGLNativeWindowType(w->egl_window),
EGLNativeDisplayType(m_system->display()),
EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT,
@@ -548,7 +549,8 @@ GHOST_Context *GHOST_WindowWayland::newDrawingContext(GHOST_TDrawingContextType
else
delete context;
}
- context = new GHOST_ContextEGL(m_wantStereoVisual,
+ context = new GHOST_ContextEGL(this->m_system,
+ m_wantStereoVisual,
EGLNativeWindowType(w->egl_window),
EGLNativeDisplayType(m_system->display()),
EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT,
diff --git a/intern/ghost/intern/GHOST_WindowX11.cpp b/intern/ghost/intern/GHOST_WindowX11.cpp
index fc006c62803..10ef57c3a0a 100644
--- a/intern/ghost/intern/GHOST_WindowX11.cpp
+++ b/intern/ghost/intern/GHOST_WindowX11.cpp
@@ -1325,6 +1325,7 @@ GHOST_Context *GHOST_WindowX11::newDrawingContext(GHOST_TDrawingContextType type
for (int minor = 5; minor >= 0; --minor) {
#ifdef WITH_GL_EGL
context = new GHOST_ContextEGL(
+ this->m_system,
m_wantStereoVisual,
EGLNativeWindowType(m_window),
EGLNativeDisplayType(m_display),
@@ -1355,7 +1356,8 @@ GHOST_Context *GHOST_WindowX11::newDrawingContext(GHOST_TDrawingContextType type
}
#ifdef WITH_GL_EGL
- context = new GHOST_ContextEGL(m_wantStereoVisual,
+ context = new GHOST_ContextEGL(this->m_system,
+ m_wantStereoVisual,
EGLNativeWindowType(m_window),
EGLNativeDisplayType(m_display),
profile_mask,