diff options
author | hendrikw <hendrikw@chromium.org> | 2015-07-24 06:52:40 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-07-24 06:52:40 -0700 |
commit | 266c232104e465f807cf57b2855836b250146a02 (patch) | |
tree | 595a14e2c0103225f283d5eaadde3a9ea66e4df9 | |
parent | ba9757abc2750a4a49d1e9a586592e054b4c2c14 (diff) |
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
-rw-r--r-- | src/gpu/gl/angle/SkANGLEGLContext.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/gpu/gl/angle/SkANGLEGLContext.cpp b/src/gpu/gl/angle/SkANGLEGLContext.cpp index fec23e63e8..db34c563ea 100644 --- a/src/gpu/gl/angle/SkANGLEGLContext.cpp +++ b/src/gpu/gl/angle/SkANGLEGLContext.cpp @@ -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)); |