Reverting r4162
authorrobertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Tue, 5 Jun 2012 16:24:32 +0000 (16:24 +0000)
committerrobertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Tue, 5 Jun 2012 16:24:32 +0000 (16:24 +0000)
git-svn-id: http://skia.googlecode.com/svn/trunk@4164 2bbb7eff-a529-9590-31e7-b0007b416f81

gm/gmmain.cpp
gyp/core.gyp
include/core/SkInstCnt.h [deleted file]
include/core/SkRefCnt.h
include/gpu/GrResource.h
src/core/SkRefCnt.cpp [deleted file]
src/gpu/GrResource.cpp

index c6159e3..6eb96fd 100644 (file)
@@ -21,7 +21,6 @@
 #include "SkImageEncoder.h"
 #include "SkPicture.h"
 #include "SkStream.h"
-#include "SkRefCnt.h"
 
 static bool gForceBWtext;
 
@@ -805,7 +804,7 @@ private:
 }
 
 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 @@ int main(int argc, char * const argv[]) {
 
     GM::SetResourcePath(resourcePath);
 
-    GrContextFactory* grFactory = new GrContextFactory;
+    GrContextFactory grFactory;
 
     if (readPath) {
         fprintf(stderr, "reading from %s\n", readPath);
@@ -936,7 +935,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;
                 }
@@ -1037,11 +1036,5 @@ 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;
 }
index f50d64a..aea2a73 100644 (file)
         '../src/core/SkRasterClip.cpp',
         '../src/core/SkRasterizer.cpp',
         '../src/core/SkRect.cpp',
-        '../src/core/SkRefCnt.cpp',
         '../src/core/SkRefDict.cpp',
         '../src/core/SkRegion.cpp',
         '../src/core/SkRegionPriv.h',
         '../include/core/SkFontHost.h',
         '../include/core/SkGeometry.h',
         '../include/core/SkGraphics.h',
-        '../include/core/SkInstCnt.h',
         '../include/core/SkMallocPixelRef.h',
         '../include/core/SkMask.h',
         '../include/core/SkMaskFilter.h',
diff --git a/include/core/SkInstCnt.h b/include/core/SkInstCnt.h
deleted file mode 100644 (file)
index 889c098..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/*\r
- * Copyright 2012 Google Inc.\r
- *\r
- * Use of this source code is governed by a BSD-style license that can be\r
- * found in the LICENSE file.\r
- */
-
-
-#ifndef SkInstCnt_DEFINED
-#define SkInstCnt_DEFINED
-
-/*
- * The instance counting system consists of three macros that create the 
- * instance counting machinery. A class is added to the system by adding:
- *   DECLARE_INST_COUNT at the top of its declaration
- *   DEFINE_INST_COUNT at the top of its .cpp file
- *   and a PRINT_INST_COUNT line at the application's end point
- */
-#ifdef SK_DEBUG
-#define DECLARE_INST_COUNT                  \
-    class SkInstanceCountHelper {           \
-    public:                                 \
-        SkInstanceCountHelper() {           \
-            gInstanceCount++;               \
-        }                                   \
-                                            \
-        ~SkInstanceCountHelper() {          \
-            gInstanceCount--;               \
-        }                                   \
-                                            \
-        static int32_t gInstanceCount;      \
-    } fInstanceCountHelper;                 \
-                                            \
-    static int32_t GetInstanceCount() {     \
-        return SkInstanceCountHelper::gInstanceCount;   \
-    }
-
-#define DEFINE_INST_COUNT(className)        \
-    int32_t className::SkInstanceCountHelper::gInstanceCount = 0;
-
-#define PRINT_INST_COUNT(className)         \
-    SkDebugf("Leaked %s objects: %d\n",     \
-                  #className,               \
-                  className::GetInstanceCount());
-#else
-#define DECLARE_INST_COUNT
-#define DEFINE_INST_COUNT(className)
-#define PRINT_INST_COUNT(className)
-#endif
-
-#endif // SkInstCnt_DEFINED
index 761546b..b847596 100644 (file)
@@ -11,7 +11,6 @@
 #define SkRefCnt_DEFINED
 
 #include "SkThread.h"
-#include "SkInstCnt.h"
 
 /** \class SkRefCnt
 
@@ -25,8 +24,6 @@
 */
 class SK_API SkRefCnt : SkNoncopyable {
 public:
-    DECLARE_INST_COUNT
-
     /** Default construct, initializing the reference count to 1.
     */
     SkRefCnt() : fRefCnt(1) {}
index 4c491c7..8008f29 100644 (file)
@@ -20,8 +20,6 @@ class GrContext;
  */
 class GrResource : public GrRefCnt {
 public:
-    DECLARE_INST_COUNT
-
     /**
      * Frees the resource in the underlying 3D API. It must be safe to call this
      * when the resource has been previously abandoned.
diff --git a/src/core/SkRefCnt.cpp b/src/core/SkRefCnt.cpp
deleted file mode 100644 (file)
index 111ecd8..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-/*\r
- * Copyright 2012 Google Inc.\r
- *\r
- * Use of this source code is governed by a BSD-style license that can be\r
- * found in the LICENSE file.\r
- */
-
-
-#include "SkRefCnt.h"
-
-DEFINE_INST_COUNT(SkRefCnt)
-
index a5168c8..9efc838 100644 (file)
@@ -10,8 +10,6 @@
 #include "GrResource.h"
 #include "GrGpu.h"
 
-DEFINE_INST_COUNT(GrResource)
-
 GrResource::GrResource(GrGpu* gpu) {
     fGpu        = gpu;
     fNext       = NULL;