aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools
diff options
context:
space:
mode:
authorGravatar liyuqian <liyuqian@google.com>2016-06-08 11:17:09 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-06-08 11:17:09 -0700
commit2a437e64593ab597cf66d48b91cab0ab2ed76382 (patch)
treef4dab6fb906482e7f6d0f55fc96b898f8ca7dfc3 /tools
parentecbc12b1c1c72de0cf7bba4a3f6a7cce4f43bf41 (diff)
Provide filter when there are many options
Diffstat (limited to 'tools')
-rw-r--r--tools/viewer/sk_app/android/surface_glue_android.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/tools/viewer/sk_app/android/surface_glue_android.cpp b/tools/viewer/sk_app/android/surface_glue_android.cpp
index 1821a53efe..895b0bc459 100644
--- a/tools/viewer/sk_app/android/surface_glue_android.cpp
+++ b/tools/viewer/sk_app/android/surface_glue_android.cpp
@@ -114,11 +114,16 @@ int SkiaAndroidApp::message_callback(int fd, int events, void* data) {
break;
}
case kSurfaceChanged: {
- SkASSERT(message.fNativeWindow == skiaAndroidApp->fNativeWindow &&
- message.fNativeWindow);
+ SkASSERT(message.fNativeWindow);
int width = ANativeWindow_getWidth(skiaAndroidApp->fNativeWindow);
int height = ANativeWindow_getHeight(skiaAndroidApp->fNativeWindow);
auto window_android = (Window_android*)skiaAndroidApp->fWindow;
+ if (message.fNativeWindow != skiaAndroidApp->fNativeWindow) {
+ window_android->onDisplayDestroyed();
+ ANativeWindow_release(skiaAndroidApp->fNativeWindow);
+ skiaAndroidApp->fNativeWindow = message.fNativeWindow;
+ window_android->initDisplay(skiaAndroidApp->fNativeWindow);
+ }
window_android->setContentRect(0, 0, width, height);
window_android->paintIfNeeded();
break;