summaryrefslogtreecommitdiff
path: root/android
diff options
context:
space:
mode:
authorMichael Weghorn <m.weghorn@posteo.de>2023-11-09 08:54:08 +0100
committerMichael Weghorn <m.weghorn@posteo.de>2023-11-09 13:16:16 +0100
commitd9a43fa5f94839d79cbd8524ba5c0b1865e6ad52 (patch)
tree08121e66f8bcfc75074946c35013248f306436a1 /android
parenta21e7a76d745750dcea14bc6311e4f1766c3fa45 (diff)
tdf#158125 android: Don't insist on RGB 565 EGL config
As the `eglChooseConfig` doc [1] says: > eglChooseConfig returns in configs a list of all EGL frame buffer > configurations that match the attributes specified > [...] > Attributes are matched in an attribute-specific manner. Some of the > attributes, such as EGL_LEVEL, must match the specified value exactly. > Others, such as, EGL_RED_SIZE must meet or exceed the specified minimum > values. The config/attribute list used for Android Viewer specifies EGL_RED_SIZE=5, EGL_GREEN_SIZE=6, and EGL_BLUE_SIZE=5 and so far, only configs using exactly those bit sizes were accepted, causing 1 of the 11 devices used in automated tests in Google Play CI crashing with this stack trace: Exception org.mozilla.gecko.gfx.GLController$GLControllerException: No suitable EGL configuration found at org.mozilla.gecko.gfx.GLController.chooseConfig (GLController.java:219) at org.mozilla.gecko.gfx.GLController.initEGL (GLController.java:172) at org.mozilla.gecko.gfx.GLController.initEGLContext (GLController.java:176) at org.mozilla.gecko.gfx.GLController.initGLContext (GLController.java:57) at org.mozilla.gecko.gfx.RenderControllerThread.doSurfaceCreated (RenderControllerThread.java:132) at org.mozilla.gecko.gfx.RenderControllerThread.execute (RenderControllerThread.java:52) at org.mozilla.gecko.gfx.RenderControllerThread.run (RenderControllerThread.java:30) Since only configs fulfilling the minimium specification have been returned, I don't see a reason to insist on having one that uses exactly the specified amount of bits for the individual color components. I also didn't see any rendering issues in a quick test (also using the colorful Calc sheet attachment 188343 from tdf#156182) forcing the use of a configuration using EGL_RED_SIZE=8, EGL_GREEN_SIZE=8, and EGL_BLUE_SIZE=8 with an x86_64 AVD and on a Fairphone 3+ (arm64) using this temporary local change: diff --git a/android/source/src/java/org/mozilla/gecko/gfx/GLController.java b/android/source/src/java/org/mozilla/gecko/gfx/GLController.java index 45600e9f1e7c..9e7f348e9e72 100644 --- a/android/source/src/java/org/mozilla/gecko/gfx/GLController.java +++ b/android/source/src/java/org/mozilla/gecko/gfx/GLController.java @@ -171,7 +171,7 @@ public class GLController { mEGL.eglGetConfigAttrib(mEGLDisplay, config, EGL10.EGL_RED_SIZE, red); mEGL.eglGetConfigAttrib(mEGLDisplay, config, EGL10.EGL_GREEN_SIZE, green); mEGL.eglGetConfigAttrib(mEGLDisplay, config, EGL10.EGL_BLUE_SIZE, blue); - if (red[0] == 5 && green[0] == 6 && blue[0] == 5) { + if (red[0] == 8 && green[0] == 8 && blue[0] == 8) { return config; } } Therefore, fall back to using another config that fulfils the specification. (Leave the previously required config as preferred one for now, maybe it still has advantages, e.g. might be more efficient due to not wasting extra bits for the color components that are not needed for the rendering in LibreOffice Viewer. (?)) [1] https://registry.khronos.org/EGL/sdk/docs/man/html/eglChooseConfig.xhtml Change-Id: I953d292248004bc6f7e9384ceef78c8a88c21e9e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159204 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Diffstat (limited to 'android')
-rw-r--r--android/source/src/java/org/mozilla/gecko/gfx/GLController.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/android/source/src/java/org/mozilla/gecko/gfx/GLController.java b/android/source/src/java/org/mozilla/gecko/gfx/GLController.java
index 45600e9f1e7c..6a43dd6a87db 100644
--- a/android/source/src/java/org/mozilla/gecko/gfx/GLController.java
+++ b/android/source/src/java/org/mozilla/gecko/gfx/GLController.java
@@ -176,7 +176,8 @@ public class GLController {
}
}
- throw new GLControllerException("No suitable EGL configuration found");
+ // if there's no 565 RGB configuration, select another one that fulfils the specification
+ return configs[0];
}
private void createEGLSurface() {