coregl_fastpath: avoid "Invalid context attribute" from efl_webview_app 99/95699/5
authorxing.huang <xing.huang@samsung.com>
Fri, 4 Nov 2016 08:43:53 +0000 (16:43 +0800)
committerGwan-gyeong Mun <kk.moon@samsung.com>
Mon, 7 Nov 2016 05:31:18 +0000 (21:31 -0800)
- Add support of EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_EXT
  eglCreateContex supports EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_EXT
  and EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_KHR

Signed-off-by: xing.huang <xing.huang@samsung.com>
Change-Id: I8ed870fb03add25f59077cc46405388f95483229

include_KHR/EGL/eglext.h
src/modules/fastpath/coregl_fastpath_egl.c

index 0c33cda..8922b63 100644 (file)
@@ -60,6 +60,7 @@ extern "C" {
 #define EGL_KHR_cl_event2 1
 typedef void *EGLSyncKHR;
 typedef intptr_t EGLAttribKHR;
+typedef intptr_t EGLAttrib;
 typedef EGLSyncKHR (EGLAPIENTRYP PFNEGLCREATESYNC64KHRPROC) (EGLDisplay dpy, EGLenum type, const EGLAttribKHR *attrib_list);
 #ifdef EGL_EGLEXT_PROTOTYPES
 EGLAPI EGLSyncKHR EGLAPIENTRY eglCreateSync64KHR (EGLDisplay dpy, EGLenum type, const EGLAttribKHR *attrib_list);
index ed2dd3f..1ce0bd0 100644 (file)
@@ -9,6 +9,7 @@
 #include <unistd.h>
 #include <signal.h>
 #include <assert.h>
+#include "../../../include_KHR/EGL/eglext.h"
 
 #ifdef COREGL_FASTPATH_TRACE_CONTEXT_INFO
 
@@ -238,7 +239,8 @@ typedef struct {
        EGLint                        context_minor_version;
        EGLint                        context_flags;
        EGLint                        context_opengl_profile_mask;
-       EGLint                        opengl_reset_notification_strategy;
+       EGLint                        opengl_reset_notification_strategy_khr;
+       EGLint                        opengl_reset_notification_strategy_ext;
 } EGL_packed_attrib_list;
 
 typedef struct {
@@ -270,7 +272,8 @@ _pack_egl_context_option(EGL_packed_option *pack_data, EGLDisplay dpy,
        pack_data->attrib_list.context_minor_version = 0;
        pack_data->attrib_list.context_flags = EGL_DONT_CARE;
        pack_data->attrib_list.context_opengl_profile_mask = EGL_DONT_CARE;
-       pack_data->attrib_list.opengl_reset_notification_strategy = EGL_DONT_CARE;
+       pack_data->attrib_list.opengl_reset_notification_strategy_khr = EGL_DONT_CARE;
+       pack_data->attrib_list.opengl_reset_notification_strategy_ext = EGL_DONT_CARE;
 
        // Apply specified attributes
        EGLint *attrib = (EGLint *)attrib_list;
@@ -289,7 +292,10 @@ _pack_egl_context_option(EGL_packed_option *pack_data, EGLDisplay dpy,
                        pack_data->attrib_list.context_opengl_profile_mask = attrib[1];
                        break;
                case EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_KHR:
-                       pack_data->attrib_list.opengl_reset_notification_strategy = attrib[1];
+                       pack_data->attrib_list.opengl_reset_notification_strategy_khr = attrib[1];
+                       break;
+               case EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_EXT:
+                       pack_data->attrib_list.opengl_reset_notification_strategy_ext = attrib[1];
                        break;
                default:
                        COREGL_WRN("\E[40;31;1mInvalid context attribute.\E[0m\n");
@@ -353,13 +359,22 @@ _unpack_egl_context_option(EGL_packed_option *pack_data, EGLDisplay *dpy,
                                pack_data->attrib_list.context_opengl_profile_mask;
                        attrib_list_index += 2;
                }
-               if (pack_data->attrib_list.opengl_reset_notification_strategy !=
+               if (pack_data->attrib_list.opengl_reset_notification_strategy_khr !=
                                EGL_DONT_CARE) {
                        AST(attrib_list_index + 2 < attrib_list_size);
                        attrib_list[attrib_list_index] =
                                EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_KHR;
                        attrib_list[attrib_list_index + 1] =
-                               pack_data->attrib_list.opengl_reset_notification_strategy;
+                               pack_data->attrib_list.opengl_reset_notification_strategy_khr;
+                       attrib_list_index += 2;
+               }
+               if (pack_data->attrib_list.opengl_reset_notification_strategy_ext !=
+                               EGL_DONT_CARE) {
+                       AST(attrib_list_index + 2 < attrib_list_size);
+                       attrib_list[attrib_list_index] =
+                               EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_EXT;
+                       attrib_list[attrib_list_index + 1] =
+                               pack_data->attrib_list.opengl_reset_notification_strategy_ext;
                        attrib_list_index += 2;
                }