summaryrefslogtreecommitdiffstats
path: root/src/core/surface_factory_qt.cpp
diff options
context:
space:
mode:
authorAndras Becsi <andras.becsi@digia.com>2014-05-14 17:53:59 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-05-15 17:37:10 +0200
commitc0bc770eb1dfcc6689df44438cd396721d5129fc (patch)
treef07b2a56863a40c0cc7916910b7dd5977ad5e118 /src/core/surface_factory_qt.cpp
parentc45fc409c14f2e4ccb1aacd0b8af36dbba399666 (diff)
Enable GLContextHelper and register a SurfaceFactoryQt on eAndroid
This is needed to run on certain hardware that needs the shared EGL contexts to be created on the same thread. To prevent a deadlock on eAndroid only use a blocking connection if we are not on the main thread where the singleton was created, since there is a call to this from gpu_info_collector_android before the GPU thread is launched. Change-Id: I6887ad1218b8426097f454741dc5a79ee94f9d62 Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
Diffstat (limited to 'src/core/surface_factory_qt.cpp')
-rw-r--r--src/core/surface_factory_qt.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/core/surface_factory_qt.cpp b/src/core/surface_factory_qt.cpp
index 3b4dcfc8b..9db9a9d2c 100644
--- a/src/core/surface_factory_qt.cpp
+++ b/src/core/surface_factory_qt.cpp
@@ -50,7 +50,7 @@
#include <QGuiApplication>
#include <qpa/qplatformnativeinterface.h>
-#if defined(USE_OZONE)
+#if defined(USE_OZONE) || defined(OS_ANDROID)
#include <EGL/egl.h>
#ifndef QT_LIBDIR_EGL
@@ -62,7 +62,12 @@
bool SurfaceFactoryQt::LoadEGLGLES2Bindings(AddGLLibraryCallback add_gl_library, SetGLGetProcAddressProcCallback set_gl_get_proc_address)
{
-
+#if defined(OS_ANDROID)
+ // This is done in gl_implementation_android.cc for now. We might need to switch if we
+ // start supporting the emulator platform but that would be a more intrusive change.
+ Q_UNREACHABLE();
+ return false;
+#else
base::FilePath libEGLPath = toFilePath(QT_LIBDIR_EGL);
libEGLPath = libEGLPath.Append("libEGL.so");
base::NativeLibrary eglLibrary = gfx::LoadLibrary(libEGLPath);
@@ -91,6 +96,7 @@ bool SurfaceFactoryQt::LoadEGLGLES2Bindings(AddGLLibraryCallback add_gl_library,
gfx::AddGLNativeLibrary(eglLibrary);
gfx::AddGLNativeLibrary(gles2Library);
return true;
+#endif
}
intptr_t SurfaceFactoryQt::GetNativeDisplay()