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

Commit 34cd2275 authored by Weiwan Liu's avatar Weiwan Liu Committed by Yiwei Zhang
Browse files

EGL: always set data space even for UNKNOWN

Set dataSpace even if it could be HAL_DATASPACE_UNKNOWN.
HAL_DATASPACE_UNKNOWN is the initial value, but it may
have been set to other value.

Test: NV internal regression tests including dEQP
Test: EGL_test --gtest_filter=EGLTest.EGLCreateWindowTwoColorspaces

Change-Id: Ifb64077dc0c39ebd1f7ec2641590b218bf6070d7
Merged-In: Ifb64077dc0c39ebd1f7ec2641590b218bf6070d7
parent b922a7b4
Loading
Loading
Loading
Loading
+8 −8
Original line number Original line Diff line number Diff line
@@ -736,7 +736,8 @@ EGLSurface eglCreateWindowSurface( EGLDisplay dpy, EGLConfig config,
        }
        }


        android_dataspace dataSpace = dataSpaceFromEGLColorSpace(colorSpace);
        android_dataspace dataSpace = dataSpaceFromEGLColorSpace(colorSpace);
        if (dataSpace != HAL_DATASPACE_UNKNOWN) {
        // Set dataSpace even if it could be HAL_DATASPACE_UNKNOWN. HAL_DATASPACE_UNKNOWN
        // is the default value, but it may have changed at this point.
        int err = native_window_set_buffers_data_space(window, dataSpace);
        int err = native_window_set_buffers_data_space(window, dataSpace);
        if (err != 0) {
        if (err != 0) {
            ALOGE("error setting native window pixel dataSpace: %s (%d)",
            ALOGE("error setting native window pixel dataSpace: %s (%d)",
@@ -744,7 +745,6 @@ EGLSurface eglCreateWindowSurface( EGLDisplay dpy, EGLConfig config,
            native_window_api_disconnect(window, NATIVE_WINDOW_API_EGL);
            native_window_api_disconnect(window, NATIVE_WINDOW_API_EGL);
            return setError(EGL_BAD_NATIVE_WINDOW, EGL_NO_SURFACE);
            return setError(EGL_BAD_NATIVE_WINDOW, EGL_NO_SURFACE);
        }
        }
        }


        // the EGL spec requires that a new EGLSurface default to swap interval
        // the EGL spec requires that a new EGLSurface default to swap interval
        // 1, so explicitly set that on the window here.
        // 1, so explicitly set that on the window here.