summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Weiwan Liu <weiwliu@nvidia.com> 2018-09-27 15:58:55 -0700
committer Yiwei Zhang <zzyiwei@google.com> 2018-11-01 17:32:57 +0000
commit34cd2275ffb14500acb8b0fd82fd1e73ddc75c12 (patch)
treea6ab1137b03f3355853ce6268c618604447130b7
parentb922a7b478e48287b0c3246ad180efad77ca5cf1 (diff)
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
-rw-r--r--opengl/libs/EGL/eglApi.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/opengl/libs/EGL/eglApi.cpp b/opengl/libs/EGL/eglApi.cpp
index 0e095ddcf5..e824238ac3 100644
--- a/opengl/libs/EGL/eglApi.cpp
+++ b/opengl/libs/EGL/eglApi.cpp
@@ -736,14 +736,14 @@ EGLSurface eglCreateWindowSurface( EGLDisplay dpy, EGLConfig config,
}
android_dataspace dataSpace = dataSpaceFromEGLColorSpace(colorSpace);
- if (dataSpace != HAL_DATASPACE_UNKNOWN) {
- int err = native_window_set_buffers_data_space(window, dataSpace);
- if (err != 0) {
- ALOGE("error setting native window pixel dataSpace: %s (%d)",
- strerror(-err), err);
- native_window_api_disconnect(window, NATIVE_WINDOW_API_EGL);
- return setError(EGL_BAD_NATIVE_WINDOW, EGL_NO_SURFACE);
- }
+ // 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);
+ if (err != 0) {
+ ALOGE("error setting native window pixel dataSpace: %s (%d)",
+ strerror(-err), err);
+ native_window_api_disconnect(window, NATIVE_WINDOW_API_EGL);
+ return setError(EGL_BAD_NATIVE_WINDOW, EGL_NO_SURFACE);
}
// the EGL spec requires that a new EGLSurface default to swap interval