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

Commit 5ada51ac authored by Jesse Hall's avatar Jesse Hall Committed by android-build-merger
Browse files

resolve merge conflicts of 528378d4 to nyc-mr1-dev-plus-aosp

am: 5d795e95

Change-Id: I2251e2839f3b6d623310a3a64f88396f3d2569ab
parents 6ba76801 5d795e95
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -115,6 +115,13 @@ typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYIMAGEKHRPROC) (EGLDisplay dpy, EGL
#define EGL_GL_TEXTURE_ZOFFSET_KHR		0x30BD	/* eglCreateImageKHR attribute */
#endif

#ifndef EGL_KHR_gl_colorspace
#define EGL_KHR_gl_colorspace 1
#define EGL_GL_COLORSPACE_KHR             0x309D
#define EGL_GL_COLORSPACE_SRGB_KHR        0x3089
#define EGL_GL_COLORSPACE_LINEAR_KHR      0x308A
#endif

#ifndef EGL_KHR_gl_renderbuffer_image
#define EGL_KHR_gl_renderbuffer_image 1
#define EGL_GL_RENDERBUFFER_KHR			0x30B9	/* eglCreateImageKHR target */
+1 −23
Original line number Diff line number Diff line
@@ -50,10 +50,6 @@

using namespace android;

// This extension has not been ratified yet, so can't be shipped.
// Implementation is incomplete and untested.
#define ENABLE_EGL_KHR_GL_COLORSPACE 0

#define ENABLE_EGL_ANDROID_GET_FRAME_TIMESTAMPS 0

// ----------------------------------------------------------------------------
@@ -95,9 +91,7 @@ extern char const * const gExtensionString =
        "EGL_KHR_image_base "                   // mandatory
        "EGL_KHR_image_pixmap "
        "EGL_KHR_lock_surface "
#if (ENABLE_EGL_KHR_GL_COLORSPACE != 0)
        "EGL_KHR_gl_colorspace "
#endif
        "EGL_KHR_gl_texture_2D_image "
        "EGL_KHR_gl_texture_3D_image "
        "EGL_KHR_gl_texture_cubemap_image "
@@ -436,12 +430,6 @@ EGLBoolean eglGetConfigAttrib(EGLDisplay dpy, EGLConfig config,
// surfaces
// ----------------------------------------------------------------------------

// The EGL_KHR_gl_colorspace spec hasn't been ratified yet, so these haven't
// been added to the Khronos egl.h.
#define EGL_GL_COLORSPACE_KHR           EGL_VG_COLORSPACE
#define EGL_GL_COLORSPACE_SRGB_KHR      EGL_VG_COLORSPACE_sRGB
#define EGL_GL_COLORSPACE_LINEAR_KHR    EGL_VG_COLORSPACE_LINEAR

// Turn linear formats into corresponding sRGB formats when colorspace is
// EGL_GL_COLORSPACE_SRGB_KHR, or turn sRGB formats into corresponding linear
// formats when colorspace is EGL_GL_COLORSPACE_LINEAR_KHR. In any cases where
@@ -508,17 +496,7 @@ EGLSurface eglCreateWindowSurface( EGLDisplay dpy, EGLConfig config,
        if (attrib_list && dp->haveExtension("EGL_KHR_gl_colorspace")) {
            for (const EGLint* attr = attrib_list; *attr != EGL_NONE; attr += 2) {
                if (*attr == EGL_GL_COLORSPACE_KHR) {
                    if (ENABLE_EGL_KHR_GL_COLORSPACE) {
                    dataSpace = modifyBufferDataspace(dataSpace, *(attr+1));
                    } else {
                        // Normally we'd pass through unhandled attributes to
                        // the driver. But in case the driver implements this
                        // extension but we're disabling it, we want to prevent
                        // it getting through -- support will be broken without
                        // our help.
                        ALOGE("sRGB window surfaces not supported");
                        return setError(EGL_BAD_ATTRIBUTE, EGL_NO_SURFACE);
                    }
                }
            }
        }