Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 751cbe44 authored by Alec Mouri's avatar Alec Mouri Committed by Android (Google) Code Review
Browse files

Merge "Only pick fp16 egl config when using color mode hdr." into main

parents d8cd6977 8c5ba3f1
Loading
Loading
Loading
Loading
+11 −8
Original line number Diff line number Diff line
@@ -442,16 +442,19 @@ 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() ||
        bool canUseFp16 = DeviceInfo::get()->isSupportFp16ForHdr() ||
                DeviceInfo::get()->getWideColorType() == kRGBA_F16_SkColorType;

        if (canUseFp16) {
        if (colorMode == ColorMode::Hdr) {
            if (canUseFp16 && !DeviceInfo::get()->isSupportRgba10101010ForHdr()) {
                if (mEglConfigF16 == EGL_NO_CONFIG_KHR) {
                colorMode = ColorMode::Default;
                    // If the driver doesn't support fp16 then fallback to 8-bit
                    canUseFp16 = false;
                } else {
                    config = mEglConfigF16;
                }
            }
        }

        if (EglExtensions.glColorSpace) {
            attribs[0] = EGL_GL_COLORSPACE_KHR;