aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--samplecode/SampleApp.cpp10
-rw-r--r--samplecode/SamplePathFinder.cpp10
2 files changed, 10 insertions, 10 deletions
diff --git a/samplecode/SampleApp.cpp b/samplecode/SampleApp.cpp
index 6a5d1fedb6..7f6a58812f 100644
--- a/samplecode/SampleApp.cpp
+++ b/samplecode/SampleApp.cpp
@@ -764,6 +764,7 @@ DEFINE_int32(measureMS, 0, "Number of miliseconds to measure the FPS before clos
"If it's 0, we won't measure the FPS or close SampleApp automatically.");
DEFINE_int32(width, 1024, "Width of the window");
DEFINE_int32(height, 768, "Height of the window");
+DEFINE_string(keys, "", "List of chars to automate keystrokes for on startup.");
#include "SkTaskGroup.h"
@@ -2534,7 +2535,14 @@ SkOSWindow* create_sk_window(void* hwnd, int argc, char** argv) {
if (false) { // avoid bit rot, suppress warning
test();
}
- return new SampleWindow(hwnd, argc, argv, nullptr);
+ SkOSWindow* window = new SampleWindow(hwnd, argc, argv, nullptr);
+ for (int i = 0; i < FLAGS_keys.count(); ++i) {
+ const char* keys = FLAGS_keys[i];
+ while (char keystroke = *keys++) {
+ window->handleChar(keystroke);
+ }
+ }
+ return window;
}
#ifdef SK_BUILD_FOR_IOS
diff --git a/samplecode/SamplePathFinder.cpp b/samplecode/SamplePathFinder.cpp
index 18d200bad1..7c7dca1576 100644
--- a/samplecode/SamplePathFinder.cpp
+++ b/samplecode/SamplePathFinder.cpp
@@ -16,8 +16,6 @@
#include "SkStream.h"
#include <stack>
-DEFINE_string(pathfinderTrail, "", "List of keystrokes to execute upon loading a pathfinder.");
-
/**
* This is a simple utility designed to extract the paths from an SKP file and then isolate a single
* one of them. Use the 'x' and 'X' keys to guide a binary search:
@@ -58,12 +56,6 @@ public:
}
pic->playback(this);
}
- for (int i = 0; i < FLAGS_pathfinderTrail.count(); ++i) {
- const char* key = FLAGS_pathfinderTrail[i];
- while (*key) {
- this->handleKeystroke(*key++);
- }
- }
}
~PathFinderView() override {}
@@ -132,7 +124,7 @@ private:
case 'D':
SkDebugf("SampleApp --pathfinder %s", fFilename.c_str());
if (!fTrail.empty()) {
- SkDebugf(" --pathfinderTrail ", fFilename.c_str());
+ SkDebugf(" --keys ");
for (char ch : fTrail) {
SkDebugf("%c", ch);
}