Commit 3f564fc7 by Jamie Madill Committed by Commit Bot

EGL: Generate entry points.

This adds two final auto-generated files for the EGL and EXT extension entry points. It adds a new data file that stores a mapping between object types and entry points for associating labeled objects with certain methods. When we generate errors we record the associated object in the debug message output. This places the remainder of the hand-written code in "stub" files. Going forward the work for implementing new extension entry points for EGL will be to update the registry XML files and then implement the corresponding stub methods. Event logging, parameter packing, and validation are all handled by the auto-generated code. Bug: angleproject:2621 Change-Id: I28153432802c37b929ff2ea1e1a3e3ce9de91605 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2562680 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarCody Northrop <cnorthrop@google.com> Reviewed-by: 's avatarTim Van Patten <timvp@google.com>
parent db679caf
...@@ -4,11 +4,11 @@ ...@@ -4,11 +4,11 @@
"scripts/egl_angle_ext.xml": "scripts/egl_angle_ext.xml":
"91f7718effe50d444f8d81ce285721db", "91f7718effe50d444f8d81ce285721db",
"scripts/entry_point_packed_egl_enums.json": "scripts/entry_point_packed_egl_enums.json":
"7cb78d6bea4e0df9e74d3ce5faf824dc", "0175304f39aec0f1816760c6460b6d62",
"scripts/entry_point_packed_gl_enums.json": "scripts/entry_point_packed_gl_enums.json":
"846be5dc8cb36076207699b025633fcc", "846be5dc8cb36076207699b025633fcc",
"scripts/generate_entry_points.py": "scripts/generate_entry_points.py":
"6e65c837b023f25f368edf0b91146951", "95fc7635243122e679e82e1757816ab3",
"scripts/gl.xml": "scripts/gl.xml":
"f66967f3f3d696b5d8306fd80bbd49a8", "f66967f3f3d696b5d8306fd80bbd49a8",
"scripts/gl_angle_ext.xml": "scripts/gl_angle_ext.xml":
...@@ -102,7 +102,7 @@ ...@@ -102,7 +102,7 @@
"src/libANGLE/frame_capture_utils_autogen.h": "src/libANGLE/frame_capture_utils_autogen.h":
"652b821a877d6eb2c62ba8d151157eea", "652b821a877d6eb2c62ba8d151157eea",
"src/libANGLE/validationEGL_autogen.h": "src/libANGLE/validationEGL_autogen.h":
"ecdb1d2c7cd19d2a4faeafb19de4d77e", "b3c0eae46748da68d6833cc40e4bb486",
"src/libANGLE/validationES1_autogen.h": "src/libANGLE/validationES1_autogen.h":
"c8edb0a5b26303bf7c4692b9d0b05c1f", "c8edb0a5b26303bf7c4692b9d0b05c1f",
"src/libANGLE/validationES2_autogen.h": "src/libANGLE/validationES2_autogen.h":
...@@ -237,8 +237,18 @@ ...@@ -237,8 +237,18 @@
"a5e7b09116b1905ce029f2383cbe4f3a", "a5e7b09116b1905ce029f2383cbe4f3a",
"src/libGL/libGL_autogen.def": "src/libGL/libGL_autogen.def":
"2789d87b05eea9f53d52e2aff499b785", "2789d87b05eea9f53d52e2aff499b785",
"src/libGLESv2/egl_ext_stubs_autogen.h":
"03de6401c1695f8ca4acbde9c3ae1ba2",
"src/libGLESv2/egl_get_labeled_object_data.json":
"2f4148b2ddf34e62670e32c5e6da4937",
"src/libGLESv2/egl_stubs_autogen.h":
"1c9d160acb1ed9bf5e7c26918d4a039e",
"src/libGLESv2/entry_points_egl_autogen.cpp":
"9fd1b2d1e0dbab804e854e33e5bc9ef2",
"src/libGLESv2/entry_points_egl_autogen.h": "src/libGLESv2/entry_points_egl_autogen.h":
"3bc7a8df9deadd7cfd615d0cfad0c6a8", "3bc7a8df9deadd7cfd615d0cfad0c6a8",
"src/libGLESv2/entry_points_egl_ext_autogen.cpp":
"f52756d7a31ce136ea04a67e0ea1b447",
"src/libGLESv2/entry_points_egl_ext_autogen.h": "src/libGLESv2/entry_points_egl_ext_autogen.h":
"9154781afd9bd6354ec6fc201b43c790", "9154781afd9bd6354ec6fc201b43c790",
"src/libGLESv2/entry_points_gles_1_0_autogen.cpp": "src/libGLESv2/entry_points_gles_1_0_autogen.cpp":
......
...@@ -31,11 +31,9 @@ ...@@ -31,11 +31,9 @@
"attrib_list": "const AttributeMap &" "attrib_list": "const AttributeMap &"
}, },
"eglCreatePlatformPixmapSurface": { "eglCreatePlatformPixmapSurface": {
"native_pixmap": "EGLNativePixmapType",
"attrib_list": "const AttributeMap &" "attrib_list": "const AttributeMap &"
}, },
"eglCreatePlatformWindowSurface": { "eglCreatePlatformWindowSurface": {
"native_window": "EGLNativeWindowType",
"attrib_list": "const AttributeMap &" "attrib_list": "const AttributeMap &"
}, },
"eglCreateStream": { "eglCreateStream": {
......
...@@ -4516,7 +4516,7 @@ bool ValidateGetPlatformDisplayEXT(const ValidationContext *val, ...@@ -4516,7 +4516,7 @@ bool ValidateGetPlatformDisplayEXT(const ValidationContext *val,
bool ValidateCreatePlatformWindowSurfaceEXT(const ValidationContext *val, bool ValidateCreatePlatformWindowSurfaceEXT(const ValidationContext *val,
const Display *display, const Display *display,
const Config *configuration, const Config *configuration,
EGLNativeWindowType nativeWindow, const void *nativeWindow,
const AttributeMap &attributes) const AttributeMap &attributes)
{ {
if (!Display::GetClientExtensions().platformBase) if (!Display::GetClientExtensions().platformBase)
...@@ -4534,7 +4534,7 @@ bool ValidateCreatePlatformWindowSurfaceEXT(const ValidationContext *val, ...@@ -4534,7 +4534,7 @@ bool ValidateCreatePlatformWindowSurfaceEXT(const ValidationContext *val,
bool ValidateCreatePlatformPixmapSurfaceEXT(const ValidationContext *val, bool ValidateCreatePlatformPixmapSurfaceEXT(const ValidationContext *val,
const Display *display, const Display *display,
const Config *configuration, const Config *configuration,
EGLNativePixmapType nativePixmap, const void *nativePixmap,
const AttributeMap &attributes) const AttributeMap &attributes)
{ {
if (!Display::GetClientExtensions().platformBase) if (!Display::GetClientExtensions().platformBase)
...@@ -5296,6 +5296,12 @@ bool ValidateGetNativeClientBufferANDROID(const ValidationContext *val, ...@@ -5296,6 +5296,12 @@ bool ValidateGetNativeClientBufferANDROID(const ValidationContext *val,
bool ValidateCreateNativeClientBufferANDROID(const ValidationContext *val, bool ValidateCreateNativeClientBufferANDROID(const ValidationContext *val,
const egl::AttributeMap &attribMap) const egl::AttributeMap &attribMap)
{ {
if (attribMap.isEmpty() || attribMap.begin()->second == EGL_NONE)
{
val->setError(EGL_BAD_PARAMETER, "invalid attribute list.");
return false;
}
int width = attribMap.getAsInt(EGL_WIDTH, 0); int width = attribMap.getAsInt(EGL_WIDTH, 0);
int height = attribMap.getAsInt(EGL_HEIGHT, 0); int height = attribMap.getAsInt(EGL_HEIGHT, 0);
int redSize = attribMap.getAsInt(EGL_RED_SIZE, 0); int redSize = attribMap.getAsInt(EGL_RED_SIZE, 0);
...@@ -5646,20 +5652,24 @@ bool ValidateGetCurrentContext(const ValidationContext *val) ...@@ -5646,20 +5652,24 @@ bool ValidateGetCurrentContext(const ValidationContext *val)
bool ValidateCreatePlatformPixmapSurface(const ValidationContext *val, bool ValidateCreatePlatformPixmapSurface(const ValidationContext *val,
const Display *dpyPacked, const Display *dpyPacked,
const Config *configPacked, const Config *configPacked,
EGLNativePixmapType native_pixmap, const void *native_pixmap,
const AttributeMap &attrib_listPacked) const AttributeMap &attrib_listPacked)
{ {
return ValidateCreatePixmapSurface(val, dpyPacked, configPacked, native_pixmap, EGLNativePixmapType nativePixmap =
reinterpret_cast<EGLNativePixmapType>(const_cast<void *>(native_pixmap));
return ValidateCreatePixmapSurface(val, dpyPacked, configPacked, nativePixmap,
attrib_listPacked); attrib_listPacked);
} }
bool ValidateCreatePlatformWindowSurface(const ValidationContext *val, bool ValidateCreatePlatformWindowSurface(const ValidationContext *val,
const Display *dpyPacked, const Display *dpyPacked,
const Config *configPacked, const Config *configPacked,
EGLNativeWindowType native_window, const void *native_window,
const AttributeMap &attrib_listPacked) const AttributeMap &attrib_listPacked)
{ {
return ValidateCreateWindowSurface(val, dpyPacked, configPacked, native_window, EGLNativeWindowType nativeWindow =
reinterpret_cast<EGLNativeWindowType>(const_cast<void *>(native_window));
return ValidateCreateWindowSurface(val, dpyPacked, configPacked, nativeWindow,
attrib_listPacked); attrib_listPacked);
} }
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
#include "common/PackedEnums.h" #include "common/PackedEnums.h"
#include "libANGLE/Error.h" #include "libANGLE/Error.h"
#include "libANGLE/Texture.h" #include "libANGLE/Thread.h"
#include <EGL/egl.h> #include <EGL/egl.h>
#include <EGL/eglext.h> #include <EGL/eglext.h>
...@@ -76,18 +76,78 @@ LabeledObject *GetLabeledObjectIfValid(Thread *thread, ...@@ -76,18 +76,78 @@ LabeledObject *GetLabeledObjectIfValid(Thread *thread,
ObjectType objectType, ObjectType objectType,
EGLObjectKHR object); EGLObjectKHR object);
// A template struct for determining the default value to return for each entry point.
template <angle::EntryPoint EP, typename ReturnType>
struct DefaultReturnValue
{
static constexpr ReturnType kValue = static_cast<ReturnType>(0);
};
template <angle::EntryPoint EP, typename ReturnType>
ReturnType GetDefaultReturnValue(Thread *thread);
template <>
ANGLE_INLINE EGLint
GetDefaultReturnValue<angle::EntryPoint::EGLLabelObjectKHR, EGLint>(Thread *thread)
{
return thread->getError();
}
template <angle::EntryPoint EP, typename ReturnType>
ANGLE_INLINE ReturnType GetDefaultReturnValue(Thread *thread)
{
return DefaultReturnValue<EP, ReturnType>::kValue;
}
// First case: handling packed enums.
template <typename PackedT, typename FromT>
typename std::enable_if<std::is_enum<PackedT>::value, PackedT>::type PackParam(FromT from)
{
return FromEGLenum<PackedT>(from);
}
// Second case: handling other types.
template <typename PackedT, typename FromT>
typename std::enable_if<!std::is_enum<PackedT>::value,
typename std::remove_reference<PackedT>::type>::type
PackParam(FromT from);
template <>
inline const AttributeMap PackParam<const AttributeMap &, const EGLint *>(const EGLint *attribs)
{
return AttributeMap::CreateFromIntArray(attribs);
}
// In a 32-bit environment the EGLAttrib and EGLint types are the same. We need to mask out one of
// the two specializations to avoid having an override ambiguity.
#if defined(ANGLE_IS_64_BIT_CPU)
template <>
inline const AttributeMap PackParam<const AttributeMap &, const EGLAttrib *>(
const EGLAttrib *attribs)
{
return AttributeMap::CreateFromAttribArray(attribs);
}
#endif // defined(ANGLE_IS_64_BIT_CPU)
template <typename PackedT, typename FromT>
inline typename std::enable_if<!std::is_enum<PackedT>::value,
typename std::remove_reference<PackedT>::type>::type
PackParam(FromT from)
{
return static_cast<PackedT>(from);
}
} // namespace egl } // namespace egl
#define ANGLE_EGL_VALIDATE(THREAD, EP, OBJ, RETVAL, ...) \ #define ANGLE_EGL_VALIDATE(THREAD, EP, OBJ, RETURN_TYPE, ...) \
do \ do \
{ \ { \
const char *epname = "egl" #EP; \ const char *epname = "egl" #EP; \
ValidationContext vctx(THREAD, epname, OBJ); \ ValidationContext vctx(THREAD, epname, OBJ); \
auto ANGLE_LOCAL_VAR = (Validate##EP(&vctx, ##__VA_ARGS__)); \ auto ANGLE_LOCAL_VAR = (Validate##EP(&vctx, ##__VA_ARGS__)); \
if (!ANGLE_LOCAL_VAR) \ if (!ANGLE_LOCAL_VAR) \
{ \ { \
return RETVAL; \ return GetDefaultReturnValue<angle::EntryPoint::EGL##EP, RETURN_TYPE>(THREAD); \
} \ } \
} while (0) } while (0)
#define ANGLE_EGL_VALIDATE_VOID(THREAD, EP, OBJ, ...) \ #define ANGLE_EGL_VALIDATE_VOID(THREAD, EP, OBJ, ...) \
......
...@@ -140,12 +140,12 @@ bool ValidateCreateImage(const ValidationContext *val, ...@@ -140,12 +140,12 @@ bool ValidateCreateImage(const ValidationContext *val,
bool ValidateCreatePlatformPixmapSurface(const ValidationContext *val, bool ValidateCreatePlatformPixmapSurface(const ValidationContext *val,
const Display *dpyPacked, const Display *dpyPacked,
const Config *configPacked, const Config *configPacked,
EGLNativePixmapType native_pixmapPacked, const void *native_pixmap,
const AttributeMap &attrib_listPacked); const AttributeMap &attrib_listPacked);
bool ValidateCreatePlatformWindowSurface(const ValidationContext *val, bool ValidateCreatePlatformWindowSurface(const ValidationContext *val,
const Display *dpyPacked, const Display *dpyPacked,
const Config *configPacked, const Config *configPacked,
EGLNativeWindowType native_windowPacked, const void *native_window,
const AttributeMap &attrib_listPacked); const AttributeMap &attrib_listPacked);
bool ValidateCreateSync(const ValidationContext *val, bool ValidateCreateSync(const ValidationContext *val,
const Display *dpyPacked, const Display *dpyPacked,
...@@ -327,12 +327,12 @@ bool ValidateQueryDisplayAttribEXT(const ValidationContext *val, ...@@ -327,12 +327,12 @@ bool ValidateQueryDisplayAttribEXT(const ValidationContext *val,
bool ValidateCreatePlatformPixmapSurfaceEXT(const ValidationContext *val, bool ValidateCreatePlatformPixmapSurfaceEXT(const ValidationContext *val,
const Display *dpyPacked, const Display *dpyPacked,
const Config *configPacked, const Config *configPacked,
EGLNativePixmapType native_pixmapPacked, const void *native_pixmap,
const AttributeMap &attrib_listPacked); const AttributeMap &attrib_listPacked);
bool ValidateCreatePlatformWindowSurfaceEXT(const ValidationContext *val, bool ValidateCreatePlatformWindowSurfaceEXT(const ValidationContext *val,
const Display *dpyPacked, const Display *dpyPacked,
const Config *configPacked, const Config *configPacked,
EGLNativeWindowType native_windowPacked, const void *native_window,
const AttributeMap &attrib_listPacked); const AttributeMap &attrib_listPacked);
bool ValidateGetPlatformDisplayEXT(const ValidationContext *val, bool ValidateGetPlatformDisplayEXT(const ValidationContext *val,
EGLenum platform, EGLenum platform,
......
...@@ -558,9 +558,13 @@ if (is_win) { ...@@ -558,9 +558,13 @@ if (is_win) {
} }
libglesv2_sources = [ libglesv2_sources = [
"src/libGLESv2/entry_points_egl.cpp", "src/libGLESv2/egl_ext_stubs.cpp",
"src/libGLESv2/egl_ext_stubs_autogen.h",
"src/libGLESv2/egl_stubs.cpp",
"src/libGLESv2/egl_stubs_autogen.h",
"src/libGLESv2/entry_points_egl_autogen.cpp",
"src/libGLESv2/entry_points_egl_autogen.h", "src/libGLESv2/entry_points_egl_autogen.h",
"src/libGLESv2/entry_points_egl_ext.cpp", "src/libGLESv2/entry_points_egl_ext_autogen.cpp",
"src/libGLESv2/entry_points_egl_ext_autogen.h", "src/libGLESv2/entry_points_egl_ext_autogen.h",
"src/libGLESv2/entry_points_gles_1_0_autogen.cpp", "src/libGLESv2/entry_points_gles_1_0_autogen.cpp",
"src/libGLESv2/entry_points_gles_1_0_autogen.h", "src/libGLESv2/entry_points_gles_1_0_autogen.h",
......
{
"description": [
"Copyright 2020 The ANGLE Project Authors. All rights reserved.",
"Use of this source code is governed by a BSD-style license that can be",
"found in the LICENSE file.",
"",
"egl_get_labeled_object_data.json: Associates entry points and labeled objects.",
"",
"If an entry point has no data in this list it is associated with an",
"EGLDisplay if the EGLDisplay is the first parameter the function.",
"Otherise missing entry points have no association.",
"",
"We omit extension suffixes in this file. The generator takes care of that."
],
"Context": [
"DestroyContext",
"MakeCurrent",
"QueryContext",
"WaitClient"
],
"Device": [
"QueryDeviceAttrib",
"QueryDeviceString",
"ReleaseDevice"
],
"Image": [
"DestroyImage"
],
"LabeledObject": [
"LabelObject"
],
"Stream": [
"CreateStreamProducerD3DTexture",
"DestroyStream",
"QueryStream",
"QueryStreamu64",
"StreamAttrib",
"StreamConsumerAcquire",
"StreamConsumerGLTextureExternal",
"StreamConsumerGLTextureExternalAttribsNV",
"StreamConsumerRelease",
"StreamPostD3DTexture"
],
"Surface": [
"BindTexImage",
"CopyBuffers",
"DestroySurface",
"GetCompositorTiming",
"GetCompositorTimingSupported",
"GetFrameTimestamps",
"GetFrameTimestampSupported",
"GetNextFrameId",
"GetMscRate",
"GetSyncValues",
"PresentationTime",
"QuerySuface",
"ReleaseTexImage",
"SurfaceAttrib",
"SwapBuffers",
"SwapBuffersWithDamage"
],
"Sync": [
"ClientWaitSync",
"DupNativeFenceFD",
"GetSyncAttrib",
"SignalSync",
"WaitSync"
],
"Thread": [
"BindAPI",
"CreateDevice",
"GetPlatformDisplay",
"WaitNative"
]
}
// GENERATED FILE - DO NOT EDIT.
// Generated by generate_entry_points.py using data from egl.xml.
//
// Copyright 2020 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// egl_stubs_autogen.h: Stubs for EGL entry points.
#ifndef LIBGLESV2_EGL_STUBS_AUTOGEN_H_
#define LIBGLESV2_EGL_STUBS_AUTOGEN_H_
#include <EGL/egl.h>
#include <EGL/eglext.h>
#include "common/PackedEGLEnums_autogen.h"
namespace gl
{
class Context;
} // namespace gl
namespace egl
{
class AttributeMap;
class Device;
class Display;
class Image;
class Stream;
class Surface;
class Sync;
class Thread;
struct Config;
EGLBoolean BindAPI(Thread *thread, EGLenum api);
EGLBoolean BindTexImage(Thread *thread, Display *dpyPacked, Surface *surfacePacked, EGLint buffer);
EGLBoolean ChooseConfig(Thread *thread,
Display *dpyPacked,
const AttributeMap &attrib_listPacked,
EGLConfig *configs,
EGLint config_size,
EGLint *num_config);
EGLint ClientWaitSync(Thread *thread,
Display *dpyPacked,
Sync *syncPacked,
EGLint flags,
EGLTime timeout);
EGLBoolean CopyBuffers(Thread *thread,
Display *dpyPacked,
Surface *surfacePacked,
EGLNativePixmapType target);
EGLContext CreateContext(Thread *thread,
Display *dpyPacked,
Config *configPacked,
gl::Context *share_contextPacked,
const AttributeMap &attrib_listPacked);
EGLImage CreateImage(Thread *thread,
Display *dpyPacked,
gl::Context *ctxPacked,
EGLenum target,
EGLClientBuffer buffer,
const AttributeMap &attrib_listPacked);
EGLSurface CreatePbufferFromClientBuffer(Thread *thread,
Display *dpyPacked,
EGLenum buftype,
EGLClientBuffer buffer,
Config *configPacked,
const AttributeMap &attrib_listPacked);
EGLSurface CreatePbufferSurface(Thread *thread,
Display *dpyPacked,
Config *configPacked,
const AttributeMap &attrib_listPacked);
EGLSurface CreatePixmapSurface(Thread *thread,
Display *dpyPacked,
Config *configPacked,
EGLNativePixmapType pixmap,
const AttributeMap &attrib_listPacked);
EGLSurface CreatePlatformPixmapSurface(Thread *thread,
Display *dpyPacked,
Config *configPacked,
void *native_pixmap,
const AttributeMap &attrib_listPacked);
EGLSurface CreatePlatformWindowSurface(Thread *thread,
Display *dpyPacked,
Config *configPacked,
void *native_window,
const AttributeMap &attrib_listPacked);
EGLSync CreateSync(Thread *thread,
Display *dpyPacked,
EGLenum type,
const AttributeMap &attrib_listPacked);
EGLSurface CreateWindowSurface(Thread *thread,
Display *dpyPacked,
Config *configPacked,
EGLNativeWindowType win,
const AttributeMap &attrib_listPacked);
EGLBoolean DestroyContext(Thread *thread, Display *dpyPacked, gl::Context *ctxPacked);
EGLBoolean DestroyImage(Thread *thread, Display *dpyPacked, Image *imagePacked);
EGLBoolean DestroySurface(Thread *thread, Display *dpyPacked, Surface *surfacePacked);
EGLBoolean DestroySync(Thread *thread, Display *dpyPacked, Sync *syncPacked);
EGLBoolean GetConfigAttrib(Thread *thread,
Display *dpyPacked,
Config *configPacked,
EGLint attribute,
EGLint *value);
EGLBoolean GetConfigs(Thread *thread,
Display *dpyPacked,
EGLConfig *configs,
EGLint config_size,
EGLint *num_config);
EGLContext GetCurrentContext(Thread *thread);
EGLDisplay GetCurrentDisplay(Thread *thread);
EGLSurface GetCurrentSurface(Thread *thread, EGLint readdraw);
EGLDisplay GetDisplay(Thread *thread, EGLNativeDisplayType display_id);
EGLint GetError(Thread *thread);
EGLDisplay GetPlatformDisplay(Thread *thread,
EGLenum platform,
void *native_display,
const AttributeMap &attrib_listPacked);
__eglMustCastToProperFunctionPointerType GetProcAddress(Thread *thread, const char *procname);
EGLBoolean GetSyncAttrib(Thread *thread,
Display *dpyPacked,
Sync *syncPacked,
EGLint attribute,
EGLAttrib *value);
EGLBoolean Initialize(Thread *thread, Display *dpyPacked, EGLint *major, EGLint *minor);
EGLBoolean MakeCurrent(Thread *thread,
Display *dpyPacked,
Surface *drawPacked,
Surface *readPacked,
gl::Context *ctxPacked);
EGLenum QueryAPI(Thread *thread);
EGLBoolean QueryContext(Thread *thread,
Display *dpyPacked,
gl::Context *ctxPacked,
EGLint attribute,
EGLint *value);
const char *QueryString(Thread *thread, Display *dpyPacked, EGLint name);
EGLBoolean QuerySurface(Thread *thread,
Display *dpyPacked,
Surface *surfacePacked,
EGLint attribute,
EGLint *value);
EGLBoolean ReleaseTexImage(Thread *thread,
Display *dpyPacked,
Surface *surfacePacked,
EGLint buffer);
EGLBoolean ReleaseThread(Thread *thread);
EGLBoolean SurfaceAttrib(Thread *thread,
Display *dpyPacked,
Surface *surfacePacked,
EGLint attribute,
EGLint value);
EGLBoolean SwapBuffers(Thread *thread, Display *dpyPacked, Surface *surfacePacked);
EGLBoolean SwapInterval(Thread *thread, Display *dpyPacked, EGLint interval);
EGLBoolean Terminate(Thread *thread, Display *dpyPacked);
EGLBoolean WaitClient(Thread *thread);
EGLBoolean WaitGL(Thread *thread);
EGLBoolean WaitNative(Thread *thread, EGLint engine);
EGLBoolean WaitSync(Thread *thread, Display *dpyPacked, Sync *syncPacked, EGLint flags);
} // namespace egl
#endif // LIBGLESV2_EGL_STUBS_AUTOGEN_H_
...@@ -153,26 +153,29 @@ TEST_P(EGLDebugTest, SetLabel) ...@@ -153,26 +153,29 @@ TEST_P(EGLDebugTest, SetLabel)
{ {
ANGLE_SKIP_TEST_IF(!hasExtension()); ANGLE_SKIP_TEST_IF(!hasExtension());
EGLDisplay display = getEGLWindow()->getDisplay();
EGLSurface surface = getEGLWindow()->getSurface();
EXPECT_EQ(static_cast<EGLint>(EGL_SUCCESS), eglDebugMessageControlKHR(nullptr, nullptr)); EXPECT_EQ(static_cast<EGLint>(EGL_SUCCESS), eglDebugMessageControlKHR(nullptr, nullptr));
// Display display and object must be equal when setting a display label // Display display and object must be equal when setting a display label
EXPECT_EQ(static_cast<EGLint>(EGL_SUCCESS), EXPECT_EQ(
eglLabelObjectKHR(getEGLWindow()->getDisplay(), EGL_OBJECT_DISPLAY_KHR, static_cast<EGLint>(EGL_SUCCESS),
getEGLWindow()->getDisplay(), const_cast<char *>("Display"))); eglLabelObjectKHR(display, EGL_OBJECT_DISPLAY_KHR, display, const_cast<char *>("Display")));
EXPECT_NE(static_cast<EGLint>(EGL_SUCCESS), EXPECT_NE(static_cast<EGLint>(EGL_SUCCESS),
eglLabelObjectKHR(nullptr, EGL_OBJECT_DISPLAY_KHR, getEGLWindow()->getDisplay(), eglLabelObjectKHR(nullptr, EGL_OBJECT_DISPLAY_KHR, getEGLWindow()->getDisplay(),
const_cast<char *>("Display"))); const_cast<char *>("Display")));
// Set a surface label // Set a surface label
EXPECT_EQ(static_cast<EGLint>(EGL_SUCCESS), EXPECT_EQ(
eglLabelObjectKHR(getEGLWindow()->getDisplay(), EGL_OBJECT_SURFACE_KHR, static_cast<EGLint>(EGL_SUCCESS),
getEGLWindow()->getSurface(), const_cast<char *>("Surface"))); eglLabelObjectKHR(display, EGL_OBJECT_SURFACE_KHR, surface, const_cast<char *>("Surface")));
EXPECT_EGL_ERROR(EGL_SUCCESS); EXPECT_EGL_ERROR(EGL_SUCCESS);
// Provide a surface but use an image label type // Provide a surface but use an image label type
EXPECT_EQ(static_cast<EGLint>(EGL_BAD_PARAMETER), EXPECT_EQ(
eglLabelObjectKHR(getEGLWindow()->getDisplay(), EGL_OBJECT_IMAGE_KHR, static_cast<EGLint>(EGL_BAD_PARAMETER),
getEGLWindow()->getSurface(), const_cast<char *>("Image"))); eglLabelObjectKHR(display, EGL_OBJECT_IMAGE_KHR, surface, const_cast<char *>("Image")));
EXPECT_EGL_ERROR(EGL_BAD_PARAMETER); EXPECT_EGL_ERROR(EGL_BAD_PARAMETER);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment