From 0a89c90d18ab5082f2fde5076ce422aac493bb00 Mon Sep 17 00:00:00 2001 From: "robertphillips@google.com" Date: Tue, 20 Mar 2012 15:13:04 +0000 Subject: reverting to 3437 git-svn-id: http://skia.googlecode.com/svn/trunk@3439 2bbb7eff-a529-9590-31e7-b0007b416f81 --- gm/gm.cpp | 2 -- gm/gm.h | 30 ++++++++++++------------------ gm/gmmain.cpp | 35 +++++++++++------------------------ 3 files changed, 23 insertions(+), 44 deletions(-) (limited to 'gm') diff --git a/gm/gm.cpp b/gm/gm.cpp index b6f21f81ff..f9c0e6637f 100644 --- a/gm/gm.cpp +++ b/gm/gm.cpp @@ -8,8 +8,6 @@ #include "gm.h" using namespace skiagm; -SkString GM::gResourcePath; - GM::GM() { fBGColor = SK_ColorWHITE; } diff --git a/gm/gm.h b/gm/gm.h index d75a1c17c8..b0de9227f7 100644 --- a/gm/gm.h +++ b/gm/gm.h @@ -18,18 +18,18 @@ #include "SkTRegistry.h" namespace skiagm { - - static inline SkISize make_isize(int w, int h) { - SkISize sz; - sz.set(w, h); - return sz; - } + + static inline SkISize make_isize(int w, int h) { + SkISize sz; + sz.set(w, h); + return sz; + } class GM { public: GM(); virtual ~GM(); - + enum Flags { kSkipPDF_Flag = 1 << 0, kSkipPicture_Flag = 1 << 1 @@ -39,7 +39,7 @@ namespace skiagm { void drawBackground(SkCanvas*); void drawContent(SkCanvas*); - SkISize getISize() { return this->onISize(); } + SkISize getISize() { return this->onISize(); } const char* shortName(); uint32_t getFlags() const { @@ -53,16 +53,10 @@ namespace skiagm { // GM's getISize bounds. void drawSizeBounds(SkCanvas*, SkColor); - static void SetResourcePath(const char* resourcePath) { - gResourcePath = resourcePath; - } - - protected: - static SkString gResourcePath; - - virtual void onDraw(SkCanvas*) = 0; - virtual void onDrawBackground(SkCanvas*); - virtual SkISize onISize() = 0; + protected: + virtual void onDraw(SkCanvas*) = 0; + virtual void onDrawBackground(SkCanvas*); + virtual SkISize onISize() = 0; virtual SkString onShortName() = 0; virtual uint32_t onGetFlags() const { return 0; } diff --git a/gm/gmmain.cpp b/gm/gmmain.cpp index 61095e173f..6f53ce8f7b 100644 --- a/gm/gmmain.cpp +++ b/gm/gmmain.cpp @@ -589,9 +589,9 @@ static ErrorBitfield test_picture_serialization(GM* gm, static void usage(const char * argv0) { SkDebugf( - "%s [-w writePath] [-r readPath] [-d diffPath] [-i resourcePath]\n" - " [--noreplay] [--serialize] [--forceBWtext] [--nopdf] \n" - " [--nodeferred] [--match substring] [--notexturecache]" + "%s [-w writePath] [-r readPath] [-d diffPath] [--noreplay]\n" + " [--serialize] [--forceBWtext] [--nopdf] [--nodeferred]\n" + " [--match substring] [--notexturecache]" #if SK_MESA " [--mesagl]" #endif @@ -601,7 +601,6 @@ static void usage(const char * argv0) { " readPath: directory to read reference images from;\n" " reports if any pixels mismatch between reference and new images\n"); SkDebugf(" diffPath: directory to write difference images in.\n"); - SkDebugf(" resourcePath: directory that stores image resources.\n"); SkDebugf(" --noreplay: do not exercise SkPicture replay.\n"); SkDebugf( " --serialize: exercise SkPicture serialization & deserialization.\n"); @@ -661,7 +660,6 @@ int main(int argc, char * const argv[]) { const char* writePath = NULL; // if non-null, where we write the originals const char* readPath = NULL; // if non-null, were we read from to compare const char* diffPath = NULL; // if non-null, where we write our diffs (from compare) - const char* resourcePath = NULL;// if non-null, where we read from for image resources SkTDArray fMatches; @@ -690,11 +688,6 @@ int main(int argc, char * const argv[]) { if (argv < stop && **argv) { diffPath = *argv; } - } else if (strcmp(*argv, "-i") == 0) { - argv++; - if (argv < stop && **argv) { - resourcePath = *argv; - } } else if (strcmp(*argv, "--forceBWtext") == 0) { gForceBWtext = true; } else if (strcmp(*argv, "--noreplay") == 0) { @@ -716,19 +709,17 @@ int main(int argc, char * const argv[]) { useMesa = true; #endif } else if (strcmp(*argv, "--notexturecache") == 0) { - disableTextureCache = true; + disableTextureCache = true; } else { - usage(commandName); - return -1; + usage(commandName); + return -1; } } if (argv != stop) { - usage(commandName); - return -1; + usage(commandName); + return -1; } - GM::SetResourcePath(resourcePath); - int maxW = -1; int maxH = -1; Iter iter; @@ -772,10 +763,6 @@ int main(int argc, char * const argv[]) { fprintf(stderr, "writing to %s\n", writePath); } - if (resourcePath) { - fprintf(stderr, "reading resources from %s\n", resourcePath); - } - // Accumulate success of all tests. int testsRun = 0; int testsPassed = 0; @@ -841,10 +828,10 @@ int main(int argc, char * const argv[]) { if (doDeferred && !testErrors && (kGPU_Backend == gRec[i].fBackend || - kRaster_Backend == gRec[i].fBackend)) { + kRaster_Backend == gRec[i].fBackend)) { testErrors |= test_deferred_drawing(gm, gRec[i], - forwardRenderedBitmap, - diffPath, gGrContext, rt.get()); + forwardRenderedBitmap, + diffPath, gGrContext, rt.get()); } if ((ERROR_NONE == testErrors) && doReplay && -- cgit v1.2.3