diff options
-rw-r--r-- | samplecode/SampleApp.cpp | 11 | ||||
-rw-r--r-- | samplecode/SampleApp.h | 1 |
2 files changed, 12 insertions, 0 deletions
diff --git a/samplecode/SampleApp.cpp b/samplecode/SampleApp.cpp index 213a39f0c4..05f9c82031 100644 --- a/samplecode/SampleApp.cpp +++ b/samplecode/SampleApp.cpp @@ -691,6 +691,7 @@ SampleWindow::SampleWindow(void* hwnd, int argc, char** argv, DeviceManager* dev fCurrIndex = findByTitle(*argv); if (fCurrIndex < 0) { fprintf(stderr, "Unknown sample \"%s\"\n", *argv); + listTitles(); } } } else if (strcmp(*argv, "--msaa") == 0) { @@ -698,6 +699,8 @@ SampleWindow::SampleWindow(void* hwnd, int argc, char** argv, DeviceManager* dev if (argv < stop && **argv) { fMSAASampleCount = atoi(*argv); } + } else if (strcmp(*argv, "--list") == 0) { + listTitles(); } else { usage(commandName); @@ -873,6 +876,14 @@ int SampleWindow::findByTitle(const char title[]) { return -1; } +void SampleWindow::listTitles() { + int count = fSamples.count(); + SkDebugf("All Slides:\n"); + for (int i = 0; i < count; i++) { + SkDebugf(" %s\n", getSampleTitle(i).c_str()); + } +} + static SkBitmap capture_bitmap(SkCanvas* canvas) { SkBitmap bm; const SkBitmap& src = canvas->getDevice()->accessBitmap(false); diff --git a/samplecode/SampleApp.h b/samplecode/SampleApp.h index eb49236ba1..e587e1ff62 100644 --- a/samplecode/SampleApp.h +++ b/samplecode/SampleApp.h @@ -198,6 +198,7 @@ private: void postAnimatingEvent(); void installDrawFilter(SkCanvas*); int findByTitle(const char*); + void listTitles(); typedef SkOSWindow INHERITED; }; |