Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(96)

Unified Diff: platform_tools/android/apps/visualbench/src/main/jni/SkOSWindow_AndroidNative.cpp

Issue 1416123003: Fix visualbench exiting on startup on android (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: platform_tools/android/apps/visualbench/src/main/jni/SkOSWindow_AndroidNative.cpp
diff --git a/platform_tools/android/apps/visualbench/src/main/jni/SkOSWindow_AndroidNative.cpp b/platform_tools/android/apps/visualbench/src/main/jni/SkOSWindow_AndroidNative.cpp
index 487835b31d14c4c6e57e49bf0903e7d147f7c780..a35742b2d084530ba3a2604f5cc07a91f3fac98a 100644
--- a/platform_tools/android/apps/visualbench/src/main/jni/SkOSWindow_AndroidNative.cpp
+++ b/platform_tools/android/apps/visualbench/src/main/jni/SkOSWindow_AndroidNative.cpp
@@ -18,19 +18,7 @@ SkOSWindow::SkOSWindow(void* hwnd) {
}
SkOSWindow::~SkOSWindow() {
- if (fWindow.fDisplay != EGL_NO_DISPLAY) {
- eglMakeCurrent(fWindow.fDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
- if (fWindow.fContext != EGL_NO_CONTEXT) {
- eglDestroyContext(fWindow.fDisplay, fWindow.fContext);
- }
- if (fWindow.fSurface != EGL_NO_SURFACE) {
- eglDestroySurface(fWindow.fDisplay, fWindow.fSurface);
- }
- eglTerminate(fWindow.fDisplay);
- }
- fWindow.fDisplay = EGL_NO_DISPLAY;
- fWindow.fContext = EGL_NO_CONTEXT;
- fWindow.fSurface = EGL_NO_SURFACE;
+ this->detach();
}
bool SkOSWindow::attach(SkBackEndTypes attachType,
@@ -147,7 +135,19 @@ bool SkOSWindow::attach(SkBackEndTypes attachType,
}
void SkOSWindow::detach() {
- fDestroyRequested = true;
+ if (fWindow.fDisplay != EGL_NO_DISPLAY) {
+ eglMakeCurrent(fWindow.fDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
+ if (fWindow.fContext != EGL_NO_CONTEXT) {
+ eglDestroyContext(fWindow.fDisplay, fWindow.fContext);
+ }
+ if (fWindow.fSurface != EGL_NO_SURFACE) {
+ eglDestroySurface(fWindow.fDisplay, fWindow.fSurface);
+ }
+ eglTerminate(fWindow.fDisplay);
+ }
+ fWindow.fDisplay = EGL_NO_DISPLAY;
+ fWindow.fContext = EGL_NO_CONTEXT;
+ fWindow.fSurface = EGL_NO_SURFACE;
}
void SkOSWindow::present() {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698