Index: tools/VisualBench/VisualBench.cpp |
diff --git a/tools/VisualBench/VisualBench.cpp b/tools/VisualBench/VisualBench.cpp |
index 3c4120469b758a91300cef74415e8309b0f3cb52..92098aa3e822de50b94fde9c810a33600ea21a87 100644 |
--- a/tools/VisualBench/VisualBench.cpp |
+++ b/tools/VisualBench/VisualBench.cpp |
@@ -18,15 +18,21 @@ |
#include "SkStream.h" |
#include "Stats.h" |
#include "VisualLightweightBenchModule.h" |
+#include "VisualInteractiveModule.h" |
#include "gl/GrGLInterface.h" |
DEFINE_bool2(fullscreen, f, true, "Run fullscreen."); |
+DEFINE_bool2(interactive, n, false, "Run in interactive mode."); |
VisualBench::VisualBench(void* hwnd, int argc, char** argv) |
: INHERITED(hwnd) |
, fModule(new VisualLightweightBenchModule(this)) { |
SkCommandLineFlags::Parse(argc, argv); |
+ if (FLAGS_interactive) { |
+ fModule.reset(new VisualInteractiveModule(this)); |
+ } |
+ |
this->setTitle(); |
this->setupBackend(); |
} |
@@ -103,7 +109,13 @@ void VisualBench::onSizeChange() { |
} |
bool VisualBench::onHandleChar(SkUnichar unichar) { |
- return true; |
+ // ESC |
+ if (27 == unichar) { |
joshualitt
2015/09/14 14:07:45
static const kEscKey or something similar?
jvanverth1
2015/09/14 16:21:38
Done.
|
+ this->closeWindow(); |
+ return true; |
+ } |
+ |
+ return fModule->onHandleChar(unichar); |
} |
// Externally declared entry points |