Merge lp:~mterry/oxide/mirserver into lp:~oxide-developers/oxide/oxide.trunk

Proposed by Michael Terry
Status: Merged
Approved by: Chris Coulson
Approved revision: 1027
Merged at revision: 1025
Proposed branch: lp:~mterry/oxide/mirserver
Merge into: lp:~oxide-developers/oxide/oxide.trunk
Diff against target: 25 lines (+2/-2)
2 files modified
qt/core/browser/oxide_qt_browser_startup.cc (+1/-1)
qt/core/common/oxide_qt_screen_utils.cc (+1/-1)
To merge this branch: bzr merge lp:~mterry/oxide/mirserver
Reviewer Review Type Date Requested Status
Chris Coulson Approve
Review via email: mp+255128@code.launchpad.net

Commit message

Recognize "mirserver" as a valid ubuntu platform type, and use the GLES2 implementation in that case.

Description of the change

Recognize "mirserver" as a valid ubuntu platform type, and use the GLES2 implementation in that case.

Inside unity8, there is this bit of code:

if (qgetenv("QT_QPA_PLATFORM") == "ubuntumirclient") {
    setenv("QT_QPA_PLATFORM", "mirserver", 1);
}

Now, I'm not sure *why* that's done, but it seems to be expected by qtmir, which looks for that exact string.

But when the Ubuntu Touch welcome wizard (which is running in the unity8 process) uses oxide to render some NOKIA terms and conditions, oxide doesn't recognize the platform (and crashes because we don't ship libosmesa.so).

Now maybe the fix is to change unity8 and qtmir to not drop the "ubuntu" prefix (presumably they're more interested in the client->server string change). But since Gerry, who is familiar with qtmir innards), happens to be offline right now, I'm just going to file this other fix. Which doesn't preclude changing unity8/qtmir down the line.

I have not actually tested this fix! I'm having a hard time getting the terms and conditions screen at all in the wizard right now, because I'm missing the HERE bits on my phone.

To post a comment you must log in.
Revision history for this message
Chris Coulson (chrisccoulson) wrote :

I think this looks ok. What version of Oxide crashes when the platform isn't recognized? That should be fixed by http://bazaar.launchpad.net/~oxide-developers/oxide/oxide.trunk/revision/944 (the expected behaviour is that it disables GPU access entirely and falls back to software compositing)

review: Approve
Revision history for this message
Michael Terry (mterry) wrote :

I'm seeing the crash on current vivid, oxide-qt version 1.5.5-0ubuntu1.

Just realized how to test with the HERE stuff, will confirm this fix actually does what it says and then will top-approve if so, howabout?

Revision history for this message
Michael Terry (mterry) wrote :

(I also created an actual bug for this and linked this branch)

Revision history for this message
Gerry Boland (gerboland) wrote :

+ } else if (platform.startsWith("ubuntu") || platform == QLatinString("mirserver")) {
 void* handle = pni->nativeResourceForContext("eglcontext", context);

Note, the mirserver QPA does not have this "eglcontext" native resource exported. That may cause issues

Revision history for this message
Chris Coulson (chrisccoulson) wrote :

> + } else if (platform.startsWith("ubuntu") || platform ==
> QLatinString("mirserver")) {
> void* handle = pni->nativeResourceForContext("eglcontext", context);
>
> Note, the mirserver QPA does not have this "eglcontext" native resource
> exported. That may cause issues

In that case, it would be worth just dropping the change in qt/core/gpu/oxide_qt_gl_context_dependent.cc, as it won't work anyway. This is only used to determine the application provided share group (if there is one), and Oxide trunk no longer needs a share group if the platform is EGL and supports EGL_KHR_gl_texture_2D_image. In the worst case, it should fall back gracefully to software compositing mode anyway.

lp:~mterry/oxide/mirserver updated
1026. By Michael Terry

Simplify use of QLatinString to only use it if surrounding code does

1027. By Michael Terry

Drop change to context-dependent.cc file

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'qt/core/browser/oxide_qt_browser_startup.cc'
2--- qt/core/browser/oxide_qt_browser_startup.cc 2015-03-24 17:06:40 +0000
3+++ qt/core/browser/oxide_qt_browser_startup.cc 2015-04-03 18:08:31 +0000
4@@ -153,7 +153,7 @@
5 if (QGuiApplication::platformNativeInterface()) {
6 if (platform == QLatin1String("xcb")) {
7 gl_impl = gfx::kGLImplementationDesktopGL;
8- } else if (platform.startsWith("ubuntu")) {
9+ } else if (platform.startsWith("ubuntu") || platform == QLatin1String("mirserver")) {
10 gl_impl = gfx::kGLImplementationEGLGLES2;
11 } else {
12 LOG(WARNING)
13
14=== modified file 'qt/core/common/oxide_qt_screen_utils.cc'
15--- qt/core/common/oxide_qt_screen_utils.cc 2015-01-24 15:38:34 +0000
16+++ qt/core/common/oxide_qt_screen_utils.cc 2015-04-03 18:08:31 +0000
17@@ -84,7 +84,7 @@
18 }
19
20 QString platform = QGuiApplication::platformName();
21- if (platform.startsWith("ubuntu")) {
22+ if (platform.startsWith("ubuntu") || platform == "mirserver") {
23 QByteArray grid_unit_px(qgetenv("GRID_UNIT_PX"));
24 bool ok;
25 float scale = grid_unit_px.toFloat(&ok);

Subscribers

People subscribed via source and target branches