зеркало из https://github.com/AvaloniaUI/angle.git
Add eglQueryDisplayAttribANGLE to query workarounds count.
Add eglQueryDisplayAttribANGLE based on eglQueryDisplayAttribEXT to add behavior for quering the count of all workarounds available. Used externally to build a list of workarounds. Bug: angleproject:1621 Change-Id: I793acedc76111fd018600169d58bf5d8cf4a63ee Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1637817 Commit-Queue: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
This commit is contained in:
Родитель
20d380fa5b
Коммит
2dd40a44d1
|
@ -35,11 +35,15 @@ Dependencies
|
|||
This extension is written against the wording of the EGL 1.4
|
||||
Specification.
|
||||
|
||||
EGL_EXT_device_query affects the definition of this extension.
|
||||
|
||||
Overview
|
||||
|
||||
This extension defines a method to query a string describing
|
||||
properties of the EGL client or of an EGL display connection
|
||||
which are looked up via the property name and index.
|
||||
This extension adds two methods to query arrays holding
|
||||
information about the available workarounds for a given device.
|
||||
One method is used to query the total count of available
|
||||
workarounds. Another method is used to query a string property
|
||||
of an individual workaround given the workaround index.
|
||||
|
||||
IP Status
|
||||
|
||||
|
@ -56,6 +60,11 @@ New Procedures and Functions
|
|||
EGLint name,
|
||||
EGLint index);
|
||||
|
||||
EGLBoolean eglQueryDisplayAttribANGLE(
|
||||
EGLDisplay dpy,
|
||||
EGLint attribute,
|
||||
EGLAttrib *value);
|
||||
|
||||
New Tokens
|
||||
|
||||
Accepted as a queried <name> in eglQueryStringiANGLE:
|
||||
|
@ -66,9 +75,11 @@ New Tokens
|
|||
EGL_WORKAROUND_BUG_ANGLE 0x3463
|
||||
EGL_WORKAROUND_ENABLED_ANGLE 0x3464
|
||||
|
||||
Additions to the EGL 1.5 Specification
|
||||
Accepted as a queried <attribute> in eglQueryDisplayAttribANGLE
|
||||
|
||||
Add the following to the end of section 3.3 "EGL Queries":
|
||||
EGL_WORKAROUND_COUNT_ANGLE 0x3465
|
||||
|
||||
Add the following to the end of section 3.3 "EGL Queries":
|
||||
|
||||
const char *eglQueryStringiANGLE(EGLDisplay dpy,
|
||||
EGLint name, EGLint index);
|
||||
|
@ -107,6 +118,24 @@ Additions to the EGL 1.5 Specification
|
|||
An EGL_BAD_PARAMETER error is generated if index is not within
|
||||
the valid range of indices for the array.
|
||||
|
||||
Add a section "3.4 Display Attributes" after "3.3 EGL Versioning"
|
||||
|
||||
To query attributes of an initialized display, use:
|
||||
|
||||
EGLBoolean eglQueryDisplayAttribANGLE(EGLDisplay dpy,
|
||||
EGLint attribute,
|
||||
EGLAttrib *value);
|
||||
|
||||
On success, EGL_TRUE is returned.
|
||||
If <attribute> is EGL_WORKAROUND_COUNT_ANGLE, the total count of
|
||||
available workarounds is returned in <value>.
|
||||
|
||||
On failure, EGL_FALSE is returned.
|
||||
An EGL_BAD_DISPLAY error is generated if dpy is not a valid
|
||||
display.
|
||||
An EGL_BAD_ATTRIBUTE error is generated if <attribute> is not a
|
||||
valid value.
|
||||
|
||||
Issues
|
||||
|
||||
None
|
||||
|
|
|
@ -216,9 +216,12 @@ EGLAPI EGLBoolean EGLAPIENTRY eglGetSyncValuesCHROMIUM(EGLDisplay dpy,
|
|||
#define EGL_WORKAROUND_DESCRIPTION_ANGLE 0x3462
|
||||
#define EGL_WORKAROUND_BUG_ANGLE 0x3463
|
||||
#define EGL_WORKAROUND_ENABLED_ANGLE 0x3464
|
||||
#define EGL_WORKAROUND_COUNT_ANGLE 0x3465
|
||||
typedef const char *(EGLAPIENTRYP PFNEGLQUERYSTRINGIANGLEPROC) (EGLDisplay dpy, EGLint name, EGLint index);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYDISPLAYATTRIBANGLEPROC) (EGLDisplay dpy, EGLint attribute, EGLAttrib *value);
|
||||
#ifdef EGL_EGLEXT_PROTOTYPES
|
||||
EGLAPI const char *EGLAPIENTRY eglQueryStringiANGLE(EGLDisplay dpy, EGLint name, EGLint index);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglQueryDisplayAttribANGLE(EGLDisplay dpy, EGLint attribute, EGLAttrib *value);
|
||||
#endif
|
||||
#endif /* EGL_ANGLE_workaround_control */
|
||||
|
||||
|
|
|
@ -75,6 +75,12 @@
|
|||
<param><ptype>EGLint</ptype> <name>name</name></param>
|
||||
<param><ptype>EGLint</ptype> <name>index</name></param>
|
||||
</command>
|
||||
<command>
|
||||
<proto><ptype>EGLBoolean</ptype> <name>eglDisplayAttribANGLE</name></proto>
|
||||
<param><ptype>EGLDisplay</ptype> <name>dpy</name></param>
|
||||
<param><ptype>EGLint</ptype> <name>attribute</name></param>
|
||||
<param><ptype>EGLAttrib *</ptype> <name>value</name></param>
|
||||
</command>
|
||||
</commands>
|
||||
<!-- SECTION: ANGLE extension interface definitions -->
|
||||
<extensions>
|
||||
|
@ -106,6 +112,7 @@
|
|||
<extension name="EGL_ANGLE_workaround_control" supported="egl">
|
||||
<require>
|
||||
<command name="eglQueryStringiANGLE"/>
|
||||
<command name="eglQueryDisplayAttribANGLE"/>
|
||||
</require>
|
||||
</extension>
|
||||
</extensions>
|
||||
|
|
|
@ -90,7 +90,7 @@
|
|||
"GL/EGL entry points:scripts/egl.xml":
|
||||
"842e24514c4cfe09fba703c17a0fd292",
|
||||
"GL/EGL entry points:scripts/egl_angle_ext.xml":
|
||||
"cc91aa6b14979dc7b3a0b7fee024e59e",
|
||||
"5a960e91d1b0837828638e19db1b685a",
|
||||
"GL/EGL entry points:scripts/entry_point_packed_gl_enums.json":
|
||||
"28238b0f52826c3794eaa1aa940238bf",
|
||||
"GL/EGL entry points:scripts/generate_entry_points.py":
|
||||
|
@ -138,11 +138,11 @@
|
|||
"GL/EGL entry points:src/libGLESv2/libGLESv2_autogen.cpp":
|
||||
"c99457bcd86a5b94c61185c1bcddfdcb",
|
||||
"GL/EGL entry points:src/libGLESv2/libGLESv2_autogen.def":
|
||||
"7bf137682e60dc977445d4ef989b3dcf",
|
||||
"054028c2a9caa4b303fc65e18e0320bc",
|
||||
"GL/EGL/WGL loader:scripts/egl.xml":
|
||||
"842e24514c4cfe09fba703c17a0fd292",
|
||||
"GL/EGL/WGL loader:scripts/egl_angle_ext.xml":
|
||||
"cc91aa6b14979dc7b3a0b7fee024e59e",
|
||||
"5a960e91d1b0837828638e19db1b685a",
|
||||
"GL/EGL/WGL loader:scripts/generate_loader.py":
|
||||
"5a7cd014230fe04664d9613e65399d42",
|
||||
"GL/EGL/WGL loader:scripts/registry_xml.py":
|
||||
|
@ -150,13 +150,13 @@
|
|||
"GL/EGL/WGL loader:scripts/wgl.xml":
|
||||
"aa96419c582af2f6673430e2847693f4",
|
||||
"GL/EGL/WGL loader:src/libEGL/egl_loader_autogen.cpp":
|
||||
"494b0076622c9d7f70b74eeb00fd348c",
|
||||
"aa736e910cee09355f7ac646dd5e8576",
|
||||
"GL/EGL/WGL loader:src/libEGL/egl_loader_autogen.h":
|
||||
"8fd78216d48373e776f2f579a58f84c8",
|
||||
"bdd2e54a7b23b9616efa14e0b4cc7169",
|
||||
"GL/EGL/WGL loader:util/egl_loader_autogen.cpp":
|
||||
"310b388513c03d205c33e84454851ed7",
|
||||
"c7ee1ebf9d35e29d3ae907f3b71c3b74",
|
||||
"GL/EGL/WGL loader:util/egl_loader_autogen.h":
|
||||
"093393b593b7e1af814c1e9da3e7b053",
|
||||
"25c81800fe7efbc656570355824bf71b",
|
||||
"GL/EGL/WGL loader:util/gles_loader_autogen.cpp":
|
||||
"34056ce8d9c18d3cdcd23e16b94508c4",
|
||||
"GL/EGL/WGL loader:util/gles_loader_autogen.h":
|
||||
|
@ -416,9 +416,9 @@
|
|||
"proc table:src/libGLESv2/gen_proc_table.py":
|
||||
"3be3e8ed7fad58e8cc6fcf348da7b17d",
|
||||
"proc table:src/libGLESv2/proc_table_autogen.cpp":
|
||||
"fd3852952eecf7a81758edeb3b5465c3",
|
||||
"7cf8dbd79fddffd89d2348d1210ba4ca",
|
||||
"proc table:src/libGLESv2/proc_table_data.json":
|
||||
"e04e3c3c46ba7ed4994ce64aedbff390",
|
||||
"d92a9202be39597e148545b6c0a7abb3",
|
||||
"uniform type:src/common/gen_uniform_type_table.py":
|
||||
"9dd389f2b5793ba635169d61cef2dde9",
|
||||
"uniform type:src/common/uniform_type_info_autogen.cpp":
|
||||
|
|
|
@ -1477,4 +1477,23 @@ const char *Display::queryStringi(const EGLint name, const EGLint index)
|
|||
return result;
|
||||
}
|
||||
|
||||
EGLAttrib Display::queryAttrib(const EGLint attribute)
|
||||
{
|
||||
EGLAttrib value = 0;
|
||||
switch (attribute)
|
||||
{
|
||||
case EGL_DEVICE_EXT:
|
||||
value = reinterpret_cast<EGLAttrib>(mDevice);
|
||||
break;
|
||||
|
||||
case EGL_WORKAROUND_COUNT_ANGLE:
|
||||
value = mFeatures.size();
|
||||
break;
|
||||
|
||||
default:
|
||||
UNREACHABLE();
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
} // namespace egl
|
||||
|
|
|
@ -195,6 +195,8 @@ class Display final : public LabeledObject, angle::NonCopyable
|
|||
|
||||
const char *queryStringi(const EGLint name, const EGLint index);
|
||||
|
||||
EGLAttrib queryAttrib(const EGLint attribute);
|
||||
|
||||
private:
|
||||
Display(EGLenum platform, EGLNativeDisplayType displayId, Device *eglDevice);
|
||||
|
||||
|
|
|
@ -3762,4 +3762,46 @@ Error ValidateQueryStringiANGLE(const Display *display, EGLint name, EGLint inde
|
|||
return NoError();
|
||||
}
|
||||
|
||||
Error ValidateQueryDisplayAttribBase(const Display *display, const EGLint attribute)
|
||||
{
|
||||
ANGLE_TRY(ValidateDisplay(display));
|
||||
|
||||
switch (attribute)
|
||||
{
|
||||
case EGL_DEVICE_EXT:
|
||||
if (!display->getExtensions().deviceQuery)
|
||||
{
|
||||
return EglBadDisplay() << "EGL_EXT_device_query extension is not available.";
|
||||
}
|
||||
break;
|
||||
|
||||
case EGL_WORKAROUND_COUNT_ANGLE:
|
||||
if (!display->getExtensions().workaroundControlANGLE)
|
||||
{
|
||||
return EglBadDisplay()
|
||||
<< "EGL_ANGLE_workaround_control extension is not available.";
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
return EglBadAttribute() << "attribute is not valid.";
|
||||
}
|
||||
|
||||
return NoError();
|
||||
}
|
||||
|
||||
Error ValidateQueryDisplayAttribEXT(const Display *display, const EGLint attribute)
|
||||
{
|
||||
ANGLE_TRY(ValidateQueryDisplayAttribBase(display, attribute));
|
||||
|
||||
return NoError();
|
||||
}
|
||||
|
||||
Error ValidateQueryDisplayAttribANGLE(const Display *display, const EGLint attribute)
|
||||
{
|
||||
ANGLE_TRY(ValidateQueryDisplayAttribBase(display, attribute));
|
||||
|
||||
return NoError();
|
||||
}
|
||||
|
||||
} // namespace egl
|
||||
|
|
|
@ -317,6 +317,9 @@ Error ValidateGetFrameTimestampsANDROID(const Display *display,
|
|||
|
||||
Error ValidateQueryStringiANGLE(const Display *display, EGLint name, EGLint index);
|
||||
|
||||
Error ValidateQueryDisplayAttribEXT(const Display *display, const EGLint attribute);
|
||||
Error ValidateQueryDisplayAttribANGLE(const Display *display, const EGLint attribute);
|
||||
|
||||
} // namespace egl
|
||||
|
||||
#define ANGLE_EGL_TRY(THREAD, EXPR, FUNCNAME, LABELOBJECT) \
|
||||
|
|
|
@ -70,6 +70,7 @@ PFNEGLPROGRAMCACHERESIZEANGLEPROC EGL_ProgramCacheResizeANGLE;
|
|||
PFNEGLQUERYSURFACEPOINTERANGLEPROC EGL_QuerySurfacePointerANGLE;
|
||||
PFNEGLCREATESTREAMPRODUCERD3DTEXTUREANGLEPROC EGL_CreateStreamProducerD3DTextureANGLE;
|
||||
PFNEGLSTREAMPOSTD3DTEXTUREANGLEPROC EGL_StreamPostD3DTextureANGLE;
|
||||
PFNEGLQUERYDISPLAYATTRIBANGLEPROC EGL_QueryDisplayAttribANGLE;
|
||||
PFNEGLQUERYSTRINGIANGLEPROC EGL_QueryStringiANGLE;
|
||||
PFNEGLGETSYNCVALUESCHROMIUMPROC EGL_GetSyncValuesCHROMIUM;
|
||||
PFNEGLQUERYDEVICEATTRIBEXTPROC EGL_QueryDeviceAttribEXT;
|
||||
|
@ -195,6 +196,8 @@ void LoadEGL_EGL(LoadProc loadProc)
|
|||
loadProc("EGL_CreateStreamProducerD3DTextureANGLE"));
|
||||
EGL_StreamPostD3DTextureANGLE = reinterpret_cast<PFNEGLSTREAMPOSTD3DTEXTUREANGLEPROC>(
|
||||
loadProc("EGL_StreamPostD3DTextureANGLE"));
|
||||
EGL_QueryDisplayAttribANGLE = reinterpret_cast<PFNEGLQUERYDISPLAYATTRIBANGLEPROC>(
|
||||
loadProc("EGL_QueryDisplayAttribANGLE"));
|
||||
EGL_QueryStringiANGLE =
|
||||
reinterpret_cast<PFNEGLQUERYSTRINGIANGLEPROC>(loadProc("EGL_QueryStringiANGLE"));
|
||||
EGL_GetSyncValuesCHROMIUM =
|
||||
|
|
|
@ -74,6 +74,7 @@ extern PFNEGLPROGRAMCACHERESIZEANGLEPROC EGL_ProgramCacheResizeANGLE;
|
|||
extern PFNEGLQUERYSURFACEPOINTERANGLEPROC EGL_QuerySurfacePointerANGLE;
|
||||
extern PFNEGLCREATESTREAMPRODUCERD3DTEXTUREANGLEPROC EGL_CreateStreamProducerD3DTextureANGLE;
|
||||
extern PFNEGLSTREAMPOSTD3DTEXTUREANGLEPROC EGL_StreamPostD3DTextureANGLE;
|
||||
extern PFNEGLQUERYDISPLAYATTRIBANGLEPROC EGL_QueryDisplayAttribANGLE;
|
||||
extern PFNEGLQUERYSTRINGIANGLEPROC EGL_QueryStringiANGLE;
|
||||
extern PFNEGLGETSYNCVALUESCHROMIUMPROC EGL_GetSyncValuesCHROMIUM;
|
||||
extern PFNEGLQUERYDEVICEATTRIBEXTPROC EGL_QueryDeviceAttribEXT;
|
||||
|
|
|
@ -415,6 +415,14 @@ EGLBoolean EGLAPIENTRY eglQueryDisplayAttribEXT(EGLDisplay dpy, EGLint attribute
|
|||
return EGL_QueryDisplayAttribEXT(dpy, attribute, value);
|
||||
}
|
||||
|
||||
EGLBoolean EGLAPIENTRY eglQueryDisplayAttribANGLE(EGLDisplay dpy,
|
||||
EGLint attribute,
|
||||
EGLAttrib *value)
|
||||
{
|
||||
EnsureEGLLoaded();
|
||||
return EGL_QueryDisplayAttribANGLE(dpy, attribute, value);
|
||||
}
|
||||
|
||||
EGLBoolean EGLAPIENTRY eglQueryDeviceAttribEXT(EGLDeviceEXT device,
|
||||
EGLint attribute,
|
||||
EGLAttrib *value)
|
||||
|
|
|
@ -355,37 +355,35 @@ EGLBoolean EGLAPIENTRY EGL_QueryDisplayAttribEXT(EGLDisplay dpy, EGLint attribut
|
|||
EVENT("(EGLDisplay dpy = 0x%016" PRIxPTR
|
||||
", EGLint attribute = %d, EGLAttrib *value = 0x%016" PRIxPTR ")",
|
||||
(uintptr_t)dpy, attribute, (uintptr_t)value);
|
||||
Thread *thread = egl::GetCurrentThread();
|
||||
|
||||
egl::Display *display = static_cast<egl::Display *>(dpy);
|
||||
Thread *thread = egl::GetCurrentThread();
|
||||
|
||||
Error error = ValidateDisplay(display);
|
||||
if (error.isError())
|
||||
{
|
||||
thread->setError(error, GetDebug(), "eglQueryDisplayAttribEXT", GetDisplayIfValid(display));
|
||||
return EGL_FALSE;
|
||||
}
|
||||
ANGLE_EGL_TRY_RETURN(thread, ValidateQueryDisplayAttribEXT(display, attribute),
|
||||
"eglQueryDisplayAttribEXT", GetDisplayIfValid(display), EGL_FALSE);
|
||||
|
||||
if (!display->getExtensions().deviceQuery)
|
||||
{
|
||||
thread->setError(EglBadAccess(), GetDebug(), "eglQueryDisplayAttribEXT",
|
||||
GetDisplayIfValid(display));
|
||||
return EGL_FALSE;
|
||||
}
|
||||
*value = display->queryAttrib(attribute);
|
||||
thread->setSuccess();
|
||||
return EGL_TRUE;
|
||||
}
|
||||
|
||||
// validate the attribute parameter
|
||||
switch (attribute)
|
||||
{
|
||||
case EGL_DEVICE_EXT:
|
||||
*value = reinterpret_cast<EGLAttrib>(display->getDevice());
|
||||
break;
|
||||
// EGL_ANGLE_workaround_control
|
||||
EGLBoolean EGLAPIENTRY EGL_QueryDisplayAttribANGLE(EGLDisplay dpy,
|
||||
EGLint attribute,
|
||||
EGLAttrib *value)
|
||||
{
|
||||
ANGLE_SCOPED_GLOBAL_LOCK();
|
||||
EVENT("(EGLDisplay dpy = 0x%016" PRIxPTR
|
||||
", EGLint attribute = %d, EGLAttrib *value = 0x%016" PRIxPTR ")",
|
||||
(uintptr_t)dpy, attribute, (uintptr_t)value);
|
||||
|
||||
default:
|
||||
thread->setError(EglBadAttribute(), GetDebug(), "eglQueryDisplayAttribEXT",
|
||||
GetDisplayIfValid(display));
|
||||
return EGL_FALSE;
|
||||
}
|
||||
egl::Display *display = static_cast<egl::Display *>(dpy);
|
||||
Thread *thread = egl::GetCurrentThread();
|
||||
|
||||
ANGLE_EGL_TRY_RETURN(thread, ValidateQueryDisplayAttribANGLE(display, attribute),
|
||||
"eglQueryDisplayAttribANGLE", GetDisplayIfValid(display), EGL_FALSE);
|
||||
|
||||
*value = display->queryAttrib(attribute);
|
||||
thread->setSuccess();
|
||||
return EGL_TRUE;
|
||||
}
|
||||
|
|
|
@ -46,6 +46,13 @@ ANGLE_EXPORT EGLSurface EGLAPIENTRY EGL_CreatePlatformPixmapSurfaceEXT(EGLDispla
|
|||
ANGLE_EXPORT EGLBoolean EGLAPIENTRY EGL_QueryDisplayAttribEXT(EGLDisplay dpy,
|
||||
EGLint attribute,
|
||||
EGLAttrib *value);
|
||||
|
||||
// EGL_ANGLE_workaround_control
|
||||
ANGLE_EXPORT EGLBoolean EGLAPIENTRY EGL_QueryDisplayAttribANGLE(EGLDisplay dpy,
|
||||
EGLint attribute,
|
||||
EGLAttrib *value);
|
||||
|
||||
// EGL_EXT_device_query
|
||||
ANGLE_EXPORT EGLBoolean EGLAPIENTRY EGL_QueryDeviceAttribEXT(EGLDeviceEXT device,
|
||||
EGLint attribute,
|
||||
EGLAttrib *value);
|
||||
|
@ -198,6 +205,7 @@ ANGLE_EXPORT EGLBoolean EGLAPIENTRY EGL_GetFrameTimestampsANDROID(EGLDisplay dpy
|
|||
const EGLint *timestamps,
|
||||
EGLnsecsANDROID *values);
|
||||
|
||||
// EGL_ANGLE_workaround_control
|
||||
ANGLE_EXPORT const char *EGLAPIENTRY EGL_QueryStringiANGLE(EGLDisplay dpy,
|
||||
EGLint name,
|
||||
EGLint index);
|
||||
|
|
|
@ -1490,6 +1490,7 @@ EXPORTS
|
|||
EGL_StreamPostD3DTextureANGLE
|
||||
|
||||
; EGL_ANGLE_workaround_control
|
||||
EGL_QueryDisplayAttribANGLE
|
||||
EGL_QueryStringiANGLE
|
||||
|
||||
; EGL_CHROMIUM_get_sync_values
|
||||
|
|
|
@ -89,6 +89,7 @@ ProcEntry g_procTable[] = {
|
|||
{"eglQueryDebugKHR", P(EGL_QueryDebugKHR)},
|
||||
{"eglQueryDeviceAttribEXT", P(EGL_QueryDeviceAttribEXT)},
|
||||
{"eglQueryDeviceStringEXT", P(EGL_QueryDeviceStringEXT)},
|
||||
{"eglQueryDisplayAttribANGLE", P(EGL_QueryDisplayAttribANGLE)},
|
||||
{"eglQueryDisplayAttribEXT", P(EGL_QueryDisplayAttribEXT)},
|
||||
{"eglQueryStreamKHR", P(EGL_QueryStreamKHR)},
|
||||
{"eglQueryStreamu64KHR", P(EGL_QueryStreamu64KHR)},
|
||||
|
@ -1419,5 +1420,5 @@ ProcEntry g_procTable[] = {
|
|||
{"glWeightPointerOES", P(gl::WeightPointerOES)},
|
||||
{"glWeightPointerOESContextANGLE", P(gl::WeightPointerOESContextANGLE)}};
|
||||
|
||||
size_t g_numProcs = 1333;
|
||||
size_t g_numProcs = 1334;
|
||||
} // namespace egl
|
||||
|
|
|
@ -1002,6 +1002,7 @@
|
|||
"glLoseContextCHROMIUM"
|
||||
],
|
||||
"EGL_ANGLE_workaround_control": [
|
||||
"eglQueryStringiANGLE"
|
||||
"eglQueryStringiANGLE",
|
||||
"eglQueryDisplayAttribANGLE"
|
||||
]
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
# found in the LICENSE file.
|
||||
|
||||
angle_white_box_tests_sources = [
|
||||
"egl_tests/EGLQueryStringIndexedTest.cpp",
|
||||
"egl_tests/EGLWorkaroundControlTest.cpp",
|
||||
"util_tests/PrintSystemInfoTest.cpp",
|
||||
"test_utils/angle_test_configs.cpp",
|
||||
"test_utils/angle_test_configs.h",
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
//
|
||||
// Tests the eglQueryStringiANGLE function exposed by the extension
|
||||
// EGL_ANGLE_workaround_control.
|
||||
// Tests the eglQueryStringiANGLE and eglQueryDisplayAttribANGLE functions exposed by the
|
||||
// extension EGL_ANGLE_workaround_control.
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
|||
|
||||
using namespace angle;
|
||||
|
||||
class EGLQueryStringIndexedTest : public ANGLETest
|
||||
class EGLWorkaroundControlTest : public ANGLETest
|
||||
{
|
||||
public:
|
||||
void testSetUp() override
|
||||
|
@ -26,14 +26,14 @@ class EGLQueryStringIndexedTest : public ANGLETest
|
|||
};
|
||||
|
||||
// Ensure eglQueryStringiANGLE generates EGL_BAD_DISPLAY if the display passed in is invalid.
|
||||
TEST_P(EGLQueryStringIndexedTest, InvalidDisplay)
|
||||
TEST_P(EGLWorkaroundControlTest, InvalidDisplay)
|
||||
{
|
||||
EXPECT_EQ(nullptr, eglQueryStringiANGLE(EGL_NO_DISPLAY, EGL_WORKAROUND_NAME_ANGLE, 0));
|
||||
EXPECT_EGL_ERROR(EGL_BAD_DISPLAY);
|
||||
}
|
||||
|
||||
// Ensure eglQueryStringiANGLE generates EGL_BAD_PARAMETER if the index is negative.
|
||||
TEST_P(EGLQueryStringIndexedTest, NegativeIndex)
|
||||
TEST_P(EGLWorkaroundControlTest, NegativeIndex)
|
||||
{
|
||||
EXPECT_EQ(nullptr,
|
||||
eglQueryStringiANGLE(getEGLWindow()->getDisplay(), EGL_WORKAROUND_NAME_ANGLE, -1));
|
||||
|
@ -41,7 +41,7 @@ TEST_P(EGLQueryStringIndexedTest, NegativeIndex)
|
|||
}
|
||||
|
||||
// Ensure eglQueryStringiANGLE generates EGL_BAD_PARAMETER if the index is out of bounds.
|
||||
TEST_P(EGLQueryStringIndexedTest, IndexOutOfBounds)
|
||||
TEST_P(EGLWorkaroundControlTest, IndexOutOfBounds)
|
||||
{
|
||||
EGLDisplay dpy = getEGLWindow()->getDisplay();
|
||||
egl::Display *display = static_cast<egl::Display *>(dpy);
|
||||
|
@ -52,7 +52,7 @@ TEST_P(EGLQueryStringIndexedTest, IndexOutOfBounds)
|
|||
|
||||
// Ensure eglQueryStringiANGLE generates EGL_BAD_PARAMETER if the name is not one of the valid
|
||||
// options specified in the workaround.
|
||||
TEST_P(EGLQueryStringIndexedTest, InvalidName)
|
||||
TEST_P(EGLWorkaroundControlTest, InvalidName)
|
||||
{
|
||||
EXPECT_EQ(nullptr, eglQueryStringiANGLE(getEGLWindow()->getDisplay(), 100, 0));
|
||||
EXPECT_EGL_ERROR(EGL_BAD_PARAMETER);
|
||||
|
@ -61,7 +61,7 @@ TEST_P(EGLQueryStringIndexedTest, InvalidName)
|
|||
// For each valid name and index in the workaround description arrays, query the values and ensure
|
||||
// that no error is generated, and that the values match the correct values frim ANGLE's display's
|
||||
// FeatureList.
|
||||
TEST_P(EGLQueryStringIndexedTest, QueryAll)
|
||||
TEST_P(EGLWorkaroundControlTest, QueryAll)
|
||||
{
|
||||
EGLDisplay dpy = getEGLWindow()->getDisplay();
|
||||
egl::Display *display = static_cast<egl::Display *>(dpy);
|
||||
|
@ -86,7 +86,20 @@ TEST_P(EGLQueryStringIndexedTest, QueryAll)
|
|||
}
|
||||
}
|
||||
|
||||
ANGLE_INSTANTIATE_TEST(EGLQueryStringIndexedTest,
|
||||
// Ensure eglQueryDisplayAttribANGLE returns the correct number of workarounds when queried with
|
||||
// attribute EGL_WORKAROUND_COUNT_ANGLE
|
||||
TEST_P(EGLWorkaroundControlTest, WorkaroundCount)
|
||||
{
|
||||
EGLDisplay dpy = getEGLWindow()->getDisplay();
|
||||
egl::Display *display = static_cast<egl::Display *>(dpy);
|
||||
EGLAttrib value = -1;
|
||||
EXPECT_EQ(static_cast<EGLBoolean>(EGL_TRUE),
|
||||
eglQueryDisplayAttribANGLE(dpy, EGL_WORKAROUND_COUNT_ANGLE, &value));
|
||||
EXPECT_EQ(display->getFeatures().size(), static_cast<size_t>(value));
|
||||
ASSERT_EGL_SUCCESS();
|
||||
}
|
||||
|
||||
ANGLE_INSTANTIATE_TEST(EGLWorkaroundControlTest,
|
||||
ES2_D3D9(),
|
||||
ES2_D3D11(),
|
||||
ES2_OPENGL(),
|
|
@ -72,6 +72,7 @@ ANGLE_UTIL_EXPORT PFNEGLQUERYSURFACEPOINTERANGLEPROC eglQuerySurfacePointerANGLE
|
|||
ANGLE_UTIL_EXPORT PFNEGLCREATESTREAMPRODUCERD3DTEXTUREANGLEPROC
|
||||
eglCreateStreamProducerD3DTextureANGLE;
|
||||
ANGLE_UTIL_EXPORT PFNEGLSTREAMPOSTD3DTEXTUREANGLEPROC eglStreamPostD3DTextureANGLE;
|
||||
ANGLE_UTIL_EXPORT PFNEGLQUERYDISPLAYATTRIBANGLEPROC eglQueryDisplayAttribANGLE;
|
||||
ANGLE_UTIL_EXPORT PFNEGLQUERYSTRINGIANGLEPROC eglQueryStringiANGLE;
|
||||
ANGLE_UTIL_EXPORT PFNEGLGETSYNCVALUESCHROMIUMPROC eglGetSyncValuesCHROMIUM;
|
||||
ANGLE_UTIL_EXPORT PFNEGLQUERYDEVICEATTRIBEXTPROC eglQueryDeviceAttribEXT;
|
||||
|
@ -199,6 +200,8 @@ void LoadEGL(LoadProc loadProc)
|
|||
loadProc("eglCreateStreamProducerD3DTextureANGLE"));
|
||||
eglStreamPostD3DTextureANGLE = reinterpret_cast<PFNEGLSTREAMPOSTD3DTEXTUREANGLEPROC>(
|
||||
loadProc("eglStreamPostD3DTextureANGLE"));
|
||||
eglQueryDisplayAttribANGLE =
|
||||
reinterpret_cast<PFNEGLQUERYDISPLAYATTRIBANGLEPROC>(loadProc("eglQueryDisplayAttribANGLE"));
|
||||
eglQueryStringiANGLE =
|
||||
reinterpret_cast<PFNEGLQUERYSTRINGIANGLEPROC>(loadProc("eglQueryStringiANGLE"));
|
||||
eglGetSyncValuesCHROMIUM =
|
||||
|
|
|
@ -79,6 +79,7 @@ ANGLE_UTIL_EXPORT extern PFNEGLQUERYSURFACEPOINTERANGLEPROC eglQuerySurfacePoint
|
|||
ANGLE_UTIL_EXPORT extern PFNEGLCREATESTREAMPRODUCERD3DTEXTUREANGLEPROC
|
||||
eglCreateStreamProducerD3DTextureANGLE;
|
||||
ANGLE_UTIL_EXPORT extern PFNEGLSTREAMPOSTD3DTEXTUREANGLEPROC eglStreamPostD3DTextureANGLE;
|
||||
ANGLE_UTIL_EXPORT extern PFNEGLQUERYDISPLAYATTRIBANGLEPROC eglQueryDisplayAttribANGLE;
|
||||
ANGLE_UTIL_EXPORT extern PFNEGLQUERYSTRINGIANGLEPROC eglQueryStringiANGLE;
|
||||
ANGLE_UTIL_EXPORT extern PFNEGLGETSYNCVALUESCHROMIUMPROC eglGetSyncValuesCHROMIUM;
|
||||
ANGLE_UTIL_EXPORT extern PFNEGLQUERYDEVICEATTRIBEXTPROC eglQueryDeviceAttribEXT;
|
||||
|
|
Загрузка…
Ссылка в новой задаче