Merge ~peat-new/mir-android-platform:client-color-format-hack into mir-android-platform:master

Proposed by Ratchanan Srirattanamet
Status: Merged
Merged at revision: c210c37f9f94385524a3d4a2eadda91f098b63b0
Proposed branch: ~peat-new/mir-android-platform:client-color-format-hack
Merge into: mir-android-platform:master
Diff against target: 26 lines (+14/-1)
1 file modified
src/platforms/android/client/egl_native_surface_interpreter.cpp (+14/-1)
Reviewer Review Type Date Requested Status
Andreas Pokorny Approve
Review via email: mp+324666@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Andreas Pokorny (andreas-pokorny) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/src/platforms/android/client/egl_native_surface_interpreter.cpp b/src/platforms/android/client/egl_native_surface_interpreter.cpp
2index 6c46c4c..4ad3714 100644
3--- a/src/platforms/android/client/egl_native_surface_interpreter.cpp
4+++ b/src/platforms/android/client/egl_native_surface_interpreter.cpp
5@@ -59,7 +59,20 @@ void mcla::EGLNativeSurfaceInterpreter::driver_returns_buffer(ANativeWindowBuffe
6
7 void mcla::EGLNativeSurfaceInterpreter::dispatch_driver_request_format(int format)
8 {
9- driver_pixel_format = format;
10+ /*
11+ * Here, we use the hack to "lock" the format to the first one set by
12+ * Android's libEGL at the EGL surface's creation time, which is the one
13+ * chosen at the Mir window creation time, the one Mir server always
14+ * acknowledge and acted upon. Some Android EGL implementation change this
15+ * later, resulting in incompatibility between Mir client and server. By
16+ * locking the format this way, the client will still render in the old
17+ * format (rendering code hornor the setting here).
18+ * TODO: find a way to communicate the format change back to the server. I
19+ * believe there must be a good reason to change the rendering format
20+ * (maybe for performance reason?).
21+ */
22+ if (driver_pixel_format == -1 || driver_pixel_format == 0 || format == 0)
23+ driver_pixel_format = format;
24 }
25
26 int mcla::EGLNativeSurfaceInterpreter::driver_requests_info(int key) const

Subscribers

People subscribed via source and target branches