From: twiz@google.com Date: Tue, 31 Jan 2012 18:35:30 +0000 (+0000) Subject: Expose '--notexturecache' command line argument to gm. X-Git-Tag: accepted/tizen/5.0/unified/20181102.025319~16899 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e24a07980eee6a4a743b0099e2ed5d44bd9715c4;p=platform%2Fupstream%2FlibSkiaSharp.git Expose '--notexturecache' command line argument to gm. Pass '--notexturecache' to gm to resize the Ganesh texture cache to 0. This stresses Ganesh's behaviour after a cache purge operation. Review URL: https://codereview.appspot.com/5569079 git-svn-id: http://skia.googlecode.com/svn/trunk@3123 2bbb7eff-a529-9590-31e7-b0007b416f81 --- diff --git a/gm/gmmain.cpp b/gm/gmmain.cpp index 7be822a..455f7fe 100644 --- a/gm/gmmain.cpp +++ b/gm/gmmain.cpp @@ -590,7 +590,7 @@ static void usage(const char * argv0) { SkDebugf( "%s [-w writePath] [-r readPath] [-d diffPath] [--noreplay]\n" " [--serialize] [--forceBWtext] [--nopdf] [--nodeferred]\n" - " [--match substring]" + " [--match substring] [--notexturecache]" #if SK_MESA " [--mesagl]" #endif @@ -610,6 +610,7 @@ static void usage(const char * argv0) { #if SK_MESA SkDebugf(" --mesagl will run using the osmesa sw gl rasterizer.\n"); #endif + SkDebugf(" --notexturecache: disable the gpu texture cache.\n"); } static const ConfigData gRec[] = { @@ -658,13 +659,14 @@ int main(int argc, char * const argv[]) { const char* diffPath = NULL; // if non-null, where we write our diffs (from compare) SkTDArray fMatches; - + bool doPDF = true; bool doReplay = true; bool doSerialize = false; bool useMesa = false; bool doDeferred = true; - + bool disableTextureCache = false; + const char* const commandName = argv[0]; char* const* stop = argv + argc; for (++argv; argv < stop; ++argv) { @@ -703,6 +705,8 @@ int main(int argc, char * const argv[]) { } else if (strcmp(*argv, "--mesagl") == 0) { useMesa = true; #endif + } else if (strcmp(*argv, "--notexturecache") == 0) { + disableTextureCache = true; } else { usage(commandName); return -1; @@ -759,6 +763,10 @@ int main(int argc, char * const argv[]) { int testsFailed = 0; int testsMissingReferenceImages = 0; + if (disableTextureCache) { + skiagm::GetGr()->setTextureCacheLimits(0, 0); + } + iter.reset(); while ((gm = iter.next()) != NULL) { const char* shortName = gm->shortName(); @@ -788,7 +796,7 @@ int main(int argc, char * const argv[]) { for (size_t i = 0; i < SK_ARRAY_COUNT(gRec); i++) { // Skip any tests that we don't even need to try. uint32_t gmFlags = gm->getFlags(); - if ((kPDF_Backend == gRec[i].fBackend) && + if ((kPDF_Backend == gRec[i].fBackend) && (!doPDF || (gmFlags & GM::kSkipPDF_Flag))) { continue; @@ -813,7 +821,7 @@ int main(int argc, char * const argv[]) { } if (doDeferred && !testErrors && - (kGPU_Backend == gRec[i].fBackend || + (kGPU_Backend == gRec[i].fBackend || kRaster_Backend == gRec[i].fBackend)) { testErrors |= test_deferred_drawing(gm, gRec[i], forwardRenderedBitmap,