Mir

Merge lp:~robertcarr/mir/fix-multiple-internal-client-surfaces-on-android into lp:~mir-team/mir/trunk

Proposed by Robert Carr
Status: Merged
Approved by: Alexandros Frantzis
Approved revision: no longer in the source branch.
Merged at revision: 1074
Proposed branch: lp:~robertcarr/mir/fix-multiple-internal-client-surfaces-on-android
Merge into: lp:~mir-team/mir/trunk
Diff against target: 48 lines (+5/-5)
2 files modified
src/server/graphics/android/internal_client.cpp (+3/-4)
src/server/graphics/android/internal_client.h (+2/-1)
To merge this branch: bzr merge lp:~robertcarr/mir/fix-multiple-internal-client-surfaces-on-android
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Alan Griffiths Approve
Daniel van Vugt Approve
Kevin DuBois (community) Approve
Review via email: mp+186151@code.launchpad.net

Commit message

Fix multiple internal client surfaces on android.

Description of the change

Fix multiple internal client surfaces on android.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

Can we have a test and/or description of the problem addressed by this?

review: Needs Information
Revision history for this message
Robert Carr (robertcarr) wrote :

The problem is when unity attempts to create multiple surfaces in process, the EGLWindow is reuused due to the previous caching logic, regardless of the surface.

Then of course eglCreateWindowSurface on the second surface fails.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

The first return is redundant and can be removed:

23 + return client_windows[surface].get();
24 }
25
26 - return client_window.get();
27 + return client_windows[surface].get();
28 }

review: Needs Fixing
Revision history for this message
Kevin DuBois (kdub) wrote :

looks ok, we still have the pre-existing condition that there's no way to return a client egl native window... but that's pre-existing

review: Approve
Revision history for this message
Robert Carr (robertcarr) wrote :

Daniels comments are fixed too so top approving.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

I think map could be unordered_map in this case. But it's fine.

review: Approve
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

OK

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/server/graphics/android/internal_client.cpp'
2--- src/server/graphics/android/internal_client.cpp 2013-08-28 03:41:48 +0000
3+++ src/server/graphics/android/internal_client.cpp 2013-09-20 13:19:55 +0000
4@@ -24,7 +24,6 @@
5 namespace mga=mir::graphics::android;
6
7 mga::InternalClient::InternalClient()
8- : client_window(0)
9 {
10 }
11
12@@ -35,12 +34,12 @@
13
14 EGLNativeWindowType mga::InternalClient::egl_native_window(std::shared_ptr<InternalSurface> const& surface)
15 {
16- if (!client_window)
17+ if (!client_windows[surface])
18 {
19 auto cache = std::make_shared<mga::InterpreterCache>();
20 auto interpreter = std::make_shared<mga::InternalClientWindow>(surface, cache);
21- client_window = std::make_shared<mga::MirNativeWindow>(interpreter);
22+ client_windows[surface] = std::make_shared<mga::MirNativeWindow>(interpreter);
23 }
24
25- return client_window.get();
26+ return client_windows[surface].get();
27 }
28
29=== modified file 'src/server/graphics/android/internal_client.h'
30--- src/server/graphics/android/internal_client.h 2013-08-28 03:41:48 +0000
31+++ src/server/graphics/android/internal_client.h 2013-09-20 13:19:55 +0000
32@@ -21,6 +21,7 @@
33
34 #include "mir/graphics/internal_client.h"
35 #include <memory>
36+#include <map>
37
38 namespace mir
39 {
40@@ -37,7 +38,7 @@
41 EGLNativeWindowType egl_native_window(std::shared_ptr<InternalSurface> const&);
42
43 private:
44- std::shared_ptr<MirNativeWindow> client_window;
45+ std::map<std::shared_ptr<InternalSurface>, std::shared_ptr<MirNativeWindow>> client_windows;
46 };
47 }
48 }

Subscribers

People subscribed via source and target branches