Merge lp:~gerboland/qtmir/fix-GTK-rendering into lp:qtmir

Proposed by Gerry Boland on 2015-01-12
Status: Merged
Approved by: Michał Sawicz on 2015-01-26
Approved revision: 301
Merged at revision: 310
Proposed branch: lp:~gerboland/qtmir/fix-GTK-rendering
Merge into: lp:qtmir
Diff against target: 74 lines (+1/-21)
3 files modified
debian/rules (+1/-1)
src/platforms/mirserver/miropenglcontext.cpp (+0/-16)
src/platforms/mirserver/mirserver.cpp (+0/-4)
To merge this branch: bzr merge lp:~gerboland/qtmir/fix-GTK-rendering
Reviewer Review Type Date Requested Status
Michał Sawicz 2015-01-12 Approve on 2015-01-26
Stephen M. Webb (community) Approve on 2015-01-21
PS Jenkins bot continuous-integration Approve on 2015-01-12
Review via email: mp+246201@code.launchpad.net

Commit Message

Explicitly setting GL-mode breaks GTK app rendering. Removing the hack appears to just work

Description of the Change

Explicitly setting GL-mode breaks GTK app rendering. Removing the hack appears to just work

To test, install gedit and run
gedit -- --desktop_file_hint=/usr/share/applications/gedit.desktop

To post a comment you must log in.
Stephen M. Webb (bregma) wrote :

Builds OK and Unity 8 runs OK on the desktop with this patch. I'm assuming there was a change in the underlying Qt EGL code that fixes the original problem.

review: Approve
Michał Sawicz (saviq) wrote :

Works fine.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/rules'
2--- debian/rules 2014-10-08 21:33:49 +0000
3+++ debian/rules 2015-01-12 17:59:41 +0000
4@@ -39,7 +39,7 @@
5 # See comment in CMakeLists.txt
6 mkdir -p $(DESKTOP_DIR) && dh_auto_configure -B$(DESKTOP_DIR) -- $(FLAGS) $(CURDIR) -DCMAKE_INSTALL_PREFIX=$(TMP2_DIR)/usr/ -DUSE_OPENGL_BUT_LINK_AGAINST_OPENGLES=1
7 else
8- mkdir -p $(DESKTOP_DIR) && dh_auto_configure -B$(DESKTOP_DIR) -- $(FLAGS) "-DCMAKE_CXX_FLAGS=-DQTMIR_USE_OPENGL" $(CURDIR) -DCMAKE_INSTALL_PREFIX=$(TMP2_DIR)/usr/
9+ mkdir -p $(DESKTOP_DIR) && dh_auto_configure -B$(DESKTOP_DIR) -- $(FLAGS) $(CURDIR) -DCMAKE_INSTALL_PREFIX=$(TMP2_DIR)/usr/ -DUSE_OPENGLES=1
10 endif
11
12 override_dh_auto_build:
13
14=== modified file 'src/platforms/mirserver/miropenglcontext.cpp'
15--- src/platforms/mirserver/miropenglcontext.cpp 2014-12-01 11:10:54 +0000
16+++ src/platforms/mirserver/miropenglcontext.cpp 2015-01-12 17:59:41 +0000
17@@ -74,11 +74,7 @@
18 }
19
20 QSurfaceFormat formatCopy = format;
21-#ifdef QTMIR_USE_OPENGL
22- formatCopy.setRenderableType(QSurfaceFormat::OpenGL);
23-#else
24 formatCopy.setRenderableType(QSurfaceFormat::OpenGLES);
25-#endif
26
27 m_format = q_glFormatFromConfig(eglDisplay, eglConfig, formatCopy);
28
29@@ -115,10 +111,6 @@
30
31 void MirOpenGLContext::swapBuffers(QPlatformSurface *surface)
32 {
33-#ifdef QTMIR_USE_OPENGL
34- eglBindAPI(EGL_OPENGL_API);
35-#endif
36-
37 // ultimately calls Mir's DisplayBuffer::post_update()
38 DisplayWindow *displayBuffer = static_cast<DisplayWindow*>(surface);
39 displayBuffer->swapBuffers(); //blocks for vsync
40@@ -126,10 +118,6 @@
41
42 bool MirOpenGLContext::makeCurrent(QPlatformSurface *surface)
43 {
44-#ifdef QTMIR_USE_OPENGL
45- eglBindAPI(EGL_OPENGL_API);
46-#endif
47-
48 // ultimately calls Mir's DisplayBuffer::make_current()
49 DisplayWindow *displayBuffer = static_cast<DisplayWindow*>(surface);
50 if (displayBuffer) {
51@@ -155,9 +143,5 @@
52
53 QFunctionPointer MirOpenGLContext::getProcAddress(const QByteArray &procName)
54 {
55-#ifdef QTMIR_USE_OPENGL
56- eglBindAPI(EGL_OPENGL_API);
57-#endif
58-
59 return eglGetProcAddress(procName.constData());
60 }
61
62=== modified file 'src/platforms/mirserver/mirserver.cpp'
63--- src/platforms/mirserver/mirserver.cpp 2014-12-03 12:06:30 +0000
64+++ src/platforms/mirserver/mirserver.cpp 2015-01-12 17:59:41 +0000
65@@ -90,10 +90,6 @@
66
67 override_the_gl_config([]
68 {
69-#ifdef QTMIR_USE_OPENGL
70- // Should desktop-GL be desired, need to bind that API before a context is created
71- eglBindAPI(EGL_OPENGL_API);
72-#endif
73 return std::make_shared<MirGLConfig>();
74 });
75

Subscribers

People subscribed via source and target branches