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

Unified Diff: tools/VisualBench/VisualBench.cpp

Issue 1336043003: Add viewer mode to VisualBench. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix short option again Created 5 years, 3 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
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
« no previous file with comments | « no previous file | tools/VisualBench/VisualInteractiveModule.h » ('j') | tools/VisualBench/VisualInteractiveModule.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698