From 58be1015a04282c368f5b1be7a34508df9d39bb0 Mon Sep 17 00:00:00 2001 From: "junov@chromium.org" Date: Tue, 18 Dec 2012 21:09:45 +0000 Subject: [PATCH] Adding gm test steps for rtree and tileGrid The new passes are enabled by default, and can be disabled with --nortree and --notileGrid. With this change, the skia buildbots will begin continuously testing rtree and tileGrid. BUG=http://code.google.com/p/skia/issues/detail?id=1014 TEST=gm Review URL: https://codereview.appspot.com/6941072 git-svn-id: http://skia.googlecode.com/svn/trunk@6886 2bbb7eff-a529-9590-31e7-b0007b416f81 --- gm/gm.h | 2 -- gm/gmmain.cpp | 43 +++++++++++++++++++++++++++++++++++-------- 2 files changed, 35 insertions(+), 10 deletions(-) diff --git a/gm/gm.h b/gm/gm.h index 58dda63790..9460ec01ab 100644 --- a/gm/gm.h +++ b/gm/gm.h @@ -39,8 +39,6 @@ namespace skiagm { kSkipPipe_Flag = 1 << 2, kSkipTiled_Flag = 1 << 3, kSkip565_Flag = 1 << 4, - kRTree_Flag = 1 << 5, - kTileGrid_Flag = 1 << 6, }; void draw(SkCanvas*); diff --git a/gm/gmmain.cpp b/gm/gmmain.cpp index 2f18aaacf7..f66fffe105 100644 --- a/gm/gmmain.cpp +++ b/gm/gmmain.cpp @@ -920,11 +920,11 @@ static void usage(const char * argv0) { " any differences between those and the newly generated ones\n" " [--noreplay]: do not exercise SkPicture replay\n" " [--resourcePath|-i ]: directory that stores image resources\n" -" [--rtree]: use an rtree structure for SkPicture testing\n" +" [--nortree]: Do not exercise the R-Tree variant of SkPicture\n" " [--noserialize]: do not exercise SkPicture serialization & deserialization\n" " [--notexturecache]: disable the gpu texture cache\n" " [--tiledPipe]: Exercise tiled SkGPipe replay\n" -" [--tileGrid]: use a tileGrid structure for SkPicture testing\n" +" [--notileGrid]: Do not exercise the tile grid variant of SkPicture\n" " [--writeJsonSummary ]: write a JSON-formatted result summary to this file\n" " [--writePath|-w ]: write rendered images into this directory\n" " [--writePicturePath|-wp ]: write .skp files into this directory\n" @@ -1024,10 +1024,11 @@ int tool_main(int argc, char** argv) { bool doTiledPipe = false; bool doSerialize = true; bool doDeferred = true; + bool doRTree = true; + bool doTileGrid = true; bool disableTextureCache = false; SkTDArray configs; bool userConfig = false; - BbhType bbhType = kNone_BbhType; int moduloRemainder = -1; int moduloDivisor = -1; @@ -1064,10 +1065,10 @@ int tool_main(int argc, char** argv) { } } else if (strcmp(*argv, "--disable-missing-warning") == 0) { gmmain.fNotifyMissingReadReference = false; - } else if (strcmp(*argv, "--rtree") == 0) { - bbhType = kRTree_BbhType; - } else if (strcmp(*argv, "--tileGrid") == 0) { - bbhType = kTileGrid_BbhType; + } else if (strcmp(*argv, "--nortree") == 0) { + doRTree = false; + } else if (strcmp(*argv, "--notileGrid") == 0) { + doTileGrid = false; } else if (strcmp(*argv, "--enable-missing-warning") == 0) { gmmain.fNotifyMissingReadReference = true; } else if (strcmp(*argv, "--forceBWtext") == 0) { @@ -1324,7 +1325,7 @@ int tool_main(int argc, char** argv) { ErrorBitfield pictErrors = ERROR_NONE; //SkAutoTUnref pict(generate_new_picture(gm)); - SkPicture* pict = gmmain.generate_new_picture(gm, bbhType); + SkPicture* pict = gmmain.generate_new_picture(gm, kNone_BbhType); SkAutoUnref aur(pict); if ((ERROR_NONE == testErrors) && doReplay) { @@ -1366,6 +1367,32 @@ int tool_main(int argc, char** argv) { testErrors |= pictErrors; } + if (!(gmFlags & GM::kSkipPicture_Flag) && doRTree) { + SkPicture* pict = gmmain.generate_new_picture(gm, kRTree_BbhType); + SkAutoUnref aur(pict); + SkBitmap bitmap; + gmmain.generate_image_from_picture(gm, compareConfig, pict, + &bitmap); + testErrors |= gmmain.handle_test_results(gm, compareConfig, + NULL, NULL, diffPath, + "-rtree", bitmap, + NULL, + &comparisonBitmap); + } + + if (!(gmFlags & GM::kSkipPicture_Flag) && doTileGrid) { + SkPicture* pict = gmmain.generate_new_picture(gm, kTileGrid_BbhType); + SkAutoUnref aur(pict); + SkBitmap bitmap; + gmmain.generate_image_from_picture(gm, compareConfig, pict, + &bitmap); + testErrors |= gmmain.handle_test_results(gm, compareConfig, + NULL, NULL, diffPath, + "-tilegrid", bitmap, + NULL, + &comparisonBitmap); + } + // run the pipe centric GM steps if (!(gmFlags & GM::kSkipPipe_Flag)) {