Reverting r4162



git-svn-id: http://skia.googlecode.com/svn/trunk@4164 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/gm/gmmain.cpp b/gm/gmmain.cpp
index c6159e3..6eb96fd 100644
--- a/gm/gmmain.cpp
+++ b/gm/gmmain.cpp
@@ -21,7 +21,6 @@
 #include "SkImageEncoder.h"
 #include "SkPicture.h"
 #include "SkStream.h"
-#include "SkRefCnt.h"
 
 static bool gForceBWtext;
 
@@ -805,7 +804,7 @@
 }
 
 int main(int argc, char * const argv[]) {
-    SkGraphics::Init();
+    SkAutoGraphics ag;
     // we don't need to see this during a run
     gSkSuppressFontCachePurgeSpew = true;
 
@@ -893,7 +892,7 @@
 
     GM::SetResourcePath(resourcePath);
 
-    GrContextFactory* grFactory = new GrContextFactory;
+    GrContextFactory grFactory;
 
     if (readPath) {
         fprintf(stderr, "reading from %s\n", readPath);
@@ -936,7 +935,7 @@
             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;
                 }
@@ -1037,11 +1036,5 @@
     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;
 }