summaryrefslogtreecommitdiffstats
path: root/gfx/angle/src/libGLESv2/entry_points_egl_ext.cpp
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@gmail.com>2018-07-11 18:11:13 +0200
committerwolfbeast <mcwerewolf@gmail.com>2018-07-11 18:11:13 +0200
commit4f2ecd53a9daaf88bb7d075745eefb6e2e4741e0 (patch)
treef000dd831240707a03b8c806db292c2a15cde3ce /gfx/angle/src/libGLESv2/entry_points_egl_ext.cpp
parent3b7ffb477eec078c7036c92c6a51bb5de6de4f28 (diff)
downloadUXP-4f2ecd53a9daaf88bb7d075745eefb6e2e4741e0.tar
UXP-4f2ecd53a9daaf88bb7d075745eefb6e2e4741e0.tar.gz
UXP-4f2ecd53a9daaf88bb7d075745eefb6e2e4741e0.tar.lz
UXP-4f2ecd53a9daaf88bb7d075745eefb6e2e4741e0.tar.xz
UXP-4f2ecd53a9daaf88bb7d075745eefb6e2e4741e0.zip
Roll back to ANGLE/2845
Diffstat (limited to 'gfx/angle/src/libGLESv2/entry_points_egl_ext.cpp')
-rwxr-xr-xgfx/angle/src/libGLESv2/entry_points_egl_ext.cpp260
1 files changed, 95 insertions, 165 deletions
diff --git a/gfx/angle/src/libGLESv2/entry_points_egl_ext.cpp b/gfx/angle/src/libGLESv2/entry_points_egl_ext.cpp
index b18a10d92..3b7a9c870 100755
--- a/gfx/angle/src/libGLESv2/entry_points_egl_ext.cpp
+++ b/gfx/angle/src/libGLESv2/entry_points_egl_ext.cpp
@@ -14,7 +14,6 @@
#include "libANGLE/Device.h"
#include "libANGLE/Surface.h"
#include "libANGLE/Stream.h"
-#include "libANGLE/Thread.h"
#include "libANGLE/validationEGL.h"
#include "common/debug.h"
@@ -27,7 +26,6 @@ EGLBoolean EGLAPIENTRY QuerySurfacePointerANGLE(EGLDisplay dpy, EGLSurface surfa
{
EVENT("(EGLDisplay dpy = 0x%0.8p, EGLSurface surface = 0x%0.8p, EGLint attribute = %d, void **value = 0x%0.8p)",
dpy, surface, attribute, value);
- Thread *thread = GetCurrentThread();
Display *display = static_cast<Display*>(dpy);
Surface *eglSurface = static_cast<Surface*>(surface);
@@ -35,19 +33,19 @@ EGLBoolean EGLAPIENTRY QuerySurfacePointerANGLE(EGLDisplay dpy, EGLSurface surfa
Error error = ValidateSurface(display, eglSurface);
if (error.isError())
{
- thread->setError(error);
+ SetGlobalError(error);
return EGL_FALSE;
}
if (!display->getExtensions().querySurfacePointer)
{
- thread->setError(Error(EGL_SUCCESS));
+ SetGlobalError(Error(EGL_SUCCESS));
return EGL_FALSE;
}
if (surface == EGL_NO_SURFACE)
{
- thread->setError(Error(EGL_BAD_SURFACE));
+ SetGlobalError(Error(EGL_BAD_SURFACE));
return EGL_FALSE;
}
@@ -57,24 +55,24 @@ EGLBoolean EGLAPIENTRY QuerySurfacePointerANGLE(EGLDisplay dpy, EGLSurface surfa
case EGL_D3D_TEXTURE_2D_SHARE_HANDLE_ANGLE:
if (!display->getExtensions().surfaceD3DTexture2DShareHandle)
{
- thread->setError(Error(EGL_BAD_ATTRIBUTE));
+ SetGlobalError(Error(EGL_BAD_ATTRIBUTE));
return EGL_FALSE;
}
break;
case EGL_DXGI_KEYED_MUTEX_ANGLE:
if (!display->getExtensions().keyedMutex)
{
- thread->setError(Error(EGL_BAD_ATTRIBUTE));
+ SetGlobalError(Error(EGL_BAD_ATTRIBUTE));
return EGL_FALSE;
}
break;
default:
- thread->setError(Error(EGL_BAD_ATTRIBUTE));
- return EGL_FALSE;
+ SetGlobalError(Error(EGL_BAD_ATTRIBUTE));
+ return EGL_FALSE;
}
error = eglSurface->querySurfacePointerANGLE(attribute, value);
- thread->setError(error);
+ SetGlobalError(error);
return (error.isError() ? EGL_FALSE : EGL_TRUE);
}
@@ -83,11 +81,10 @@ EGLBoolean EGLAPIENTRY QuerySurfacePointerANGLE(EGLDisplay dpy, EGLSurface surfa
EGLBoolean EGLAPIENTRY PostSubBufferNV(EGLDisplay dpy, EGLSurface surface, EGLint x, EGLint y, EGLint width, EGLint height)
{
EVENT("(EGLDisplay dpy = 0x%0.8p, EGLSurface surface = 0x%0.8p, EGLint x = %d, EGLint y = %d, EGLint width = %d, EGLint height = %d)", dpy, surface, x, y, width, height);
- Thread *thread = GetCurrentThread();
if (x < 0 || y < 0 || width < 0 || height < 0)
{
- thread->setError(Error(EGL_BAD_PARAMETER));
+ SetGlobalError(Error(EGL_BAD_PARAMETER));
return EGL_FALSE;
}
@@ -97,37 +94,37 @@ EGLBoolean EGLAPIENTRY PostSubBufferNV(EGLDisplay dpy, EGLSurface surface, EGLin
Error error = ValidateSurface(display, eglSurface);
if (error.isError())
{
- thread->setError(error);
+ SetGlobalError(error);
return EGL_FALSE;
}
if (display->testDeviceLost())
{
- thread->setError(Error(EGL_CONTEXT_LOST));
+ SetGlobalError(Error(EGL_CONTEXT_LOST));
return EGL_FALSE;
}
if (surface == EGL_NO_SURFACE)
{
- thread->setError(Error(EGL_BAD_SURFACE));
+ SetGlobalError(Error(EGL_BAD_SURFACE));
return EGL_FALSE;
}
if (!display->getExtensions().postSubBuffer)
{
// Spec is not clear about how this should be handled.
- thread->setError(Error(EGL_SUCCESS));
+ SetGlobalError(Error(EGL_SUCCESS));
return EGL_TRUE;
}
error = eglSurface->postSubBuffer(x, y, width, height);
if (error.isError())
{
- thread->setError(error);
+ SetGlobalError(error);
return EGL_FALSE;
}
- thread->setError(Error(EGL_SUCCESS));
+ SetGlobalError(Error(EGL_SUCCESS));
return EGL_TRUE;
}
@@ -136,7 +133,6 @@ EGLDisplay EGLAPIENTRY GetPlatformDisplayEXT(EGLenum platform, void *native_disp
{
EVENT("(EGLenum platform = %d, void* native_display = 0x%0.8p, const EGLint* attrib_list = 0x%0.8p)",
platform, native_display, attrib_list);
- Thread *thread = GetCurrentThread();
const ClientExtensions &clientExtensions = Display::getClientExtensions();
@@ -145,20 +141,20 @@ EGLDisplay EGLAPIENTRY GetPlatformDisplayEXT(EGLenum platform, void *native_disp
case EGL_PLATFORM_ANGLE_ANGLE:
if (!clientExtensions.platformANGLE)
{
- thread->setError(Error(EGL_BAD_PARAMETER));
+ SetGlobalError(Error(EGL_BAD_PARAMETER));
return EGL_NO_DISPLAY;
}
break;
case EGL_PLATFORM_DEVICE_EXT:
if (!clientExtensions.platformDevice)
{
- thread->setError(Error(EGL_BAD_PARAMETER, "Platform Device extension is not active"));
+ SetGlobalError(Error(EGL_BAD_PARAMETER, "Platform Device extension is not active"));
return EGL_NO_DISPLAY;
}
break;
default:
- thread->setError(Error(EGL_BAD_CONFIG));
- return EGL_NO_DISPLAY;
+ SetGlobalError(Error(EGL_BAD_CONFIG));
+ return EGL_NO_DISPLAY;
}
if (platform == EGL_PLATFORM_ANGLE_ANGLE)
@@ -187,7 +183,7 @@ EGLDisplay EGLAPIENTRY GetPlatformDisplayEXT(EGLenum platform, void *native_disp
case EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE:
if (!clientExtensions.platformANGLED3D)
{
- thread->setError(Error(EGL_BAD_ATTRIBUTE));
+ SetGlobalError(Error(EGL_BAD_ATTRIBUTE));
return EGL_NO_DISPLAY;
}
break;
@@ -196,25 +192,14 @@ EGLDisplay EGLAPIENTRY GetPlatformDisplayEXT(EGLenum platform, void *native_disp
case EGL_PLATFORM_ANGLE_TYPE_OPENGLES_ANGLE:
if (!clientExtensions.platformANGLEOpenGL)
{
- thread->setError(Error(EGL_BAD_ATTRIBUTE));
- return EGL_NO_DISPLAY;
- }
- break;
-
- case EGL_PLATFORM_ANGLE_TYPE_NULL_ANGLE:
- if (!clientExtensions.platformANGLENULL)
- {
- thread->setError(Error(EGL_BAD_ATTRIBUTE,
- "Display type "
- "EGL_PLATFORM_ANGLE_TYPE_NULL_ANGLE "
- "requires EGL_ANGLE_platform_angle_null."));
+ SetGlobalError(Error(EGL_BAD_ATTRIBUTE));
return EGL_NO_DISPLAY;
}
break;
default:
- thread->setError(Error(EGL_BAD_ATTRIBUTE));
- return EGL_NO_DISPLAY;
+ SetGlobalError(Error(EGL_BAD_ATTRIBUTE));
+ return EGL_NO_DISPLAY;
}
platformType = curAttrib[1];
break;
@@ -240,8 +225,8 @@ EGLDisplay EGLAPIENTRY GetPlatformDisplayEXT(EGLenum platform, void *native_disp
case EGL_FALSE:
break;
default:
- thread->setError(Error(EGL_BAD_ATTRIBUTE));
- return EGL_NO_DISPLAY;
+ SetGlobalError(Error(EGL_BAD_ATTRIBUTE));
+ return EGL_NO_DISPLAY;
}
enableAutoTrimSpecified = true;
break;
@@ -249,7 +234,7 @@ EGLDisplay EGLAPIENTRY GetPlatformDisplayEXT(EGLenum platform, void *native_disp
case EGL_EXPERIMENTAL_PRESENT_PATH_ANGLE:
if (!clientExtensions.experimentalPresentPath)
{
- thread->setError(
+ SetGlobalError(
Error(EGL_BAD_ATTRIBUTE,
"EGL_ANGLE_experimental_present_path extension not active"));
return EGL_NO_DISPLAY;
@@ -261,7 +246,7 @@ EGLDisplay EGLAPIENTRY GetPlatformDisplayEXT(EGLenum platform, void *native_disp
case EGL_EXPERIMENTAL_PRESENT_PATH_COPY_ANGLE:
break;
default:
- thread->setError(
+ SetGlobalError(
Error(EGL_BAD_ATTRIBUTE,
"Invalid value for EGL_EXPERIMENTAL_PRESENT_PATH_ANGLE"));
return EGL_NO_DISPLAY;
@@ -283,10 +268,10 @@ EGLDisplay EGLAPIENTRY GetPlatformDisplayEXT(EGLenum platform, void *native_disp
break;
default:
- thread->setError(Error(EGL_BAD_ATTRIBUTE,
- "Invalid value for "
- "EGL_PLATFORM_ANGLE_DEVICE_TYPE_ANGLE "
- "attrib"));
+ SetGlobalError(Error(EGL_BAD_ATTRIBUTE,
+ "Invalid value for "
+ "EGL_PLATFORM_ANGLE_DEVICE_TYPE_ANGLE "
+ "attrib"));
return EGL_NO_DISPLAY;
}
deviceType = curAttrib[1];
@@ -300,14 +285,14 @@ EGLDisplay EGLAPIENTRY GetPlatformDisplayEXT(EGLenum platform, void *native_disp
if (!majorVersionSpecified && minorVersionSpecified)
{
- thread->setError(Error(EGL_BAD_ATTRIBUTE));
+ SetGlobalError(Error(EGL_BAD_ATTRIBUTE));
return EGL_NO_DISPLAY;
}
if (deviceType == EGL_PLATFORM_ANGLE_DEVICE_TYPE_WARP_ANGLE &&
platformType != EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE)
{
- thread->setError(
+ SetGlobalError(
Error(EGL_BAD_ATTRIBUTE,
"EGL_PLATFORM_ANGLE_DEVICE_TYPE_WARP_ANGLE requires a device type of "
"EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE."));
@@ -316,7 +301,7 @@ EGLDisplay EGLAPIENTRY GetPlatformDisplayEXT(EGLenum platform, void *native_disp
if (enableAutoTrimSpecified && platformType != EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE)
{
- thread->setError(
+ SetGlobalError(
Error(EGL_BAD_ATTRIBUTE,
"EGL_PLATFORM_ANGLE_ENABLE_AUTOMATIC_TRIM_ANGLE requires a device type of "
"EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE."));
@@ -325,23 +310,23 @@ EGLDisplay EGLAPIENTRY GetPlatformDisplayEXT(EGLenum platform, void *native_disp
if (presentPathSpecified && platformType != EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE)
{
- thread->setError(Error(EGL_BAD_ATTRIBUTE,
- "EGL_EXPERIMENTAL_PRESENT_PATH_ANGLE requires a device type of "
- "EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE."));
+ SetGlobalError(Error(EGL_BAD_ATTRIBUTE,
+ "EGL_EXPERIMENTAL_PRESENT_PATH_ANGLE requires a device type of "
+ "EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE."));
return EGL_NO_DISPLAY;
}
if (deviceTypeSpecified && platformType != EGL_PLATFORM_ANGLE_TYPE_D3D9_ANGLE &&
platformType != EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE)
{
- thread->setError(
+ SetGlobalError(
Error(EGL_BAD_ATTRIBUTE,
"EGL_PLATFORM_ANGLE_DEVICE_TYPE_ANGLE requires a device type of "
"EGL_PLATFORM_ANGLE_TYPE_D3D9_ANGLE or EGL_PLATFORM_ANGLE_TYPE_D3D9_ANGLE."));
return EGL_NO_DISPLAY;
}
- thread->setError(Error(EGL_SUCCESS));
+ SetGlobalError(Error(EGL_SUCCESS));
return Display::GetDisplayFromAttribs(native_display,
AttributeMap::CreateFromIntArray(attrib_list));
}
@@ -350,13 +335,13 @@ EGLDisplay EGLAPIENTRY GetPlatformDisplayEXT(EGLenum platform, void *native_disp
Device *eglDevice = reinterpret_cast<Device *>(native_display);
if (eglDevice == nullptr || !Device::IsValidDevice(eglDevice))
{
- thread->setError(Error(EGL_BAD_ATTRIBUTE,
- "native_display should be a valid EGL device if platform equals "
- "EGL_PLATFORM_DEVICE_EXT"));
+ SetGlobalError(Error(EGL_BAD_ATTRIBUTE,
+ "native_display should be a valid EGL device if platform equals "
+ "EGL_PLATFORM_DEVICE_EXT"));
return EGL_NO_DISPLAY;
}
- thread->setError(Error(EGL_SUCCESS));
+ SetGlobalError(Error(EGL_SUCCESS));
return Display::GetDisplayFromDevice(native_display);
}
else
@@ -371,12 +356,11 @@ EGLBoolean EGLAPIENTRY QueryDeviceAttribEXT(EGLDeviceEXT device, EGLint attribut
{
EVENT("(EGLDeviceEXT device = 0x%0.8p, EGLint attribute = %d, EGLAttrib *value = 0x%0.8p)",
device, attribute, value);
- Thread *thread = GetCurrentThread();
Device *dev = static_cast<Device*>(device);
if (dev == EGL_NO_DEVICE_EXT || !Device::IsValidDevice(dev))
{
- thread->setError(Error(EGL_BAD_ACCESS));
+ SetGlobalError(Error(EGL_BAD_ACCESS));
return EGL_FALSE;
}
@@ -385,9 +369,9 @@ EGLBoolean EGLAPIENTRY QueryDeviceAttribEXT(EGLDeviceEXT device, EGLint attribut
Display *owningDisplay = dev->getOwningDisplay();
if (owningDisplay != nullptr && !owningDisplay->getExtensions().deviceQuery)
{
- thread->setError(Error(EGL_BAD_ACCESS,
- "Device wasn't created using eglCreateDeviceANGLE, and the Display "
- "that created it doesn't support device querying"));
+ SetGlobalError(Error(EGL_BAD_ACCESS,
+ "Device wasn't created using eglCreateDeviceANGLE, and the Display "
+ "that created it doesn't support device querying"));
return EGL_FALSE;
}
@@ -400,17 +384,17 @@ EGLBoolean EGLAPIENTRY QueryDeviceAttribEXT(EGLDeviceEXT device, EGLint attribut
case EGL_D3D9_DEVICE_ANGLE:
if (!dev->getExtensions().deviceD3D || dev->getType() != attribute)
{
- thread->setError(Error(EGL_BAD_ATTRIBUTE));
+ SetGlobalError(Error(EGL_BAD_ATTRIBUTE));
return EGL_FALSE;
}
error = dev->getDevice(value);
break;
default:
- thread->setError(Error(EGL_BAD_ATTRIBUTE));
- return EGL_FALSE;
+ SetGlobalError(Error(EGL_BAD_ATTRIBUTE));
+ return EGL_FALSE;
}
- thread->setError(error);
+ SetGlobalError(error);
return (error.isError() ? EGL_FALSE : EGL_TRUE);
}
@@ -419,12 +403,11 @@ const char * EGLAPIENTRY QueryDeviceStringEXT(EGLDeviceEXT device, EGLint name)
{
EVENT("(EGLDeviceEXT device = 0x%0.8p, EGLint name = %d)",
device, name);
- Thread *thread = GetCurrentThread();
Device *dev = static_cast<Device*>(device);
if (dev == EGL_NO_DEVICE_EXT || !Device::IsValidDevice(dev))
{
- thread->setError(Error(EGL_BAD_DEVICE_EXT));
+ SetGlobalError(Error(EGL_BAD_DEVICE_EXT));
return nullptr;
}
@@ -435,11 +418,11 @@ const char * EGLAPIENTRY QueryDeviceStringEXT(EGLDeviceEXT device, EGLint name)
result = dev->getExtensionString().c_str();
break;
default:
- thread->setError(Error(EGL_BAD_DEVICE_EXT));
- return nullptr;
+ SetGlobalError(Error(EGL_BAD_DEVICE_EXT));
+ return nullptr;
}
- thread->setError(Error(EGL_SUCCESS));
+ SetGlobalError(Error(EGL_SUCCESS));
return result;
}
@@ -448,20 +431,19 @@ EGLBoolean EGLAPIENTRY QueryDisplayAttribEXT(EGLDisplay dpy, EGLint attribute, E
{
EVENT("(EGLDisplay dpy = 0x%0.8p, EGLint attribute = %d, EGLAttrib *value = 0x%0.8p)",
dpy, attribute, value);
- Thread *thread = GetCurrentThread();
Display *display = static_cast<Display*>(dpy);
Error error = ValidateDisplay(display);
if (error.isError())
{
- thread->setError(error);
+ SetGlobalError(error);
return EGL_FALSE;
}
if (!display->getExtensions().deviceQuery)
{
- thread->setError(Error(EGL_BAD_ACCESS));
+ SetGlobalError(Error(EGL_BAD_ACCESS));
return EGL_FALSE;
}
@@ -473,11 +455,11 @@ EGLBoolean EGLAPIENTRY QueryDisplayAttribEXT(EGLDisplay dpy, EGLint attribute, E
break;
default:
- thread->setError(Error(EGL_BAD_ATTRIBUTE));
- return EGL_FALSE;
+ SetGlobalError(Error(EGL_BAD_ATTRIBUTE));
+ return EGL_FALSE;
}
- thread->setError(error);
+ SetGlobalError(error);
return (error.isError() ? EGL_FALSE : EGL_TRUE);
}
@@ -491,7 +473,6 @@ ANGLE_EXPORT EGLImageKHR EGLAPIENTRY CreateImageKHR(EGLDisplay dpy,
"(EGLDisplay dpy = 0x%0.8p, EGLContext ctx = 0x%0.8p, EGLenum target = 0x%X, "
"EGLClientBuffer buffer = 0x%0.8p, const EGLAttrib *attrib_list = 0x%0.8p)",
dpy, ctx, target, buffer, attrib_list);
- Thread *thread = GetCurrentThread();
Display *display = static_cast<Display *>(dpy);
gl::Context *context = static_cast<gl::Context *>(ctx);
@@ -500,7 +481,7 @@ ANGLE_EXPORT EGLImageKHR EGLAPIENTRY CreateImageKHR(EGLDisplay dpy,
Error error = ValidateCreateImageKHR(display, context, target, buffer, attributes);
if (error.isError())
{
- thread->setError(error);
+ SetGlobalError(error);
return EGL_NO_IMAGE;
}
@@ -508,7 +489,7 @@ ANGLE_EXPORT EGLImageKHR EGLAPIENTRY CreateImageKHR(EGLDisplay dpy,
error = display->createImage(context, target, buffer, attributes, &image);
if (error.isError())
{
- thread->setError(error);
+ SetGlobalError(error);
return EGL_NO_IMAGE;
}
@@ -518,7 +499,6 @@ ANGLE_EXPORT EGLImageKHR EGLAPIENTRY CreateImageKHR(EGLDisplay dpy,
ANGLE_EXPORT EGLBoolean EGLAPIENTRY DestroyImageKHR(EGLDisplay dpy, EGLImageKHR image)
{
EVENT("(EGLDisplay dpy = 0x%0.8p, EGLImage image = 0x%0.8p)", dpy, image);
- Thread *thread = GetCurrentThread();
Display *display = static_cast<Display *>(dpy);
Image *img = static_cast<Image *>(image);
@@ -526,7 +506,7 @@ ANGLE_EXPORT EGLBoolean EGLAPIENTRY DestroyImageKHR(EGLDisplay dpy, EGLImageKHR
Error error = ValidateDestroyImageKHR(display, img);
if (error.isError())
{
- thread->setError(error);
+ SetGlobalError(error);
return EGL_FALSE;
}
@@ -543,12 +523,11 @@ ANGLE_EXPORT EGLDeviceEXT EGLAPIENTRY CreateDeviceANGLE(EGLint device_type,
"(EGLint device_type = %d, void* native_device = 0x%0.8p, const EGLAttrib* attrib_list = "
"0x%0.8p)",
device_type, native_device, attrib_list);
- Thread *thread = GetCurrentThread();
Error error = ValidateCreateDeviceANGLE(device_type, native_device, attrib_list);
if (error.isError())
{
- thread->setError(error);
+ SetGlobalError(error);
return EGL_NO_DEVICE_EXT;
}
@@ -557,7 +536,7 @@ ANGLE_EXPORT EGLDeviceEXT EGLAPIENTRY CreateDeviceANGLE(EGLint device_type,
if (error.isError())
{
ASSERT(device == nullptr);
- thread->setError(error);
+ SetGlobalError(error);
return EGL_NO_DEVICE_EXT;
}
@@ -567,14 +546,13 @@ ANGLE_EXPORT EGLDeviceEXT EGLAPIENTRY CreateDeviceANGLE(EGLint device_type,
ANGLE_EXPORT EGLBoolean EGLAPIENTRY ReleaseDeviceANGLE(EGLDeviceEXT device)
{
EVENT("(EGLDeviceEXT device = 0x%0.8p)", device);
- Thread *thread = GetCurrentThread();
Device *dev = static_cast<Device *>(device);
Error error = ValidateReleaseDeviceANGLE(dev);
if (error.isError())
{
- thread->setError(error);
+ SetGlobalError(error);
return EGL_FALSE;
}
@@ -587,7 +565,6 @@ ANGLE_EXPORT EGLBoolean EGLAPIENTRY ReleaseDeviceANGLE(EGLDeviceEXT device)
EGLStreamKHR EGLAPIENTRY CreateStreamKHR(EGLDisplay dpy, const EGLint *attrib_list)
{
EVENT("(EGLDisplay dpy = 0x%0.8p, const EGLAttrib* attrib_list = 0x%0.8p)", dpy, attrib_list);
- Thread *thread = GetCurrentThread();
Display *display = static_cast<Display *>(dpy);
AttributeMap attributes = AttributeMap::CreateFromIntArray(attrib_list);
@@ -595,7 +572,7 @@ EGLStreamKHR EGLAPIENTRY CreateStreamKHR(EGLDisplay dpy, const EGLint *attrib_li
Error error = ValidateCreateStreamKHR(display, attributes);
if (error.isError())
{
- thread->setError(error);
+ SetGlobalError(error);
return EGL_NO_STREAM_KHR;
}
@@ -603,18 +580,17 @@ EGLStreamKHR EGLAPIENTRY CreateStreamKHR(EGLDisplay dpy, const EGLint *attrib_li
error = display->createStream(attributes, &stream);
if (error.isError())
{
- thread->setError(error);
+ SetGlobalError(error);
return EGL_NO_STREAM_KHR;
}
- thread->setError(error);
+ SetGlobalError(error);
return static_cast<EGLStreamKHR>(stream);
}
EGLBoolean EGLAPIENTRY DestroyStreamKHR(EGLDisplay dpy, EGLStreamKHR stream)
{
EVENT("(EGLDisplay dpy = 0x%0.8p, EGLStreamKHR = 0x%0.8p)", dpy, stream);
- Thread *thread = GetCurrentThread();
Display *display = static_cast<Display *>(dpy);
Stream *streamObject = static_cast<Stream *>(stream);
@@ -622,12 +598,12 @@ EGLBoolean EGLAPIENTRY DestroyStreamKHR(EGLDisplay dpy, EGLStreamKHR stream)
Error error = ValidateDestroyStreamKHR(display, streamObject);
if (error.isError())
{
- thread->setError(error);
+ SetGlobalError(error);
return EGL_FALSE;
}
display->destroyStream(streamObject);
- thread->setError(error);
+ SetGlobalError(error);
return EGL_TRUE;
}
@@ -640,7 +616,6 @@ EGLBoolean EGLAPIENTRY StreamAttribKHR(EGLDisplay dpy,
"(EGLDisplay dpy = 0x%0.8p, EGLStreamKHR stream = 0x%0.8p, EGLenum attribute = 0x%X, "
"EGLint value = 0x%X)",
dpy, stream, attribute, value);
- Thread *thread = GetCurrentThread();
Display *display = static_cast<Display *>(dpy);
Stream *streamObject = static_cast<Stream *>(stream);
@@ -648,7 +623,7 @@ EGLBoolean EGLAPIENTRY StreamAttribKHR(EGLDisplay dpy,
Error error = ValidateStreamAttribKHR(display, streamObject, attribute, value);
if (error.isError())
{
- thread->setError(error);
+ SetGlobalError(error);
return EGL_FALSE;
}
@@ -664,7 +639,7 @@ EGLBoolean EGLAPIENTRY StreamAttribKHR(EGLDisplay dpy,
UNREACHABLE();
}
- thread->setError(error);
+ SetGlobalError(error);
return EGL_TRUE;
}
@@ -677,7 +652,6 @@ EGLBoolean EGLAPIENTRY QueryStreamKHR(EGLDisplay dpy,
"(EGLDisplay dpy = 0x%0.8p, EGLStreamKHR stream = 0x%0.8p, EGLenum attribute = 0x%X, "
"EGLint value = 0x%0.8p)",
dpy, stream, attribute, value);
- Thread *thread = GetCurrentThread();
Display *display = static_cast<Display *>(dpy);
Stream *streamObject = static_cast<Stream *>(stream);
@@ -685,7 +659,7 @@ EGLBoolean EGLAPIENTRY QueryStreamKHR(EGLDisplay dpy,
Error error = ValidateQueryStreamKHR(display, streamObject, attribute, value);
if (error.isError())
{
- thread->setError(error);
+ SetGlobalError(error);
return EGL_FALSE;
}
@@ -704,7 +678,7 @@ EGLBoolean EGLAPIENTRY QueryStreamKHR(EGLDisplay dpy,
UNREACHABLE();
}
- thread->setError(error);
+ SetGlobalError(error);
return EGL_TRUE;
}
@@ -717,7 +691,6 @@ EGLBoolean EGLAPIENTRY QueryStreamu64KHR(EGLDisplay dpy,
"(EGLDisplay dpy = 0x%0.8p, EGLStreamKHR stream = 0x%0.8p, EGLenum attribute = 0x%X, "
"EGLuint64KHR value = 0x%0.8p)",
dpy, stream, attribute, value);
- Thread *thread = GetCurrentThread();
Display *display = static_cast<Display *>(dpy);
Stream *streamObject = static_cast<Stream *>(stream);
@@ -725,7 +698,7 @@ EGLBoolean EGLAPIENTRY QueryStreamu64KHR(EGLDisplay dpy,
Error error = ValidateQueryStreamu64KHR(display, streamObject, attribute, value);
if (error.isError())
{
- thread->setError(error);
+ SetGlobalError(error);
return EGL_FALSE;
}
@@ -741,15 +714,13 @@ EGLBoolean EGLAPIENTRY QueryStreamu64KHR(EGLDisplay dpy,
UNREACHABLE();
}
- thread->setError(error);
+ SetGlobalError(error);
return EGL_TRUE;
}
EGLBoolean EGLAPIENTRY StreamConsumerGLTextureExternalKHR(EGLDisplay dpy, EGLStreamKHR stream)
{
EVENT("(EGLDisplay dpy = 0x%0.8p, EGLStreamKHR = 0x%0.8p)", dpy, stream);
- Thread *thread = GetCurrentThread();
-
Display *display = static_cast<Display *>(dpy);
Stream *streamObject = static_cast<Stream *>(stream);
gl::Context *context = gl::GetValidGlobalContext();
@@ -757,26 +728,24 @@ EGLBoolean EGLAPIENTRY StreamConsumerGLTextureExternalKHR(EGLDisplay dpy, EGLStr
Error error = ValidateStreamConsumerGLTextureExternalKHR(display, context, streamObject);
if (error.isError())
{
- thread->setError(error);
+ SetGlobalError(error);
return EGL_FALSE;
}
error = streamObject->createConsumerGLTextureExternal(AttributeMap(), context);
if (error.isError())
{
- thread->setError(error);
+ SetGlobalError(error);
return EGL_FALSE;
}
- thread->setError(error);
+ SetGlobalError(error);
return EGL_TRUE;
}
EGLBoolean EGLAPIENTRY StreamConsumerAcquireKHR(EGLDisplay dpy, EGLStreamKHR stream)
{
EVENT("(EGLDisplay dpy = 0x%0.8p, EGLStreamKHR = 0x%0.8p)", dpy, stream);
- Thread *thread = GetCurrentThread();
-
Display *display = static_cast<Display *>(dpy);
Stream *streamObject = static_cast<Stream *>(stream);
gl::Context *context = gl::GetValidGlobalContext();
@@ -784,26 +753,24 @@ EGLBoolean EGLAPIENTRY StreamConsumerAcquireKHR(EGLDisplay dpy, EGLStreamKHR str
Error error = ValidateStreamConsumerAcquireKHR(display, context, streamObject);
if (error.isError())
{
- thread->setError(error);
+ SetGlobalError(error);
return EGL_FALSE;
}
error = streamObject->consumerAcquire();
if (error.isError())
{
- thread->setError(error);
+ SetGlobalError(error);
return EGL_FALSE;
}
- thread->setError(error);
+ SetGlobalError(error);
return EGL_TRUE;
}
EGLBoolean EGLAPIENTRY StreamConsumerReleaseKHR(EGLDisplay dpy, EGLStreamKHR stream)
{
EVENT("(EGLDisplay dpy = 0x%0.8p, EGLStreamKHR = 0x%0.8p)", dpy, stream);
- Thread *thread = GetCurrentThread();
-
Display *display = static_cast<Display *>(dpy);
Stream *streamObject = static_cast<Stream *>(stream);
gl::Context *context = gl::GetValidGlobalContext();
@@ -811,18 +778,18 @@ EGLBoolean EGLAPIENTRY StreamConsumerReleaseKHR(EGLDisplay dpy, EGLStreamKHR str
Error error = ValidateStreamConsumerReleaseKHR(display, context, streamObject);
if (error.isError())
{
- thread->setError(error);
+ SetGlobalError(error);
return EGL_FALSE;
}
error = streamObject->consumerRelease();
if (error.isError())
{
- thread->setError(error);
+ SetGlobalError(error);
return EGL_FALSE;
}
- thread->setError(error);
+ SetGlobalError(error);
return EGL_TRUE;
}
@@ -833,8 +800,6 @@ EGLBoolean EGLAPIENTRY StreamConsumerGLTextureExternalAttribsNV(EGLDisplay dpy,
EVENT(
"(EGLDisplay dpy = 0x%0.8p, EGLStreamKHR stream = 0x%0.8p, EGLAttrib attrib_list = 0x%0.8p",
dpy, stream, attrib_list);
- Thread *thread = GetCurrentThread();
-
Display *display = static_cast<Display *>(dpy);
Stream *streamObject = static_cast<Stream *>(stream);
gl::Context *context = gl::GetValidGlobalContext();
@@ -844,18 +809,18 @@ EGLBoolean EGLAPIENTRY StreamConsumerGLTextureExternalAttribsNV(EGLDisplay dpy,
attributes);
if (error.isError())
{
- thread->setError(error);
+ SetGlobalError(error);
return EGL_FALSE;
}
error = streamObject->createConsumerGLTextureExternal(attributes, context);
if (error.isError())
{
- thread->setError(error);
+ SetGlobalError(error);
return EGL_FALSE;
}
- thread->setError(error);
+ SetGlobalError(error);
return EGL_TRUE;
}
@@ -866,8 +831,6 @@ EGLBoolean EGLAPIENTRY CreateStreamProducerD3DTextureNV12ANGLE(EGLDisplay dpy,
EVENT(
"(EGLDisplay dpy = 0x%0.8p, EGLStreamKHR stream = 0x%0.8p, EGLAttrib attrib_list = 0x%0.8p",
dpy, stream, attrib_list);
- Thread *thread = GetCurrentThread();
-
Display *display = static_cast<Display *>(dpy);
Stream *streamObject = static_cast<Stream *>(stream);
AttributeMap attributes = AttributeMap::CreateFromAttribArray(attrib_list);
@@ -876,18 +839,18 @@ EGLBoolean EGLAPIENTRY CreateStreamProducerD3DTextureNV12ANGLE(EGLDisplay dpy,
ValidateCreateStreamProducerD3DTextureNV12ANGLE(display, streamObject, attributes);
if (error.isError())
{
- thread->setError(error);
+ SetGlobalError(error);
return EGL_FALSE;
}
error = streamObject->createProducerD3D11TextureNV12(attributes);
if (error.isError())
{
- thread->setError(error);
+ SetGlobalError(error);
return EGL_FALSE;
}
- thread->setError(error);
+ SetGlobalError(error);
return EGL_TRUE;
}
@@ -900,8 +863,6 @@ EGLBoolean EGLAPIENTRY StreamPostD3DTextureNV12ANGLE(EGLDisplay dpy,
"(EGLDisplay dpy = 0x%0.8p, EGLStreamKHR stream = 0x%0.8p, void* texture = 0x%0.8p, "
"EGLAttrib attrib_list = 0x%0.8p",
dpy, stream, texture, attrib_list);
- Thread *thread = GetCurrentThread();
-
Display *display = static_cast<Display *>(dpy);
Stream *streamObject = static_cast<Stream *>(stream);
AttributeMap attributes = AttributeMap::CreateFromAttribArray(attrib_list);
@@ -909,49 +870,18 @@ EGLBoolean EGLAPIENTRY StreamPostD3DTextureNV12ANGLE(EGLDisplay dpy,
Error error = ValidateStreamPostD3DTextureNV12ANGLE(display, streamObject, texture, attributes);
if (error.isError())
{
- thread->setError(error);
+ SetGlobalError(error);
return EGL_FALSE;
}
error = streamObject->postD3D11NV12Texture(texture, attributes);
if (error.isError())
{
- thread->setError(error);
- return EGL_FALSE;
- }
-
- thread->setError(error);
- return EGL_TRUE;
-}
-
-ANGLE_EXPORT EGLBoolean SwapBuffersWithDamageEXT(EGLDisplay dpy,
- EGLSurface surface,
- EGLint *rects,
- EGLint n_rects)
-{
- EVENT(
- "(EGLDisplay dpy = 0x%0.8p, EGLSurface surface = 0x%0.8p, EGLint *rects = 0x%0.8p, EGLint "
- "n_rects = %d)",
- dpy, surface, rects, n_rects);
- Thread *thread = GetCurrentThread();
-
- Display *display = static_cast<Display *>(dpy);
- Surface *eglSurface = static_cast<Surface *>(surface);
-
- Error error = ValidateSwapBuffersWithDamageEXT(display, eglSurface, rects, n_rects);
- if (error.isError())
- {
- thread->setError(error);
- return EGL_FALSE;
- }
-
- error = eglSurface->swapWithDamage(rects, n_rects);
- if (error.isError())
- {
- thread->setError(error);
+ SetGlobalError(error);
return EGL_FALSE;
}
+ SetGlobalError(error);
return EGL_TRUE;
}
}