diff options
author | Brian Osman <brianosman@google.com> | 2017-02-24 11:57:23 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-02-24 18:28:32 +0000 |
commit | fd8f4d502d7c7e861de7b361c8e13aacfbc49fb2 (patch) | |
tree | f7795296e25cbd7490c291ebdf3c8e57623d5edc /tools/viewer/Viewer.h | |
parent | e30f758525e39079dbfb5f8a8cf0c48898da10b1 (diff) |
Fix some viewer crashes when switching color mode
The whole idea of immediate mode GUIs is to put your GUI code and the
resulting action close together. Unfortunately, for actions that tear
down the backend (possibly freeing the surfaces we're drawing to), we
can't do that. So defer that action until the next frame (really, the
next idle). Only required when an action might call setDisplayParams.
BUG=skia:
Change-Id: I3eb95fdb462526cb6d95819612ad2725c6f1050b
Reviewed-on: https://skia-review.googlesource.com/8953
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Diffstat (limited to 'tools/viewer/Viewer.h')
-rw-r--r-- | tools/viewer/Viewer.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/viewer/Viewer.h b/tools/viewer/Viewer.h index b17bd250db..1364592300 100644 --- a/tools/viewer/Viewer.h +++ b/tools/viewer/Viewer.h @@ -92,6 +92,8 @@ private: SkMatrix fDefaultMatrix; SkMatrix fDefaultMatrixInv; + SkTArray<std::function<void(void)>> fDeferredActions; + Json::Value fAllSlideNames; // cache all slide names for fast updateUIState }; |