aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2017-06-05 10:58:55 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-06-05 16:39:05 +0000
commitc1359888c021ad4594d22d849b2414fd0cdec6f5 (patch)
tree36b246f48333a555caf38186ab113f651328f634 /tools
parent5adb01bf0d190b20abe50fac608f396c65993424 (diff)
Destroy ANGLE displays in destroyGLContext
Bug: skia:6711 Change-Id: I770bb390d7b4e156116411bc6ce796375a6ddf21 Reviewed-on: https://skia-review.googlesource.com/18588 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/gpu/gl/angle/GLTestContext_angle.cpp26
1 files changed, 23 insertions, 3 deletions
diff --git a/tools/gpu/gl/angle/GLTestContext_angle.cpp b/tools/gpu/gl/angle/GLTestContext_angle.cpp
index c0ea48595c..a35a9cf9b9 100644
--- a/tools/gpu/gl/angle/GLTestContext_angle.cpp
+++ b/tools/gpu/gl/angle/GLTestContext_angle.cpp
@@ -161,6 +161,24 @@ ANGLEGLContext::ANGLEGLContext(ANGLEBackend type, ANGLEContextVersion version,
return;
}
+#ifdef SK_DEBUG
+ // Verify that the interface we requested was actuall returned to us
+ const GrGLubyte* rendererUByte;
+ GR_GL_CALL_RET(gl.get(), rendererUByte, GetString(GR_GL_RENDERER));
+ const char* renderer = reinterpret_cast<const char*>(rendererUByte);
+ switch (type) {
+ case ANGLEBackend::kD3D9:
+ SkASSERT(strstr(renderer, "Direct3D9"));
+ break;
+ case ANGLEBackend::kD3D11:
+ SkASSERT(strstr(renderer, "Direct3D11"));
+ break;
+ case ANGLEBackend::kOpenGL:
+ SkASSERT(strstr(renderer, "OpenGL"));
+ break;
+ }
+#endif
+
this->init(gl.release());
}
@@ -229,7 +247,7 @@ std::unique_ptr<sk_gpu_test::GLTestContext> ANGLEGLContext::makeNew() const {
void ANGLEGLContext::destroyGLContext() {
if (fDisplay) {
- eglMakeCurrent(fDisplay, 0, 0, 0);
+ eglMakeCurrent(fDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
if (fContext) {
eglDestroyContext(fDisplay, fContext);
@@ -241,8 +259,10 @@ void ANGLEGLContext::destroyGLContext() {
fSurface = EGL_NO_SURFACE;
}
- //TODO should we close the display?
- fDisplay = EGL_NO_DISPLAY;
+ if (EGL_NO_DISPLAY != fDisplay) {
+ eglTerminate(fDisplay);
+ fDisplay = EGL_NO_DISPLAY;
+ }
}
}