diff options
author | robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-06-05 15:40:54 +0000 |
---|---|---|
committer | robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-06-05 15:40:54 +0000 |
commit | 3227ab5f6454b3b553284abd5c9894a8d1c7e845 (patch) | |
tree | 951d48469516ec466bdeb12f6d716a8b34a7e225 /gm | |
parent | 492093951ae2a7d7c14aa22f48faa8942f045caf (diff) |
Added instance counting system for SkRefCnt-derived objects
http://codereview.appspot.com/6242070/
git-svn-id: http://skia.googlecode.com/svn/trunk@4162 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'gm')
-rw-r--r-- | gm/gmmain.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/gm/gmmain.cpp b/gm/gmmain.cpp index 6eb96fd227..c6159e3944 100644 --- a/gm/gmmain.cpp +++ b/gm/gmmain.cpp @@ -21,6 +21,7 @@ #include "SkImageEncoder.h" #include "SkPicture.h" #include "SkStream.h" +#include "SkRefCnt.h" static bool gForceBWtext; @@ -804,7 +805,7 @@ private: } int main(int argc, char * const argv[]) { - SkAutoGraphics ag; + SkGraphics::Init(); // we don't need to see this during a run gSkSuppressFontCachePurgeSpew = true; @@ -892,7 +893,7 @@ int main(int argc, char * const argv[]) { GM::SetResourcePath(resourcePath); - GrContextFactory grFactory; + GrContextFactory* grFactory = new GrContextFactory; if (readPath) { fprintf(stderr, "reading from %s\n", readPath); @@ -935,7 +936,7 @@ int main(int argc, char * const argv[]) { SkAutoTUnref<GrRenderTarget> rt; AutoResetGr autogr; if (kGPU_Backend == gRec[i].fBackend) { - GrContext* gr = grFactory.get(gRec[i].fGLContextType); + GrContext* gr = grFactory->get(gRec[i].fGLContextType); if (!gr) { continue; } @@ -1036,5 +1037,11 @@ int main(int argc, char * const argv[]) { printf("Ran %d tests: %d passed, %d failed, %d missing reference images\n", testsRun, testsPassed, testsFailed, testsMissingReferenceImages); + delete grFactory; + SkGraphics::Term(); + + PRINT_INST_COUNT(SkRefCnt); + PRINT_INST_COUNT(GrResource); + return (0 == testsFailed) ? 0 : -1; } |