check if getPlatformExtensionName is null
authorCourtney Goeltzenleuchter <courtneygo@google.com>
Thu, 4 Apr 2019 21:35:41 +0000 (15:35 -0600)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Sun, 28 Apr 2019 08:04:26 +0000 (04:04 -0400)
nativeDisplay.getPlatformExtensionName will be null if the
platform does not support platform extensions. Check for that
prior to turning it into a string.

Components: GL, ANGLE build

Affects: dEQP-GLES2.functional.rasterization.primitives.line*

VK-GL-CTS issue: 1722

Change-Id: Ic60c3ad8387009b00bcb3ecd74d2d5cd673dade8

framework/egl/egluUtil.cpp

index 13d7eba..82aeedc 100644 (file)
@@ -250,6 +250,7 @@ EGLDisplay getDisplay (NativeDisplay& nativeDisplay)
                {
                        const vector<string> platformExts = eglu::getClientExtensions(egl);
                        usePlatformExt = de::contains(platformExts.begin(), platformExts.end(), string("EGL_EXT_platform_base")) &&
+                               nativeDisplay.getPlatformExtensionName() &&
                                de::contains(platformExts.begin(), platformExts.end(), string(nativeDisplay.getPlatformExtensionName()));
 
                }
@@ -327,6 +328,7 @@ EGLSurface createWindowSurface (NativeDisplay& nativeDisplay, NativeWindow& wind
                {
                        const vector<string> platformExts = eglu::getClientExtensions(egl);
                        usePlatformExt = de::contains(platformExts.begin(), platformExts.end(), string("EGL_EXT_platform_base")) &&
+                               nativeDisplay.getPlatformExtensionName() &&
                                de::contains(platformExts.begin(), platformExts.end(), string(nativeDisplay.getPlatformExtensionName()));
 
                }
@@ -384,6 +386,7 @@ EGLSurface createPixmapSurface (NativeDisplay& nativeDisplay, NativePixmap& pixm
                {
                        const vector<string> platformExts = eglu::getClientExtensions(egl);
                        usePlatformExt = de::contains(platformExts.begin(), platformExts.end(), string("EGL_EXT_platform_base")) &&
+                               nativeDisplay.getPlatformExtensionName() &&
                                de::contains(platformExts.begin(), platformExts.end(), string(nativeDisplay.getPlatformExtensionName()));
 
                }