skia: wrong calling convention on eglGetPlatformDisplayEXT

When attempting to run the release compile of nanobench on windows, I would
immediately crash due to c++'s buffer security check.

This was caused by calling the function with the wrong calling
convention.  I'm not sure how this ever worked for anyone.

Anyway, fix is to use eglext.h's version of the function definition.

Review URL: https://codereview.chromium.org/1250383002
This commit is contained in:
hendrikw 2015-07-24 06:52:40 -07:00 committed by Commit bot
parent ba9757abc2
commit 266c232104

View File

@ -9,6 +9,7 @@
#include "gl/angle/SkANGLEGLContext.h"
#include <EGL/egl.h>
#include <EGL/eglext.h>
#define EGL_PLATFORM_ANGLE_ANGLE 0x3202
#define EGL_PLATFORM_ANGLE_TYPE_ANGLE 0x3203
@ -16,13 +17,9 @@
#define EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE 0x3208
void* SkANGLEGLContext::GetD3DEGLDisplay(void* nativeDisplay) {
typedef EGLDisplay (*EGLGetPlatformDisplayEXT)(EGLenum platform,
void *native_display,
const EGLint *attrib_list);
EGLGetPlatformDisplayEXT eglGetPlatformDisplayEXT;
PFNEGLGETPLATFORMDISPLAYEXTPROC eglGetPlatformDisplayEXT;
eglGetPlatformDisplayEXT =
(EGLGetPlatformDisplayEXT) eglGetProcAddress("eglGetPlatformDisplayEXT");
(PFNEGLGETPLATFORMDISPLAYEXTPROC)eglGetProcAddress("eglGetPlatformDisplayEXT");
if (!eglGetPlatformDisplayEXT) {
return eglGetDisplay(static_cast<EGLNativeDisplayType>(nativeDisplay));