Commit dbffdfbd by Jamie Madill Committed by Commit Bot

Fix counting of the new platform methods.

The context pointer was throwing off the count by one. Also change the type to void * for ease of use. BUG=angleproject:1892 BUG=chromium:678870 Change-Id: Iffac667f0aa896d9247e9ffddfeb3bc447a9692f Reviewed-on: https://chromium-review.googlesource.com/441931Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent b1eeba1f
...@@ -351,12 +351,13 @@ struct PlatformMethods ...@@ -351,12 +351,13 @@ struct PlatformMethods
ANGLE_PLATFORM_OP(ANGLE_PLATFORM_METHOD_DEF); ANGLE_PLATFORM_OP(ANGLE_PLATFORM_METHOD_DEF);
// User data pointer for any implementation specific members. // User data pointer for any implementation specific members.
uintptr_t context = 0; void *context = 0;
}; };
#undef ANGLE_PLATFORM_METHOD_DEF #undef ANGLE_PLATFORM_METHOD_DEF
constexpr unsigned int g_NumPlatformMethods = sizeof(PlatformMethods) / sizeof(uintptr_t); // Subtrace one to account for the context pointer.
constexpr unsigned int g_NumPlatformMethods = (sizeof(PlatformMethods) / sizeof(uintptr_t)) - 1;
#define ANGLE_PLATFORM_METHOD_STRING(Name) #Name #define ANGLE_PLATFORM_METHOD_STRING(Name) #Name
#define ANGLE_PLATFORM_METHOD_STRING2(Name) ANGLE_PLATFORM_METHOD_STRING(Name), #define ANGLE_PLATFORM_METHOD_STRING2(Name) ANGLE_PLATFORM_METHOD_STRING(Name),
...@@ -379,7 +380,7 @@ ANGLE_PLATFORM_EXPORT bool ANGLE_APIENTRY ...@@ -379,7 +380,7 @@ ANGLE_PLATFORM_EXPORT bool ANGLE_APIENTRY
ANGLEGetDisplayPlatform(angle::EGLDisplayType display, ANGLEGetDisplayPlatform(angle::EGLDisplayType display,
const char *const methodNames[], const char *const methodNames[],
unsigned int methodNameCount, unsigned int methodNameCount,
uintptr_t context, void *context,
angle::PlatformMethods **platformMethodsOut); angle::PlatformMethods **platformMethodsOut);
// Sets the platform methods back to their defaults. // Sets the platform methods back to their defaults.
......
...@@ -146,7 +146,7 @@ void ANGLE_APIENTRY ANGLEPlatformShutdown() ...@@ -146,7 +146,7 @@ void ANGLE_APIENTRY ANGLEPlatformShutdown()
bool ANGLE_APIENTRY ANGLEGetDisplayPlatform(angle::EGLDisplayType display, bool ANGLE_APIENTRY ANGLEGetDisplayPlatform(angle::EGLDisplayType display,
const char *const methodNames[], const char *const methodNames[],
unsigned int methodNameCount, unsigned int methodNameCount,
uintptr_t context, void *context,
angle::PlatformMethods **platformMethodsOut) angle::PlatformMethods **platformMethodsOut)
{ {
// We allow for a lower input count of impl platform methods if the subset is correct. // We allow for a lower input count of impl platform methods if the subset is correct.
......
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