summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Alec Mouri <alecmouri@google.com> 2024-04-08 18:01:26 +0000
committer Alec Mouri <alecmouri@google.com> 2024-04-08 22:28:24 +0000
commit8c5ba3f1721daceb712f0d7acde4db1f4c4b1554 (patch)
treec3ba9ace0b12a24a8d4f94e0bb71ee1b8727a293
parentb2818816bb0ca9dbc83bbc6dafa0194637901fd6 (diff)
Only pick fp16 egl config when using color mode hdr.
Devices that support fp16 should only choose an fp16 egl config when color mode HDR is requested. Otherwise this causes the underlying EGLSurface to be configured with fp16 buffers, which breaks some odd API paths that apps use, like HardwareRenderer -> ImageReader. Bug: 332834976 Test: Youtube music on watch devices. Change-Id: I5db837342eeeb69ed08d1f86d98c4945497fffde
-rw-r--r--libs/hwui/renderthread/EglManager.cpp19
1 files changed, 11 insertions, 8 deletions
diff --git a/libs/hwui/renderthread/EglManager.cpp b/libs/hwui/renderthread/EglManager.cpp
index 2904dfe76f40..708b0113e13e 100644
--- a/libs/hwui/renderthread/EglManager.cpp
+++ b/libs/hwui/renderthread/EglManager.cpp
@@ -442,14 +442,17 @@ Result<EGLSurface, EGLint> EglManager::createSurface(EGLNativeWindowType window,
}
// TODO: maybe we want to get rid of the WCG check if overlay properties just works?
- const bool canUseFp16 = DeviceInfo::get()->isSupportFp16ForHdr() ||
- DeviceInfo::get()->getWideColorType() == kRGBA_F16_SkColorType;
-
- if (canUseFp16) {
- if (mEglConfigF16 == EGL_NO_CONFIG_KHR) {
- colorMode = ColorMode::Default;
- } else {
- config = mEglConfigF16;
+ bool canUseFp16 = DeviceInfo::get()->isSupportFp16ForHdr() ||
+ DeviceInfo::get()->getWideColorType() == kRGBA_F16_SkColorType;
+
+ if (colorMode == ColorMode::Hdr) {
+ if (canUseFp16 && !DeviceInfo::get()->isSupportRgba10101010ForHdr()) {
+ if (mEglConfigF16 == EGL_NO_CONFIG_KHR) {
+ // If the driver doesn't support fp16 then fallback to 8-bit
+ canUseFp16 = false;
+ } else {
+ config = mEglConfigF16;
+ }
}
}