diff options
author | TreeHugger Robot <treehugger-gerrit@google.com> | 2017-08-02 18:35:05 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2017-08-02 18:35:05 +0000 |
commit | d5e8f47effe8f7d3cc64ab1e3ae3fea05b9400b5 (patch) | |
tree | 1a2b4100c33bfcd8159960b21b739a103660898c | |
parent | 37d8c19a193d41b535e91a8ea1637938f5a10faf (diff) | |
parent | 2cd68e6d90ed5f62c84555d6a6e3655f488919a7 (diff) | |
download | native-d5e8f47effe8f7d3cc64ab1e3ae3fea05b9400b5.tar.gz |
Merge "EGL: Add EGL_GL_scrgb extension" into oc-dr1-dev
-rw-r--r-- | opengl/include/EGL/eglext.h | 5 | ||||
-rw-r--r-- | opengl/libs/EGL/eglApi.cpp | 6 |
2 files changed, 11 insertions, 0 deletions
diff --git a/opengl/include/EGL/eglext.h b/opengl/include/EGL/eglext.h index 7de8c62e2f..bb28600da3 100644 --- a/opengl/include/EGL/eglext.h +++ b/opengl/include/EGL/eglext.h @@ -682,6 +682,11 @@ typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETFRAMETIMESTAMPSUPPORTEDANDROID) (EGLDi #define EGL_GL_COLORSPACE_DISPLAY_P3_LINEAR_EXT 0x3362 #endif /* EGL_EXT_gl_colorspace_display_p3_linear */ +#ifndef EGL_EXT_gl_colorspace_scrgb +#define EGL_EXT_gl_colorspace_scrgb 1 +#define EGL_GL_COLORSPACE_SCRGB_EXT 0x3351 +#endif /* EGL_EXT_gl_colorspace_scrgb */ + #ifndef EGL_EXT_gl_colorspace_scrgb_linear #define EGL_EXT_gl_colorspace_scrgb_linear 1 #define EGL_GL_COLORSPACE_SCRGB_LINEAR_EXT 0x3350 diff --git a/opengl/libs/EGL/eglApi.cpp b/opengl/libs/EGL/eglApi.cpp index c5feb89848..2fa36faf53 100644 --- a/opengl/libs/EGL/eglApi.cpp +++ b/opengl/libs/EGL/eglApi.cpp @@ -87,6 +87,7 @@ char const * const gBuiltinExtensionString = "EGL_ANDROID_get_native_client_buffer " "EGL_ANDROID_front_buffer_auto_refresh " "EGL_ANDROID_get_frame_timestamps " + "EGL_EXT_gl_colorspace_scrgb " "EGL_EXT_gl_colorspace_scrgb_linear " "EGL_EXT_gl_colorspace_display_p3_linear " "EGL_EXT_gl_colorspace_display_p3 " @@ -467,6 +468,8 @@ static android_dataspace modifyBufferDataspace(android_dataspace dataSpace, return HAL_DATASPACE_DISPLAY_P3; } else if (colorspace == EGL_GL_COLORSPACE_DISPLAY_P3_LINEAR_EXT) { return HAL_DATASPACE_DISPLAY_P3_LINEAR; + } else if (colorspace == EGL_GL_COLORSPACE_SCRGB_EXT) { + return HAL_DATASPACE_V0_SCRGB; } else if (colorspace == EGL_GL_COLORSPACE_SCRGB_LINEAR_EXT) { return HAL_DATASPACE_V0_SCRGB_LINEAR; } @@ -545,6 +548,9 @@ static EGLBoolean getColorSpaceAttribute(egl_display_ptr dp, const EGLint* attri } else if (colorSpace == EGL_EXT_gl_colorspace_bt2020_pq && dp->haveExtension("EGL_EXT_gl_colorspace_bt2020_pq")) { found = true; + } else if (colorSpace == EGL_GL_COLORSPACE_SCRGB_EXT && + dp->haveExtension("EGL_EXT_gl_colorspace_scrgb")) { + found = true; } else if (colorSpace == EGL_GL_COLORSPACE_SCRGB_LINEAR_EXT && dp->haveExtension("EGL_EXT_gl_colorspace_scrgb_linear")) { found = true; |