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

Unified Diff: samplecode/SampleApp.cpp

Issue 346453002: Refactor how we handle resources path in Tests. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix rebase conflict Created 6 years, 6 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
« no previous file with comments | « gyp/tools.gyp ('k') | samplecode/SamplePicture.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samplecode/SampleApp.cpp
diff --git a/samplecode/SampleApp.cpp b/samplecode/SampleApp.cpp
index eee379cf8bb15222f57cf5de636047134fc40874..264b17c632745685ab65afaeabea923b9f407c24 100644
--- a/samplecode/SampleApp.cpp
+++ b/samplecode/SampleApp.cpp
@@ -7,12 +7,19 @@
#include "SampleApp.h"
-#include "SkData.h"
+#include "OverView.h"
+#include "SampleCode.h"
+#include "SamplePipeControllers.h"
#include "SkCanvas.h"
+#include "SkCommandLineFlags.h"
+#include "SkData.h"
#include "SkDevice.h"
+#include "SkGPipe.h"
#include "SkGraphics.h"
-#include "SkImageDecoder.h"
#include "SkImageEncoder.h"
+#include "SkOSFile.h"
+#include "SkPDFDevice.h"
+#include "SkPDFDocument.h"
#include "SkPaint.h"
#include "SkPicture.h"
#include "SkPictureRecorder.h"
@@ -20,10 +27,10 @@
#include "SkSurface.h"
#include "SkTSort.h"
#include "SkTime.h"
-#include "SkWindow.h"
-
-#include "SampleCode.h"
#include "SkTypeface.h"
+#include "SkWindow.h"
+#include "TransitionView.h"
+#include "sk_tool_utils.h"
#if SK_SUPPORT_GPU
#include "gl/GrGLInterface.h"
@@ -35,17 +42,6 @@
class GrContext;
#endif
-#include "SkOSFile.h"
-#include "SkPDFDevice.h"
-#include "SkPDFDocument.h"
-#include "SkStream.h"
-
-#include "SkGPipe.h"
-#include "SamplePipeControllers.h"
-#include "OverView.h"
-#include "TransitionView.h"
-#include "sk_tool_utils.h"
-
extern SampleView* CreateSamplePictFileView(const char filename[]);
class PictFileFactory : public SkViewFactory {
@@ -783,18 +779,14 @@ SampleWindow::SampleWindow(void* hwnd, int argc, char** argv, DeviceManager* dev
SkTQSort(fSamples.begin(), fSamples.end() ? fSamples.end() - 1 : NULL, compareSampleTitle);
}
- const char* resourcePath = "resources"; // same default as tests
fMSAASampleCount = 0;
+ SkCommandLineFlags::Parse(argc, argv);
+
const char* const commandName = argv[0];
char* const* stop = argv + argc;
for (++argv; argv < stop; ++argv) {
- if (!strcmp(*argv, "-i") || !strcmp(*argv, "--resourcePath")) {
- argv++;
- if (argv < stop && **argv) {
- resourcePath = *argv;
- }
- } else if (strcmp(*argv, "--slide") == 0) {
+ if (strcmp(*argv, "--slide") == 0) {
argv++;
if (argv < stop && **argv) {
fCurrIndex = findByTitle(*argv);
@@ -965,8 +957,6 @@ SampleWindow::SampleWindow(void* hwnd, int argc, char** argv, DeviceManager* dev
this->setVisibleP(true);
this->setClipToBounds(false);
- skiagm::GM::SetResourcePath(resourcePath);
-
this->loadView((*fSamples[fCurrIndex])());
fPDFData = NULL;
« no previous file with comments | « gyp/tools.gyp ('k') | samplecode/SamplePicture.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698