Commit e1a057e8 by Geoff Lang Committed by Commit Bot

Fully format some files.

Change-Id: Id6ea245849696d4c6d7eabc6860c0ac424dd8013 Reviewed-on: https://chromium-review.googlesource.com/1091309Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
parent 74be296b
...@@ -11,8 +11,8 @@ ...@@ -11,8 +11,8 @@
#include <iterator> #include <iterator>
#include <platform/Platform.h>
#include <EGL/eglext.h> #include <EGL/eglext.h>
#include <platform/Platform.h>
#include "common/debug.h" #include "common/debug.h"
#include "common/platform.h" #include "common/platform.h"
...@@ -31,7 +31,8 @@ static std::string GenerateExtensionsString(const T &extensions) ...@@ -31,7 +31,8 @@ static std::string GenerateExtensionsString(const T &extensions)
std::vector<std::string> extensionsVector = extensions.getStrings(); std::vector<std::string> extensionsVector = extensions.getStrings();
std::ostringstream stream; std::ostringstream stream;
std::copy(extensionsVector.begin(), extensionsVector.end(), std::ostream_iterator<std::string>(stream, " ")); std::copy(extensionsVector.begin(), extensionsVector.end(),
std::ostream_iterator<std::string>(stream, " "));
return stream.str(); return stream.str();
} }
...@@ -117,5 +118,4 @@ const std::string &Device::getExtensionString() const ...@@ -117,5 +118,4 @@ const std::string &Device::getExtensionString() const
{ {
return mDeviceExtensionString; return mDeviceExtensionString;
} }
} }
...@@ -11,8 +11,8 @@ ...@@ -11,8 +11,8 @@
#define LIBANGLE_DEVICE_H_ #define LIBANGLE_DEVICE_H_
#include "common/angleutils.h" #include "common/angleutils.h"
#include "libANGLE/Error.h"
#include "libANGLE/Display.h" #include "libANGLE/Display.h"
#include "libANGLE/Error.h"
#include <memory> #include <memory>
...@@ -50,7 +50,6 @@ class Device final : angle::NonCopyable ...@@ -50,7 +50,6 @@ class Device final : angle::NonCopyable
DeviceExtensions mDeviceExtensions; DeviceExtensions mDeviceExtensions;
std::string mDeviceExtensionString; std::string mDeviceExtensionString;
}; };
} }
#endif // LIBANGLE_DEVICE_H_ #endif // LIBANGLE_DEVICE_H_
...@@ -16,8 +16,8 @@ ...@@ -16,8 +16,8 @@
#include <sstream> #include <sstream>
#include <vector> #include <vector>
#include <platform/Platform.h>
#include <EGL/eglext.h> #include <EGL/eglext.h>
#include <platform/Platform.h>
#include "common/debug.h" #include "common/debug.h"
#include "common/mathutil.h" #include "common/mathutil.h"
...@@ -36,23 +36,23 @@ ...@@ -36,23 +36,23 @@
#include "third_party/trace_event/trace_event.h" #include "third_party/trace_event/trace_event.h"
#if defined(ANGLE_ENABLE_D3D9) || defined(ANGLE_ENABLE_D3D11) #if defined(ANGLE_ENABLE_D3D9) || defined(ANGLE_ENABLE_D3D11)
# include "libANGLE/renderer/d3d/DisplayD3D.h" #include "libANGLE/renderer/d3d/DisplayD3D.h"
#endif #endif
#if defined(ANGLE_ENABLE_OPENGL) #if defined(ANGLE_ENABLE_OPENGL)
# if defined(ANGLE_PLATFORM_WINDOWS) #if defined(ANGLE_PLATFORM_WINDOWS)
# include "libANGLE/renderer/gl/wgl/DisplayWGL.h" #include "libANGLE/renderer/gl/wgl/DisplayWGL.h"
# elif defined(ANGLE_USE_X11) #elif defined(ANGLE_USE_X11)
# include "libANGLE/renderer/gl/glx/DisplayGLX.h" #include "libANGLE/renderer/gl/glx/DisplayGLX.h"
# elif defined(ANGLE_PLATFORM_APPLE) #elif defined(ANGLE_PLATFORM_APPLE)
# include "libANGLE/renderer/gl/cgl/DisplayCGL.h" #include "libANGLE/renderer/gl/cgl/DisplayCGL.h"
# elif defined(ANGLE_USE_OZONE) #elif defined(ANGLE_USE_OZONE)
# include "libANGLE/renderer/gl/egl/ozone/DisplayOzone.h" #include "libANGLE/renderer/gl/egl/ozone/DisplayOzone.h"
# elif defined(ANGLE_PLATFORM_ANDROID) #elif defined(ANGLE_PLATFORM_ANDROID)
# include "libANGLE/renderer/gl/egl/android/DisplayAndroid.h" #include "libANGLE/renderer/gl/egl/android/DisplayAndroid.h"
# else #else
# error Unsupported OpenGL platform. #error Unsupported OpenGL platform.
# endif #endif
#endif #endif
#if defined(ANGLE_ENABLE_NULL) #if defined(ANGLE_ENABLE_NULL)
...@@ -77,7 +77,7 @@ namespace egl ...@@ -77,7 +77,7 @@ namespace egl
namespace namespace
{ {
typedef std::map<EGLNativeWindowType, Surface*> WindowSurfaceMap; typedef std::map<EGLNativeWindowType, Surface *> WindowSurfaceMap;
// Get a map of all EGL window surfaces to validate that no window has more than one EGL surface // Get a map of all EGL window surfaces to validate that no window has more than one EGL surface
// associated with it. // associated with it.
static WindowSurfaceMap *GetWindowSurfaces() static WindowSurfaceMap *GetWindowSurfaces()
...@@ -592,7 +592,7 @@ Error Display::terminate() ...@@ -592,7 +592,7 @@ Error Display::terminate()
return NoError(); return NoError();
} }
std::vector<const Config*> Display::getConfigs(const egl::AttributeMap &attribs) const std::vector<const Config *> Display::getConfigs(const egl::AttributeMap &attribs) const
{ {
return mConfigSet.filter(attribs); return mConfigSet.filter(attribs);
} }
...@@ -825,7 +825,8 @@ Error Display::restoreLostDevice() ...@@ -825,7 +825,8 @@ Error Display::restoreLostDevice()
{ {
if ((*ctx)->isResetNotificationEnabled()) if ((*ctx)->isResetNotificationEnabled())
{ {
// If reset notifications have been requested, application must delete all contexts first // If reset notifications have been requested, application must delete all contexts
// first
return EglContextLost(); return EglContextLost();
} }
} }
...@@ -841,7 +842,8 @@ Error Display::destroySurface(Surface *surface) ...@@ -841,7 +842,8 @@ Error Display::destroySurface(Surface *surface)
ASSERT(windowSurfaces); ASSERT(windowSurfaces);
bool surfaceRemoved = false; bool surfaceRemoved = false;
for (WindowSurfaceMap::iterator iter = windowSurfaces->begin(); iter != windowSurfaces->end(); iter++) for (WindowSurfaceMap::iterator iter = windowSurfaces->begin();
iter != windowSurfaces->end(); iter++)
{ {
if (iter->second == surface) if (iter->second == surface)
{ {
...@@ -919,7 +921,8 @@ void Display::notifyDeviceLost() ...@@ -919,7 +921,8 @@ void Display::notifyDeviceLost()
return; return;
} }
for (ContextSet::iterator context = mContextSet.begin(); context != mContextSet.end(); context++) for (ContextSet::iterator context = mContextSet.begin(); context != mContextSet.end();
context++)
{ {
(*context)->markContextLost(); (*context)->markContextLost();
} }
...@@ -1027,7 +1030,8 @@ static std::string GenerateExtensionsString(const T &extensions) ...@@ -1027,7 +1030,8 @@ static std::string GenerateExtensionsString(const T &extensions)
std::vector<std::string> extensionsVector = extensions.getStrings(); std::vector<std::string> extensionsVector = extensions.getStrings();
std::ostringstream stream; std::ostringstream stream;
std::copy(extensionsVector.begin(), extensionsVector.end(), std::ostream_iterator<std::string>(stream, " ")); std::copy(extensionsVector.begin(), extensionsVector.end(),
std::ostream_iterator<std::string>(stream, " "));
return stream.str(); return stream.str();
} }
...@@ -1115,8 +1119,7 @@ bool Display::isValidNativeDisplay(EGLNativeDisplayType display) ...@@ -1115,8 +1119,7 @@ bool Display::isValidNativeDisplay(EGLNativeDisplayType display)
} }
#if defined(ANGLE_PLATFORM_WINDOWS) && !defined(ANGLE_ENABLE_WINDOWS_STORE) #if defined(ANGLE_PLATFORM_WINDOWS) && !defined(ANGLE_ENABLE_WINDOWS_STORE)
if (display == EGL_SOFTWARE_DISPLAY_ANGLE || if (display == EGL_SOFTWARE_DISPLAY_ANGLE || display == EGL_D3D11_ELSE_D3D9_DISPLAY_ANGLE ||
display == EGL_D3D11_ELSE_D3D9_DISPLAY_ANGLE ||
display == EGL_D3D11_ONLY_DISPLAY_ANGLE) display == EGL_D3D11_ONLY_DISPLAY_ANGLE)
{ {
return true; return true;
......
...@@ -181,7 +181,7 @@ class Display final : angle::NonCopyable ...@@ -181,7 +181,7 @@ class Display final : angle::NonCopyable
ConfigSet mConfigSet; ConfigSet mConfigSet;
typedef std::set<gl::Context*> ContextSet; typedef std::set<gl::Context *> ContextSet;
ContextSet mContextSet; ContextSet mContextSet;
typedef std::set<Image *> ImageSet; typedef std::set<Image *> ImageSet;
......
...@@ -10,10 +10,10 @@ ...@@ -10,10 +10,10 @@
#include "common/debug.h" #include "common/debug.h"
#include "common/utilities.h" #include "common/utilities.h"
#include "libANGLE/Renderbuffer.h"
#include "libANGLE/Texture.h"
#include "libANGLE/angletypes.h" #include "libANGLE/angletypes.h"
#include "libANGLE/formatutils.h" #include "libANGLE/formatutils.h"
#include "libANGLE/Texture.h"
#include "libANGLE/Renderbuffer.h"
#include "libANGLE/renderer/EGLImplFactory.h" #include "libANGLE/renderer/EGLImplFactory.h"
#include "libANGLE/renderer/ImageImpl.h" #include "libANGLE/renderer/ImageImpl.h"
......
...@@ -9,8 +9,8 @@ ...@@ -9,8 +9,8 @@
#include "libANGLE/Stream.h" #include "libANGLE/Stream.h"
#include <platform/Platform.h>
#include <EGL/eglext.h> #include <EGL/eglext.h>
#include <platform/Platform.h>
#include "common/debug.h" #include "common/debug.h"
#include "common/mathutil.h" #include "common/mathutil.h"
......
...@@ -65,7 +65,8 @@ Surface::Surface(EGLint surfaceType, ...@@ -65,7 +65,8 @@ Surface::Surface(EGLint surfaceType,
mDSFormat(config->depthStencilFormat), mDSFormat(config->depthStencilFormat),
mInitState(gl::InitState::Initialized) mInitState(gl::InitState::Initialized)
{ {
mPostSubBufferRequested = (attributes.get(EGL_POST_SUB_BUFFER_SUPPORTED_NV, EGL_FALSE) == EGL_TRUE); mPostSubBufferRequested =
(attributes.get(EGL_POST_SUB_BUFFER_SUPPORTED_NV, EGL_FALSE) == EGL_TRUE);
mFlexibleSurfaceCompatibilityRequested = mFlexibleSurfaceCompatibilityRequested =
(attributes.get(EGL_FLEXIBLE_SURFACE_COMPATIBILITY_SUPPORTED_ANGLE, EGL_FALSE) == EGL_TRUE); (attributes.get(EGL_FLEXIBLE_SURFACE_COMPATIBILITY_SUPPORTED_ANGLE, EGL_FALSE) == EGL_TRUE);
......
...@@ -39,15 +39,24 @@ Error ValidateContext(const Display *display, const gl::Context *context); ...@@ -39,15 +39,24 @@ Error ValidateContext(const Display *display, const gl::Context *context);
Error ValidateImage(const Display *display, const Image *image); Error ValidateImage(const Display *display, const Image *image);
// Entry point validation // Entry point validation
Error ValidateCreateContext(Display *display, Config *configuration, gl::Context *shareContext, Error ValidateCreateContext(Display *display,
const AttributeMap& attributes); Config *configuration,
gl::Context *shareContext,
const AttributeMap &attributes);
Error ValidateCreateWindowSurface(Display *display, Config *config, EGLNativeWindowType window, Error ValidateCreateWindowSurface(Display *display,
const AttributeMap& attributes); Config *config,
EGLNativeWindowType window,
const AttributeMap &attributes);
Error ValidateCreatePbufferSurface(Display *display, Config *config, const AttributeMap& attributes); Error ValidateCreatePbufferSurface(Display *display,
Error ValidateCreatePbufferFromClientBuffer(Display *display, EGLenum buftype, EGLClientBuffer buffer, Config *config,
Config *config, const AttributeMap& attributes); const AttributeMap &attributes);
Error ValidateCreatePbufferFromClientBuffer(Display *display,
EGLenum buftype,
EGLClientBuffer buffer,
Config *config,
const AttributeMap &attributes);
Error ValidateMakeCurrent(Display *display, Surface *draw, Surface *read, gl::Context *context); Error ValidateMakeCurrent(Display *display, Surface *draw, Surface *read, gl::Context *context);
......
...@@ -10,10 +10,10 @@ ...@@ -10,10 +10,10 @@
#include "libGLESv2/global_state.h" #include "libGLESv2/global_state.h"
#include "libANGLE/Context.h" #include "libANGLE/Context.h"
#include "libANGLE/Display.h"
#include "libANGLE/Device.h" #include "libANGLE/Device.h"
#include "libANGLE/Surface.h" #include "libANGLE/Display.h"
#include "libANGLE/Stream.h" #include "libANGLE/Stream.h"
#include "libANGLE/Surface.h"
#include "libANGLE/Thread.h" #include "libANGLE/Thread.h"
#include "libANGLE/validationEGL.h" #include "libANGLE/validationEGL.h"
...@@ -23,14 +23,19 @@ namespace egl ...@@ -23,14 +23,19 @@ namespace egl
{ {
// EGL_ANGLE_query_surface_pointer // EGL_ANGLE_query_surface_pointer
EGLBoolean EGLAPIENTRY QuerySurfacePointerANGLE(EGLDisplay dpy, EGLSurface surface, EGLint attribute, void **value) EGLBoolean EGLAPIENTRY QuerySurfacePointerANGLE(EGLDisplay dpy,
EGLSurface surface,
EGLint attribute,
void **value)
{ {
EVENT("(EGLDisplay dpy = 0x%0.8p, EGLSurface surface = 0x%0.8p, EGLint attribute = %d, void **value = 0x%0.8p)", EVENT(
"(EGLDisplay dpy = 0x%0.8p, EGLSurface surface = 0x%0.8p, EGLint attribute = %d, void "
"**value = 0x%0.8p)",
dpy, surface, attribute, value); dpy, surface, attribute, value);
Thread *thread = GetCurrentThread(); Thread *thread = GetCurrentThread();
Display *display = static_cast<Display*>(dpy); Display *display = static_cast<Display *>(dpy);
Surface *eglSurface = static_cast<Surface*>(surface); Surface *eglSurface = static_cast<Surface *>(surface);
Error error = ValidateSurface(display, eglSurface); Error error = ValidateSurface(display, eglSurface);
if (error.isError()) if (error.isError())
...@@ -78,11 +83,14 @@ EGLBoolean EGLAPIENTRY QuerySurfacePointerANGLE(EGLDisplay dpy, EGLSurface surfa ...@@ -78,11 +83,14 @@ EGLBoolean EGLAPIENTRY QuerySurfacePointerANGLE(EGLDisplay dpy, EGLSurface surfa
return (error.isError() ? EGL_FALSE : EGL_TRUE); return (error.isError() ? EGL_FALSE : EGL_TRUE);
} }
// EGL_NV_post_sub_buffer // EGL_NV_post_sub_buffer
EGLBoolean EGLAPIENTRY PostSubBufferNV(EGLDisplay dpy, EGLSurface surface, EGLint x, EGLint y, EGLint width, EGLint height) 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); 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(); Thread *thread = GetCurrentThread();
if (x < 0 || y < 0 || width < 0 || height < 0) if (x < 0 || y < 0 || width < 0 || height < 0)
...@@ -91,8 +99,8 @@ EGLBoolean EGLAPIENTRY PostSubBufferNV(EGLDisplay dpy, EGLSurface surface, EGLin ...@@ -91,8 +99,8 @@ EGLBoolean EGLAPIENTRY PostSubBufferNV(EGLDisplay dpy, EGLSurface surface, EGLin
return EGL_FALSE; return EGL_FALSE;
} }
Display *display = static_cast<Display*>(dpy); Display *display = static_cast<Display *>(dpy);
Surface *eglSurface = static_cast<Surface*>(surface); Surface *eglSurface = static_cast<Surface *>(surface);
Error error = ValidateSurface(display, eglSurface); Error error = ValidateSurface(display, eglSurface);
if (error.isError()) if (error.isError())
...@@ -133,9 +141,13 @@ EGLBoolean EGLAPIENTRY PostSubBufferNV(EGLDisplay dpy, EGLSurface surface, EGLin ...@@ -133,9 +141,13 @@ EGLBoolean EGLAPIENTRY PostSubBufferNV(EGLDisplay dpy, EGLSurface surface, EGLin
} }
// EGL_EXT_platform_base // EGL_EXT_platform_base
EGLDisplay EGLAPIENTRY GetPlatformDisplayEXT(EGLenum platform, void *native_display, const EGLint *attrib_list) EGLDisplay EGLAPIENTRY GetPlatformDisplayEXT(EGLenum platform,
void *native_display,
const EGLint *attrib_list)
{ {
EVENT("(EGLenum platform = %d, void* native_display = 0x%0.8p, const EGLint* attrib_list = 0x%0.8p)", EVENT(
"(EGLenum platform = %d, void* native_display = 0x%0.8p, const EGLint* attrib_list = "
"0x%0.8p)",
platform, native_display, attrib_list); platform, native_display, attrib_list);
Thread *thread = GetCurrentThread(); Thread *thread = GetCurrentThread();
...@@ -219,7 +231,7 @@ EGLBoolean EGLAPIENTRY QueryDeviceAttribEXT(EGLDeviceEXT device, EGLint attribut ...@@ -219,7 +231,7 @@ EGLBoolean EGLAPIENTRY QueryDeviceAttribEXT(EGLDeviceEXT device, EGLint attribut
device, attribute, value); device, attribute, value);
Thread *thread = GetCurrentThread(); Thread *thread = GetCurrentThread();
Device *dev = static_cast<Device*>(device); Device *dev = static_cast<Device *>(device);
if (dev == EGL_NO_DEVICE_EXT || !Device::IsValidDevice(dev)) if (dev == EGL_NO_DEVICE_EXT || !Device::IsValidDevice(dev))
{ {
thread->setError(EglBadAccess()); thread->setError(EglBadAccess());
...@@ -261,13 +273,12 @@ EGLBoolean EGLAPIENTRY QueryDeviceAttribEXT(EGLDeviceEXT device, EGLint attribut ...@@ -261,13 +273,12 @@ EGLBoolean EGLAPIENTRY QueryDeviceAttribEXT(EGLDeviceEXT device, EGLint attribut
} }
// EGL_EXT_device_query // EGL_EXT_device_query
const char * EGLAPIENTRY QueryDeviceStringEXT(EGLDeviceEXT device, EGLint name) const char *EGLAPIENTRY QueryDeviceStringEXT(EGLDeviceEXT device, EGLint name)
{ {
EVENT("(EGLDeviceEXT device = 0x%0.8p, EGLint name = %d)", EVENT("(EGLDeviceEXT device = 0x%0.8p, EGLint name = %d)", device, name);
device, name);
Thread *thread = GetCurrentThread(); Thread *thread = GetCurrentThread();
Device *dev = static_cast<Device*>(device); Device *dev = static_cast<Device *>(device);
if (dev == EGL_NO_DEVICE_EXT || !Device::IsValidDevice(dev)) if (dev == EGL_NO_DEVICE_EXT || !Device::IsValidDevice(dev))
{ {
thread->setError(EglBadDevice()); thread->setError(EglBadDevice());
...@@ -292,11 +303,11 @@ const char * EGLAPIENTRY QueryDeviceStringEXT(EGLDeviceEXT device, EGLint name) ...@@ -292,11 +303,11 @@ const char * EGLAPIENTRY QueryDeviceStringEXT(EGLDeviceEXT device, EGLint name)
// EGL_EXT_device_query // EGL_EXT_device_query
EGLBoolean EGLAPIENTRY QueryDisplayAttribEXT(EGLDisplay dpy, EGLint attribute, EGLAttrib *value) EGLBoolean EGLAPIENTRY QueryDisplayAttribEXT(EGLDisplay dpy, EGLint attribute, EGLAttrib *value)
{ {
EVENT("(EGLDisplay dpy = 0x%0.8p, EGLint attribute = %d, EGLAttrib *value = 0x%0.8p)", EVENT("(EGLDisplay dpy = 0x%0.8p, EGLint attribute = %d, EGLAttrib *value = 0x%0.8p)", dpy,
dpy, attribute, value); attribute, value);
Thread *thread = GetCurrentThread(); Thread *thread = GetCurrentThread();
Display *display = static_cast<Display*>(dpy); Display *display = static_cast<Display *>(dpy);
Error error = ValidateDisplay(display); Error error = ValidateDisplay(display);
if (error.isError()) if (error.isError())
......
...@@ -17,13 +17,23 @@ namespace egl ...@@ -17,13 +17,23 @@ namespace egl
{ {
// EGL_ANGLE_query_surface_pointer // EGL_ANGLE_query_surface_pointer
ANGLE_EXPORT EGLBoolean EGLAPIENTRY QuerySurfacePointerANGLE(EGLDisplay dpy, EGLSurface surface, EGLint attribute, void **value); ANGLE_EXPORT EGLBoolean EGLAPIENTRY QuerySurfacePointerANGLE(EGLDisplay dpy,
EGLSurface surface,
EGLint attribute,
void **value);
// EGL_NV_post_sub_buffer // EGL_NV_post_sub_buffer
ANGLE_EXPORT EGLBoolean EGLAPIENTRY PostSubBufferNV(EGLDisplay dpy, EGLSurface surface, EGLint x, EGLint y, EGLint width, EGLint height); ANGLE_EXPORT EGLBoolean EGLAPIENTRY PostSubBufferNV(EGLDisplay dpy,
EGLSurface surface,
EGLint x,
EGLint y,
EGLint width,
EGLint height);
// EGL_EXT_platform_base // EGL_EXT_platform_base
ANGLE_EXPORT EGLDisplay EGLAPIENTRY GetPlatformDisplayEXT(EGLenum platform, void *native_display, const EGLint *attrib_list); ANGLE_EXPORT EGLDisplay EGLAPIENTRY GetPlatformDisplayEXT(EGLenum platform,
void *native_display,
const EGLint *attrib_list);
ANGLE_EXPORT EGLSurface EGLAPIENTRY CreatePlatformWindowSurfaceEXT(EGLDisplay dpy, ANGLE_EXPORT EGLSurface EGLAPIENTRY CreatePlatformWindowSurfaceEXT(EGLDisplay dpy,
EGLConfig config, EGLConfig config,
void *native_window, void *native_window,
...@@ -34,9 +44,13 @@ ANGLE_EXPORT EGLSurface EGLAPIENTRY CreatePlatformPixmapSurfaceEXT(EGLDisplay dp ...@@ -34,9 +44,13 @@ ANGLE_EXPORT EGLSurface EGLAPIENTRY CreatePlatformPixmapSurfaceEXT(EGLDisplay dp
const EGLint *attrib_list); const EGLint *attrib_list);
// EGL_EXT_device_query // EGL_EXT_device_query
ANGLE_EXPORT EGLBoolean EGLAPIENTRY QueryDisplayAttribEXT(EGLDisplay dpy, EGLint attribute, EGLAttrib *value); ANGLE_EXPORT EGLBoolean EGLAPIENTRY QueryDisplayAttribEXT(EGLDisplay dpy,
ANGLE_EXPORT EGLBoolean EGLAPIENTRY QueryDeviceAttribEXT(EGLDeviceEXT device, EGLint attribute, EGLAttrib *value); EGLint attribute,
ANGLE_EXPORT const char * EGLAPIENTRY QueryDeviceStringEXT(EGLDeviceEXT device, EGLint name); EGLAttrib *value);
ANGLE_EXPORT EGLBoolean EGLAPIENTRY QueryDeviceAttribEXT(EGLDeviceEXT device,
EGLint attribute,
EGLAttrib *value);
ANGLE_EXPORT const char *EGLAPIENTRY QueryDeviceStringEXT(EGLDeviceEXT device, EGLint name);
// EGL_KHR_image_base/EGL_KHR_image // EGL_KHR_image_base/EGL_KHR_image
ANGLE_EXPORT EGLImageKHR EGLAPIENTRY CreateImageKHR(EGLDisplay dpy, ANGLE_EXPORT EGLImageKHR EGLAPIENTRY CreateImageKHR(EGLDisplay dpy,
......
...@@ -45,8 +45,10 @@ ...@@ -45,8 +45,10 @@
#define ASSERT_EGL_ERROR(err) ASSERT_EQ((err), eglGetError()) #define ASSERT_EGL_ERROR(err) ASSERT_EQ((err), eglGetError())
#define ASSERT_EGL_SUCCESS() ASSERT_EGL_ERROR(EGL_SUCCESS) #define ASSERT_EGL_SUCCESS() ASSERT_EGL_ERROR(EGL_SUCCESS)
#define ASSERT_GLENUM_EQ(expected, actual) ASSERT_EQ(static_cast<GLenum>(expected), static_cast<GLenum>(actual)) #define ASSERT_GLENUM_EQ(expected, actual) \
#define EXPECT_GLENUM_EQ(expected, actual) EXPECT_EQ(static_cast<GLenum>(expected), static_cast<GLenum>(actual)) ASSERT_EQ(static_cast<GLenum>(expected), static_cast<GLenum>(actual))
#define EXPECT_GLENUM_EQ(expected, actual) \
EXPECT_EQ(static_cast<GLenum>(expected), static_cast<GLenum>(actual))
#define ASSERT_GLENUM_NE(expected, actual) \ #define ASSERT_GLENUM_NE(expected, actual) \
ASSERT_NE(static_cast<GLenum>(expected), static_cast<GLenum>(actual)) ASSERT_NE(static_cast<GLenum>(expected), static_cast<GLenum>(actual))
#define EXPECT_GLENUM_NE(expected, actual) \ #define EXPECT_GLENUM_NE(expected, actual) \
...@@ -168,16 +170,15 @@ GLColor32F ReadColor32F(GLint x, GLint y); ...@@ -168,16 +170,15 @@ GLColor32F ReadColor32F(GLint x, GLint y);
#define EXPECT_PIXEL_RECT_EQ(x, y, width, height, color) \ #define EXPECT_PIXEL_RECT_EQ(x, y, width, height, color) \
\ \
{ \ { \
std::vector<GLColor> actualColors(width *height); \ std::vector<GLColor> actualColors(width *height); \
glReadPixels((x), (y), (width), (height), GL_RGBA, GL_UNSIGNED_BYTE, actualColors.data()); \ glReadPixels((x), (y), (width), (height), GL_RGBA, GL_UNSIGNED_BYTE, actualColors.data()); \
std::vector<GLColor> expectedColors(width *height, color); \ std::vector<GLColor> expectedColors(width *height, color); \
EXPECT_EQ(expectedColors, actualColors); \ EXPECT_EQ(expectedColors, actualColors); \
\ }
}
#define EXPECT_PIXEL_NEAR(x, y, r, g, b, a, abs_error) \ #define EXPECT_PIXEL_NEAR(x, y, r, g, b, a, abs_error) \
{ \ { \
GLubyte pixel[4]; \ GLubyte pixel[4]; \
glReadPixels((x), (y), 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, pixel); \ glReadPixels((x), (y), 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, pixel); \
EXPECT_GL_NO_ERROR(); \ EXPECT_GL_NO_ERROR(); \
...@@ -185,7 +186,7 @@ GLColor32F ReadColor32F(GLint x, GLint y); ...@@ -185,7 +186,7 @@ GLColor32F ReadColor32F(GLint x, GLint y);
EXPECT_NEAR((g), pixel[1], abs_error); \ EXPECT_NEAR((g), pixel[1], abs_error); \
EXPECT_NEAR((b), pixel[2], abs_error); \ EXPECT_NEAR((b), pixel[2], abs_error); \
EXPECT_NEAR((a), pixel[3], abs_error); \ EXPECT_NEAR((a), pixel[3], abs_error); \
} }
#define EXPECT_PIXEL32F_NEAR(x, y, r, g, b, a, abs_error) \ #define EXPECT_PIXEL32F_NEAR(x, y, r, g, b, a, abs_error) \
\ \
...@@ -208,13 +209,12 @@ GLColor32F ReadColor32F(GLint x, GLint y); ...@@ -208,13 +209,12 @@ GLColor32F ReadColor32F(GLint x, GLint y);
#define EXPECT_COLOR_NEAR(expected, actual, abs_error) \ #define EXPECT_COLOR_NEAR(expected, actual, abs_error) \
\ \
{ \ { \
EXPECT_NEAR(expected.R, actual.R, abs_error); \ EXPECT_NEAR(expected.R, actual.R, abs_error); \
EXPECT_NEAR(expected.G, actual.G, abs_error); \ EXPECT_NEAR(expected.G, actual.G, abs_error); \
EXPECT_NEAR(expected.B, actual.B, abs_error); \ EXPECT_NEAR(expected.B, actual.B, abs_error); \
EXPECT_NEAR(expected.A, actual.A, abs_error); \ EXPECT_NEAR(expected.A, actual.A, abs_error); \
\ }
}
#define EXPECT_PIXEL32F_NEAR(x, y, r, g, b, a, abs_error) \ #define EXPECT_PIXEL32F_NEAR(x, y, r, g, b, a, abs_error) \
\ \
{ \ { \
...@@ -453,12 +453,12 @@ bool IsRelease(); ...@@ -453,12 +453,12 @@ bool IsRelease();
// Note: git cl format messes up this formatting. // Note: git cl format messes up this formatting.
#define ANGLE_SKIP_TEST_IF(COND) \ #define ANGLE_SKIP_TEST_IF(COND) \
\ \
if(COND) \ if (COND) \
\ \
{ \ { \
std::cout << "Test skipped: " #COND "." << std::endl; \ std::cout << "Test skipped: " #COND "." << std::endl; \
return; \ return; \
\ } \
} ANGLE_EMPTY_STATEMENT ANGLE_EMPTY_STATEMENT
#endif // ANGLE_TESTS_ANGLE_TEST_H_ #endif // ANGLE_TESTS_ANGLE_TEST_H_
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