aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm/gmmain.cpp
diff options
context:
space:
mode:
authorGravatar twiz@google.com <twiz@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-01-31 18:35:30 +0000
committerGravatar twiz@google.com <twiz@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-01-31 18:35:30 +0000
commite24a07980eee6a4a743b0099e2ed5d44bd9715c4 (patch)
tree53a22c86c566495092b9e51f822c380afb4edb8d /gm/gmmain.cpp
parent8722d7c3e0ddb623a557a67b99b464d9072836bc (diff)
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
Diffstat (limited to 'gm/gmmain.cpp')
-rw-r--r--gm/gmmain.cpp18
1 files changed, 13 insertions, 5 deletions
diff --git a/gm/gmmain.cpp b/gm/gmmain.cpp
index 7be822a1d9..455f7fe88a 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<const char*> 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,