aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar mtklein <mtklein@chromium.org>2015-06-26 11:45:03 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-06-26 11:45:03 -0700
commit2766c00fc0b6a07d46e5f74cdad45da2ef625237 (patch)
tree152a6169021ef393f5719d511becf9f81fec8c02
parent46043ee50fe0532df6213172506fd16324b21e58 (diff)
remove SkInstCnt
It's been outclassed by Valgrind and leak sanitizer, and it seems to be causing problems for external folks building Skia. I'm not sure why our own builds seem unaffected. Latest thread: https://groups.google.com/forum/#!topic/skia-discuss/oj9FsQwwSF0 BUG=skia: Review URL: https://codereview.chromium.org/1217573002
-rw-r--r--bench/Benchmark.h2
-rw-r--r--bench/GrResourceCacheBench.cpp1
-rw-r--r--bench/RefCntBench.cpp2
-rw-r--r--dm/DM.cpp4
-rw-r--r--experimental/PdfViewer/SkNulCanvas.h4
-rw-r--r--experimental/PdfViewer/SkTrackDevice.h2
-rw-r--r--gm/gm_expectations.h2
-rw-r--r--gyp/core.gypi2
-rw-r--r--include/config/SkUserConfig.h7
-rw-r--r--include/core/SkBitmap.h2
-rw-r--r--include/core/SkBitmapDevice.h2
-rw-r--r--include/core/SkCanvas.h4
-rw-r--r--include/core/SkColorFilter.h2
-rw-r--r--include/core/SkColorTable.h2
-rw-r--r--include/core/SkData.h2
-rw-r--r--include/core/SkDataTable.h2
-rw-r--r--include/core/SkDevice.h2
-rw-r--r--include/core/SkDocument.h2
-rw-r--r--include/core/SkDrawFilter.h2
-rw-r--r--include/core/SkDrawLooper.h2
-rw-r--r--include/core/SkFlattenable.h2
-rw-r--r--include/core/SkImage.h4
-rw-r--r--include/core/SkImageDecoder.h6
-rw-r--r--include/core/SkImageFilter.h6
-rw-r--r--include/core/SkInstCnt.h82
-rw-r--r--include/core/SkMallocPixelRef.h1
-rw-r--r--include/core/SkMaskFilter.h2
-rw-r--r--include/core/SkPath.h3
-rw-r--r--include/core/SkPathEffect.h8
-rw-r--r--include/core/SkPathRef.h2
-rw-r--r--include/core/SkPixelRef.h2
-rw-r--r--include/core/SkPostConfig.h17
-rw-r--r--include/core/SkRasterizer.h2
-rw-r--r--include/core/SkRefCnt.h3
-rw-r--r--include/core/SkShader.h2
-rw-r--r--include/core/SkStream.h13
-rw-r--r--include/core/SkSurface.h6
-rw-r--r--include/core/SkTypeface.h2
-rw-r--r--include/core/SkWeakRefCnt.h2
-rw-r--r--include/core/SkXfermode.h4
-rw-r--r--include/effects/SkLayerDrawLooper.h2
-rw-r--r--include/gpu/GrCaps.h4
-rw-r--r--include/gpu/GrContext.h14
-rw-r--r--include/gpu/GrDrawContext.h4
-rw-r--r--include/gpu/GrGpuResource.h7
-rw-r--r--include/gpu/GrGpuResourceRef.h2
-rw-r--r--include/gpu/GrPathRendererChain.h2
-rw-r--r--include/gpu/GrProcessor.h2
-rw-r--r--include/gpu/GrProgramElement.h2
-rw-r--r--include/gpu/GrRenderTarget.h2
-rw-r--r--include/gpu/GrSurface.h8
-rw-r--r--include/gpu/GrTextureAccess.h2
-rw-r--r--include/gpu/SkGrPixelRef.h2
-rw-r--r--include/gpu/gl/GrGLInterface.h2
-rw-r--r--include/gpu/gl/SkGLContext.h2
-rw-r--r--include/images/SkMovie.h2
-rw-r--r--include/ports/SkFontConfigInterface.h2
-rw-r--r--include/ports/SkFontMgr.h4
-rw-r--r--include/ports/SkRemotableFontMgr.h4
-rw-r--r--include/utils/SkBoundaryPatch.h2
-rw-r--r--include/utils/SkDumpCanvas.h2
-rw-r--r--include/utils/SkLayer.h2
-rw-r--r--include/views/SkEventSink.h2
-rw-r--r--include/views/SkView.h4
-rw-r--r--include/views/animated/SkWidgetViews.h2
-rw-r--r--samplecode/SampleApp.h2
-rw-r--r--src/core/SkAdvancedTypefaceMetrics.h2
-rw-r--r--src/core/SkBBoxHierarchy.h2
-rw-r--r--src/core/SkBitmapHeap.h4
-rw-r--r--src/core/SkDeviceProfile.h2
-rw-r--r--src/core/SkInstCnt.cpp15
-rw-r--r--src/core/SkMaskGamma.h2
-rw-r--r--src/core/SkPictureFlat.h2
-rw-r--r--src/core/SkPtrRecorder.h4
-rw-r--r--src/core/SkRTree.h2
-rw-r--r--src/core/SkResourceCache.cpp2
-rw-r--r--src/effects/SkLightingImageFilter.cpp2
-rw-r--r--src/fonts/SkTestScalerContext.h2
-rw-r--r--src/gpu/GrBatch.h2
-rw-r--r--src/gpu/GrBatchAtlas.cpp2
-rw-r--r--src/gpu/GrDrawTarget.h2
-rw-r--r--src/gpu/GrFontScaler.h4
-rw-r--r--src/gpu/GrGeometryBuffer.h2
-rw-r--r--src/gpu/GrPath.h2
-rw-r--r--src/gpu/GrPathRange.h2
-rw-r--r--src/gpu/GrPathRenderer.h2
-rw-r--r--src/gpu/GrPipeline.h2
-rw-r--r--src/gpu/GrStencilAttachment.h2
-rw-r--r--src/gpu/gl/GrGLCaps.h2
-rw-r--r--src/gpu/gl/GrGLCreateNullInterface.cpp6
-rw-r--r--src/gpu/gl/GrGLGpuProgramCache.cpp2
-rw-r--r--src/gpu/gl/GrGLProgram.h2
-rw-r--r--src/gpu/gl/SkNullGLContext.cpp6
-rw-r--r--src/gpu/gl/debug/GrGLCreateDebugInterface.cpp2
-rwxr-xr-xsrc/gpu/glsl/GrGLSLCaps.h2
-rw-r--r--src/image/SkImage_Gpu.h2
-rw-r--r--src/image/SkSurface_Gpu.h2
-rw-r--r--src/lazy/SkCachingPixelRef.h2
-rw-r--r--src/lazy/SkDiscardablePixelRef.h2
-rw-r--r--src/pdf/SkPDFFont.h2
-rw-r--r--src/pdf/SkPDFGraphicState.h2
-rw-r--r--src/pdf/SkPDFShader.h2
-rw-r--r--src/pdf/SkPDFStream.h2
-rw-r--r--src/pdf/SkPDFTypes.h6
-rw-r--r--src/ports/SkRemotableFontMgr_win_dw.cpp2
-rw-r--r--tests/GrMemoryPoolTest.cpp12
-rw-r--r--tests/LListTest.cpp31
-rw-r--r--tests/RefDictTest.cpp2
-rw-r--r--tests/ResourceCacheTest.cpp2
-rw-r--r--tests/UtilsTest.cpp2
-rw-r--r--tests/skia_test.cpp7
-rw-r--r--tools/bench_pictures_main.cpp7
-rw-r--r--tools/filtermain.cpp10
-rw-r--r--tools/flags/SkCommonFlags.cpp2
-rw-r--r--tools/flags/SkCommonFlags.h1
115 files changed, 98 insertions, 391 deletions
diff --git a/bench/Benchmark.h b/bench/Benchmark.h
index 30ceb88acb..34ea92b4a2 100644
--- a/bench/Benchmark.h
+++ b/bench/Benchmark.h
@@ -43,8 +43,6 @@ public:
class Benchmark : public SkRefCnt {
public:
- SK_DECLARE_INST_COUNT(Benchmark)
-
Benchmark();
const char* getName();
diff --git a/bench/GrResourceCacheBench.cpp b/bench/GrResourceCacheBench.cpp
index 58b0ee85d6..1faff9704a 100644
--- a/bench/GrResourceCacheBench.cpp
+++ b/bench/GrResourceCacheBench.cpp
@@ -23,7 +23,6 @@ enum {
class BenchResource : public GrGpuResource {
public:
- SK_DECLARE_INST_COUNT(BenchResource);
BenchResource (GrGpu* gpu)
: INHERITED(gpu, kCached_LifeCycle) {
this->registerWithCache();
diff --git a/bench/RefCntBench.cpp b/bench/RefCntBench.cpp
index aacdf18edb..78b02edb60 100644
--- a/bench/RefCntBench.cpp
+++ b/bench/RefCntBench.cpp
@@ -89,8 +89,6 @@ private:
class PlacedRefCnt : public SkRefCnt {
public:
- SK_DECLARE_INST_COUNT(PlacedRefCnt)
-
PlacedRefCnt() : SkRefCnt() { }
void operator delete(void*) { }
diff --git a/dm/DM.cpp b/dm/DM.cpp
index 60929d5700..40823c4945 100644
--- a/dm/DM.cpp
+++ b/dm/DM.cpp
@@ -17,7 +17,6 @@
#include "SkFontMgr.h"
#include "SkForceLinking.h"
#include "SkGraphics.h"
-#include "SkInstCnt.h"
#include "SkMD5.h"
#include "SkOSFile.h"
#include "SkTHash.h"
@@ -751,9 +750,6 @@ int dm_main() {
SetupCrashHandler();
SkAutoGraphics ag;
SkTaskGroup::Enabler enabled(FLAGS_threads);
- if (FLAGS_leaks) {
- SkInstCountPrintLeaksOnExit();
- }
gCreateTypefaceDelegate = &create_from_name;
start_keepalive();
diff --git a/experimental/PdfViewer/SkNulCanvas.h b/experimental/PdfViewer/SkNulCanvas.h
index 9fbd506d41..420a673e24 100644
--- a/experimental/PdfViewer/SkNulCanvas.h
+++ b/experimental/PdfViewer/SkNulCanvas.h
@@ -18,8 +18,6 @@
*/
class SK_API SkNulCanvas : public SkCanvas {
public:
- SK_DECLARE_INST_COUNT(SkNulCanvas);
-
SkNulCanvas() {}
explicit SkNulCanvas(SkBaseDevice* device) : SkCanvas(device) {}
@@ -98,7 +96,7 @@ protected:
const uint16_t indices[], int indexCount,
const SkPaint& paint) override {}
-
+
private:
typedef SkCanvas INHERITED;
};
diff --git a/experimental/PdfViewer/SkTrackDevice.h b/experimental/PdfViewer/SkTrackDevice.h
index e3e78e3097..853b3f9cf1 100644
--- a/experimental/PdfViewer/SkTrackDevice.h
+++ b/experimental/PdfViewer/SkTrackDevice.h
@@ -25,8 +25,6 @@
// TODO: can this be derived from SkBaseDevice instead?
class SkTrackDevice : public SkBitmapDevice {
public:
- SK_DECLARE_INST_COUNT(SkTrackDevice)
-
SkTrackDevice(const SkBitmap& bitmap)
: INHERITED(bitmap, SkSurfaceProps(0, kUnknown_SkPixelGeometry))
, fTracker(NULL) {
diff --git a/gm/gm_expectations.h b/gm/gm_expectations.h
index 89ba38579b..029a533c62 100644
--- a/gm/gm_expectations.h
+++ b/gm/gm_expectations.h
@@ -171,8 +171,6 @@ namespace skiagm {
*/
class ExpectationsSource : public SkRefCnt {
public:
- SK_DECLARE_INST_COUNT(ExpectationsSource)
-
virtual Expectations get(const char *testName) const = 0;
private:
diff --git a/gyp/core.gypi b/gyp/core.gypi
index 4da1685c10..dc07e38de7 100644
--- a/gyp/core.gypi
+++ b/gyp/core.gypi
@@ -112,7 +112,6 @@
'<(skia_src_path)/core/SkGraphics.cpp',
'<(skia_src_path)/core/SkHalf.cpp',
'<(skia_src_path)/core/SkHalf.h',
- '<(skia_src_path)/core/SkInstCnt.cpp',
'<(skia_src_path)/core/SkImageFilter.cpp',
'<(skia_src_path)/core/SkImageInfo.cpp',
'<(skia_src_path)/core/SkImageGenerator.cpp',
@@ -282,7 +281,6 @@
'<(skia_include_path)/core/SkImageEncoder.h',
'<(skia_include_path)/core/SkImageFilter.h',
'<(skia_include_path)/core/SkImageInfo.h',
- '<(skia_include_path)/core/SkInstCnt.h',
'<(skia_include_path)/core/SkMallocPixelRef.h',
'<(skia_include_path)/core/SkMask.h',
'<(skia_include_path)/core/SkMaskFilter.h',
diff --git a/include/config/SkUserConfig.h b/include/config/SkUserConfig.h
index 43cf7ce880..ff8a5f3154 100644
--- a/include/config/SkUserConfig.h
+++ b/include/config/SkUserConfig.h
@@ -58,13 +58,6 @@
//#define SK_DEBUG_GLYPH_CACHE
//#define SK_DEBUG_PATH
-/* To assist debugging, Skia provides an instance counting utility in
- include/core/SkInstCount.h. This flag turns on and off that utility to
- allow instance count tracking in either debug or release builds. By
- default it is enabled in debug but disabled in release.
- */
-//#define SK_ENABLE_INST_COUNT 1
-
/* If, in debugging mode, Skia needs to stop (presumably to invoke a debugger)
it will call SK_CRASH(). If this is not defined it, it is defined in
SkPostConfig.h to write to an illegal address
diff --git a/include/core/SkBitmap.h b/include/core/SkBitmap.h
index b13b6f7451..e06216cef5 100644
--- a/include/core/SkBitmap.h
+++ b/include/core/SkBitmap.h
@@ -673,8 +673,6 @@ public:
class Allocator : public SkRefCnt {
public:
- SK_DECLARE_INST_COUNT(Allocator)
-
/** Allocate the pixel memory for the bitmap, given its dimensions and
colortype. Return true on success, where success means either setPixels
or setPixelRef was called. The pixels need not be locked when this
diff --git a/include/core/SkBitmapDevice.h b/include/core/SkBitmapDevice.h
index 7e2b476611..db088ad0fa 100644
--- a/include/core/SkBitmapDevice.h
+++ b/include/core/SkBitmapDevice.h
@@ -14,8 +14,6 @@
///////////////////////////////////////////////////////////////////////////////
class SK_API SkBitmapDevice : public SkBaseDevice {
public:
- SK_DECLARE_INST_COUNT(SkBitmapDevice)
-
/**
* Construct a new device with the specified bitmap as its backend. It is
* valid for the bitmap to have no pixels associated with it. In that case,
diff --git a/include/core/SkCanvas.h b/include/core/SkCanvas.h
index 7bff02a6a9..a8e2c7f19d 100644
--- a/include/core/SkCanvas.h
+++ b/include/core/SkCanvas.h
@@ -54,8 +54,6 @@ class SkCanvasState;
*/
class SK_API SkCanvas : public SkRefCnt {
public:
- SK_DECLARE_INST_COUNT(SkCanvas)
-
/**
* Attempt to allocate raster canvas, matching the ImageInfo, that will draw directly into the
* specified pixels. To access the pixels after drawing to them, the caller should call
@@ -1241,7 +1239,7 @@ protected:
virtual void onDrawVertices(VertexMode, int vertexCount, const SkPoint vertices[],
const SkPoint texs[], const SkColor colors[], SkXfermode*,
const uint16_t indices[], int indexCount, const SkPaint&);
-
+
virtual void onDrawAtlas(const SkImage*, const SkRSXform[], const SkRect[], const SkColor[],
int count, SkXfermode::Mode, const SkRect* cull, const SkPaint*);
virtual void onDrawPath(const SkPath&, const SkPaint&);
diff --git a/include/core/SkColorFilter.h b/include/core/SkColorFilter.h
index ea314811ba..5ba1a8fa44 100644
--- a/include/core/SkColorFilter.h
+++ b/include/core/SkColorFilter.h
@@ -27,8 +27,6 @@ class GrContext;
*/
class SK_API SkColorFilter : public SkFlattenable {
public:
- SK_DECLARE_INST_COUNT(SkColorFilter)
-
/**
* If the filter can be represented by a source color plus Mode, this
* returns true, and sets (if not NULL) the color and mode appropriately.
diff --git a/include/core/SkColorTable.h b/include/core/SkColorTable.h
index d31ddbd643..31891e9401 100644
--- a/include/core/SkColorTable.h
+++ b/include/core/SkColorTable.h
@@ -24,8 +24,6 @@
*/
class SK_API SkColorTable : public SkRefCnt {
public:
- SK_DECLARE_INST_COUNT(SkColorTable)
-
/** Copy up to 256 colors into a new SkColorTable.
*/
SkColorTable(const SkPMColor colors[], int count);
diff --git a/include/core/SkData.h b/include/core/SkData.h
index d9dd22de9d..28bf515347 100644
--- a/include/core/SkData.h
+++ b/include/core/SkData.h
@@ -20,8 +20,6 @@ class SkStream;
*/
class SK_API SkData : public SkRefCnt {
public:
- SK_DECLARE_INST_COUNT(SkData)
-
/**
* Returns the number of bytes stored.
*/
diff --git a/include/core/SkDataTable.h b/include/core/SkDataTable.h
index 9440000e00..798ca9c0c4 100644
--- a/include/core/SkDataTable.h
+++ b/include/core/SkDataTable.h
@@ -20,8 +20,6 @@
*/
class SK_API SkDataTable : public SkRefCnt {
public:
- SK_DECLARE_INST_COUNT(SkDataTable)
-
/**
* Returns true if the table is empty (i.e. has no entries).
*/
diff --git a/include/core/SkDevice.h b/include/core/SkDevice.h
index 6b00c104fc..3f556f6939 100644
--- a/include/core/SkDevice.h
+++ b/include/core/SkDevice.h
@@ -26,8 +26,6 @@ class GrRenderTarget;
class SK_API SkBaseDevice : public SkRefCnt {
public:
- SK_DECLARE_INST_COUNT(SkBaseDevice)
-
/**
* Construct a new device.
*/
diff --git a/include/core/SkDocument.h b/include/core/SkDocument.h
index 8d48aad25b..a35f448208 100644
--- a/include/core/SkDocument.h
+++ b/include/core/SkDocument.h
@@ -32,8 +32,6 @@ class SkWStream;
*/
class SK_API SkDocument : public SkRefCnt {
public:
- SK_DECLARE_INST_COUNT(SkDocument)
-
/**
* Create a PDF-backed document, writing the results into a SkWStream.
*
diff --git a/include/core/SkDrawFilter.h b/include/core/SkDrawFilter.h
index 52cbba9d20..865df5f1e1 100644
--- a/include/core/SkDrawFilter.h
+++ b/include/core/SkDrawFilter.h
@@ -23,8 +23,6 @@ class SkPaint;
*/
class SK_API SkDrawFilter : public SkRefCnt {
public:
- SK_DECLARE_INST_COUNT(SkDrawFilter)
-
enum Type {
kPaint_Type,
kPoint_Type,
diff --git a/include/core/SkDrawLooper.h b/include/core/SkDrawLooper.h
index ec070467a5..28d7d8beef 100644
--- a/include/core/SkDrawLooper.h
+++ b/include/core/SkDrawLooper.h
@@ -30,8 +30,6 @@ class SkString;
*/
class SK_API SkDrawLooper : public SkFlattenable {
public:
- SK_DECLARE_INST_COUNT(SkDrawLooper)
-
/**
* Holds state during a draw. Users call next() until it returns false.
*
diff --git a/include/core/SkFlattenable.h b/include/core/SkFlattenable.h
index 74f8717b68..208b71ef26 100644
--- a/include/core/SkFlattenable.h
+++ b/include/core/SkFlattenable.h
@@ -80,8 +80,6 @@ public:
kSkXfermode_Type,
};
- SK_DECLARE_INST_COUNT(SkFlattenable)
-
typedef SkFlattenable* (*Factory)(SkReadBuffer&);
SkFlattenable() {}
diff --git a/include/core/SkImage.h b/include/core/SkImage.h
index 8cd19c9ea7..e0ea7217d0 100644
--- a/include/core/SkImage.h
+++ b/include/core/SkImage.h
@@ -41,8 +41,6 @@ class GrTexture;
*/
class SK_API SkImage : public SkRefCnt {
public:
- SK_DECLARE_INST_COUNT(SkImage)
-
typedef SkImageInfo Info;
typedef void* ReleaseContext;
@@ -172,7 +170,7 @@ public:
*/
bool isTextureBacked() const;
- /**
+ /**
* Retrieves the backend API handle of the texture. If flushPendingGrContextReads then the
* GrContext will issue to the backend API any deferred read operations on the texture before
* returning.
diff --git a/include/core/SkImageDecoder.h b/include/core/SkImageDecoder.h
index f4ae78a378..f1e36e1e4c 100644
--- a/include/core/SkImageDecoder.h
+++ b/include/core/SkImageDecoder.h
@@ -133,8 +133,6 @@ public:
*/
class Peeker : public SkRefCnt {
public:
- SK_DECLARE_INST_COUNT(Peeker)
-
/** Return true to continue decoding, or false to indicate an error, which
will cause the decoder to not return the image.
*/
@@ -376,7 +374,7 @@ protected:
* Return the default preference being used by the current or latest call to decode.
*/
SkColorType getDefaultPref() { return fDefaultPref; }
-
+
/* Helper for subclasses. Call this to allocate the pixel memory given the bitmap's info.
Returns true on success. This method handles checking for an optional Allocator.
*/
@@ -421,7 +419,7 @@ private:
*/
class SkImageDecoderFactory : public SkRefCnt {
public:
- SK_DECLARE_INST_COUNT(SkImageDecoderFactory)
+
virtual SkImageDecoder* newDecoder(SkStreamRewindable*) = 0;
diff --git a/include/core/SkImageFilter.h b/include/core/SkImageFilter.h
index 2b99376819..188905e5d7 100644
--- a/include/core/SkImageFilter.h
+++ b/include/core/SkImageFilter.h
@@ -31,8 +31,6 @@ struct SkIPoint;
*/
class SK_API SkImageFilter : public SkFlattenable {
public:
- SK_DECLARE_INST_COUNT(SkImageFilter)
-
class CropRect {
public:
enum CropEdge {
@@ -84,7 +82,7 @@ public:
class Proxy {
public:
Proxy(SkBaseDevice* device) : fDevice(device) { }
-
+
SkBaseDevice* createDevice(int width, int height);
// Returns true if the proxy handled the filter itself. If this returns
@@ -95,7 +93,7 @@ public:
private:
SkBaseDevice* fDevice;
};
-
+
/**
* Request a new (result) image to be created from the src image.
diff --git a/include/core/SkInstCnt.h b/include/core/SkInstCnt.h
deleted file mode 100644
index 4ff44b5e3c..0000000000
--- a/include/core/SkInstCnt.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Copyright 2012 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#ifndef SkInstCnt_DEFINED
-#define SkInstCnt_DEFINED
-
-/* To count all instances of T, including all subclasses of T,
- * add SK_DECLARE_INST_COUNT(T) to T's class definition.
- * If you want to print out counts of leaked instances, set gPrintInstCount to true in main().
- *
- * E.g.
- * struct Base { SK_DECLARE_INST_COUNT(Base) };
- * struct A : public Base {};
- * struct SubBase : public Base { SK_DECLARE_INST_COUNT(SubBase); }
- * struct B : public SubBase {};
- *
- * If gPrintInstCount is true, at the program exit you will see something like:
- * Base: <N> leaked instances
- * SubBase: <M> leaked instances
- * where N >= M. Leaked instances of A count against Base; leaked instances of B count against
- * both SubBase and Base.
- *
- * If SK_ENABLE_INST_COUNT is not defined or defined to 0, or we're in a shared library build,
- * this entire system is compiled away to a noop.
- */
-
-#include "SkTypes.h"
-
-#if SK_ENABLE_INST_COUNT && !defined(SKIA_DLL) // See skia:2058 for why we noop on shared builds.
- #include "SkThread.h"
- #include <stdlib.h>
-
- #define SK_DECLARE_INST_COUNT(T) \
- static const char* InstCountClassName() { return #T; } \
- SkInstCount<T, T::InstCountClassName> fInstCnt; \
- static int32_t GetInstanceCount() { return SkInstCount<T, InstCountClassName>::Count(); }
-
- extern bool gPrintInstCount;
-
- template <typename T, const char*(Name)()>
- class SkInstCount {
- public:
- SkInstCount() { Inc(); }
- SkInstCount(const SkInstCount&) { Inc(); }
- ~SkInstCount() { sk_atomic_dec(&gCount); }
-
- SkInstCount& operator==(const SkInstCount&) { return *this; } // == can't change the count.
-
- static void Inc() {
- // If it's the first time we go from 0 to 1, register to print leaks at process exit.
- if (0 == sk_atomic_inc(&gCount) && sk_atomic_cas(&gRegistered, 0, 1)) {
- atexit(PrintAtExit);
- }
- }
-
- static void PrintAtExit() {
- int32_t leaks = Count();
- if (gPrintInstCount && leaks > 0) {
- SkDebugf("Leaked %s: %d\n", Name(), leaks);
- }
- }
-
- // FIXME: Used publicly by unit tests. Seems like a bad idea in a DM world.
- static int32_t Count() { return sk_acquire_load(&gCount); }
-
- private:
- static int32_t gCount, gRegistered;
- };
- // As template values, these will be deduplicated. (No one-definition rule problems.)
- template <typename T, const char*(Name)()> int32_t SkInstCount<T, Name>::gCount = 0;
- template <typename T, const char*(Name)()> int32_t SkInstCount<T, Name>::gRegistered = 0;
-#else
- #define SK_DECLARE_INST_COUNT(T)
-#endif
-
-void SkInstCountPrintLeaksOnExit();
-
-#endif // SkInstCnt_DEFINED
diff --git a/include/core/SkMallocPixelRef.h b/include/core/SkMallocPixelRef.h
index 1cc9c4eb81..1baceae166 100644
--- a/include/core/SkMallocPixelRef.h
+++ b/include/core/SkMallocPixelRef.h
@@ -16,7 +16,6 @@
*/
class SK_API SkMallocPixelRef : public SkPixelRef {
public:
- SK_DECLARE_INST_COUNT(SkMallocPixelRef)
/**
* Return a new SkMallocPixelRef with the provided pixel storage, rowBytes,
* and optional colortable. The caller is responsible for managing the
diff --git a/include/core/SkMaskFilter.h b/include/core/SkMaskFilter.h
index c94faf6fe2..4490c6f16a 100644
--- a/include/core/SkMaskFilter.h
+++ b/include/core/SkMaskFilter.h
@@ -41,8 +41,6 @@ class SkStrokeRec;
*/
class SK_API SkMaskFilter : public SkFlattenable {
public:
- SK_DECLARE_INST_COUNT(SkMaskFilter)
-
/** Returns the format of the resulting mask that this subclass will return
when its filterMask() method is called.
*/
diff --git a/include/core/SkPath.h b/include/core/SkPath.h
index c77b4e6d83..99f8242ff7 100644
--- a/include/core/SkPath.h
+++ b/include/core/SkPath.h
@@ -8,7 +8,6 @@
#ifndef SkPath_DEFINED
#define SkPath_DEFINED
-#include "SkInstCnt.h"
#include "SkMatrix.h"
#include "SkPathRef.h"
#include "SkTDArray.h"
@@ -28,8 +27,6 @@ class SkWStream;
*/
class SK_API SkPath {
public:
- SK_DECLARE_INST_COUNT(SkPath);
-
SkPath();
SkPath(const SkPath&);
~SkPath();
diff --git a/include/core/SkPathEffect.h b/include/core/SkPathEffect.h
index 09070bd331..34d0dd7d51 100644
--- a/include/core/SkPathEffect.h
+++ b/include/core/SkPathEffect.h
@@ -29,8 +29,6 @@ class SkPath;
*/
class SK_API SkPathEffect : public SkFlattenable {
public:
- SK_DECLARE_INST_COUNT(SkPathEffect)
-
/**
* Given a src path (input) and a stroke-rec (input and output), apply
* this effect to the src path, returning the new path in dst, and return
@@ -168,7 +166,7 @@ protected:
// these are visible to our subclasses
SkPathEffect* fPE0, *fPE1;
- SK_TO_STRING_OVERRIDE()
+ SK_TO_STRING_OVERRIDE()
private:
typedef SkPathEffect INHERITED;
@@ -193,7 +191,7 @@ public:
virtual bool filterPath(SkPath* dst, const SkPath& src,
SkStrokeRec*, const SkRect*) const override;
- SK_TO_STRING_OVERRIDE()
+ SK_TO_STRING_OVERRIDE()
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkComposePathEffect)
#ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK
@@ -230,7 +228,7 @@ public:
virtual bool filterPath(SkPath* dst, const SkPath& src,
SkStrokeRec*, const SkRect*) const override;
- SK_TO_STRING_OVERRIDE()
+ SK_TO_STRING_OVERRIDE()
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkSumPathEffect)
#ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK
diff --git a/include/core/SkPathRef.h b/include/core/SkPathRef.h
index ded8e3fb64..ae8945de08 100644
--- a/include/core/SkPathRef.h
+++ b/include/core/SkPathRef.h
@@ -36,8 +36,6 @@ class SkWBuffer;
class SK_API SkPathRef : public ::SkRefCnt {
public:
- SK_DECLARE_INST_COUNT(SkPathRef);
-
class Editor {
public:
Editor(SkAutoTUnref<SkPathRef>* pathRef,
diff --git a/include/core/SkPixelRef.h b/include/core/SkPixelRef.h
index c02664df7d..4d84665a98 100644
--- a/include/core/SkPixelRef.h
+++ b/include/core/SkPixelRef.h
@@ -49,8 +49,6 @@ class GrTexture;
*/
class SK_API SkPixelRef : public SkRefCnt {
public:
- SK_DECLARE_INST_COUNT(SkPixelRef)
-
explicit SkPixelRef(const SkImageInfo&);
SkPixelRef(const SkImageInfo&, SkBaseMutex* mutex);
virtual ~SkPixelRef();
diff --git a/include/core/SkPostConfig.h b/include/core/SkPostConfig.h
index 1508b1a2ff..73c8fa1ea7 100644
--- a/include/core/SkPostConfig.h
+++ b/include/core/SkPostConfig.h
@@ -122,23 +122,6 @@
///////////////////////////////////////////////////////////////////////////////
-/**
- * SK_ENABLE_INST_COUNT controlls printing how many reference counted objects
- * are still held on exit.
- * Defaults to 1 in DEBUG and 0 in RELEASE.
- */
-#ifndef SK_ENABLE_INST_COUNT
-// Only enabled for static builds, because instance counting relies on static
-// variables in functions defined in header files.
-# if SK_DEVELOPER && !defined(SKIA_DLL)
-# define SK_ENABLE_INST_COUNT 1
-# else
-# define SK_ENABLE_INST_COUNT 0
-# endif
-#endif
-
-///////////////////////////////////////////////////////////////////////////////
-
#ifdef SK_BUILD_FOR_WIN
# ifndef WIN32_LEAN_AND_MEAN
# define WIN32_LEAN_AND_MEAN
diff --git a/include/core/SkRasterizer.h b/include/core/SkRasterizer.h
index 10caad76bf..1881ccef24 100644
--- a/include/core/SkRasterizer.h
+++ b/include/core/SkRasterizer.h
@@ -20,8 +20,6 @@ struct SkIRect;
class SK_API SkRasterizer : public SkFlattenable {
public:
- SK_DECLARE_INST_COUNT(SkRasterizer)
-
/** Turn the path into a mask, respecting the specified local->device matrix.
*/
bool rasterize(const SkPath& path, const SkMatrix& matrix,
diff --git a/include/core/SkRefCnt.h b/include/core/SkRefCnt.h
index 1632361519..995bdfb2fd 100644
--- a/include/core/SkRefCnt.h
+++ b/include/core/SkRefCnt.h
@@ -11,7 +11,6 @@
#define SkRefCnt_DEFINED
#include "SkAtomics.h"
-#include "SkInstCnt.h"
#include "SkTemplates.h"
/** \class SkRefCntBase
@@ -26,8 +25,6 @@
*/
class SK_API SkRefCntBase : SkNoncopyable {
public:
- SK_DECLARE_INST_COUNT(SkRefCntBase)
-
/** Default construct, initializing the reference count to 1.
*/
SkRefCntBase() : fRefCnt(1) {}
diff --git a/include/core/SkShader.h b/include/core/SkShader.h
index 3739c9c73c..119da87666 100644
--- a/include/core/SkShader.h
+++ b/include/core/SkShader.h
@@ -33,8 +33,6 @@ class GrFragmentProcessor;
*/
class SK_API SkShader : public SkFlattenable {
public:
- SK_DECLARE_INST_COUNT(SkShader)
-
SkShader(const SkMatrix* localMatrix = NULL);
virtual ~SkShader();
diff --git a/include/core/SkStream.h b/include/core/SkStream.h
index 4c9c461e64..6767778343 100644
--- a/include/core/SkStream.h
+++ b/include/core/SkStream.h
@@ -181,8 +181,6 @@ public:
class SK_API SkWStream : SkNoncopyable {
public:
- SK_DECLARE_INST_COUNT(SkWStream)
-
virtual ~SkWStream();
/** Called to write bytes to a SkWStream. Returns true on success
@@ -231,8 +229,6 @@ struct SkFILE;
/** A stream that wraps a C FILE* file stream. */
class SK_API SkFILEStream : public SkStreamAsset {
public:
- SK_DECLARE_INST_COUNT(SkFILEStream)
-
/** Initialize the stream by calling sk_fopen on the specified path.
* This internal stream will be closed in the destructor.
*/
@@ -286,8 +282,6 @@ private:
class SK_API SkMemoryStream : public SkStreamMemory {
public:
- SK_DECLARE_INST_COUNT(SkMemoryStream)
-
SkMemoryStream();
/** We allocate (and free) the memory. Write to it via getMemoryBase() */
@@ -358,8 +352,6 @@ private:
class SK_API SkFILEWStream : public SkWStream {
public:
- SK_DECLARE_INST_COUNT(SkFILEWStream)
-
SkFILEWStream(const char path[]);
virtual ~SkFILEWStream();
@@ -379,8 +371,6 @@ private:
class SkMemoryWStream : public SkWStream {
public:
- SK_DECLARE_INST_COUNT(SkMemoryWStream)
-
SkMemoryWStream(void* buffer, size_t size);
bool write(const void* buffer, size_t size) override;
size_t bytesWritten() const override { return fBytesWritten; }
@@ -395,8 +385,6 @@ private:
class SK_API SkDynamicMemoryWStream : public SkWStream {
public:
- SK_DECLARE_INST_COUNT(SkDynamicMemoryWStream)
-
SkDynamicMemoryWStream();
virtual ~SkDynamicMemoryWStream();
@@ -444,7 +432,6 @@ private:
class SK_API SkDebugWStream : public SkWStream {
public:
SkDebugWStream() : fBytesWritten(0) {}
- SK_DECLARE_INST_COUNT(SkDebugWStream)
// overrides
bool write(const void* buffer, size_t size) override;
diff --git a/include/core/SkSurface.h b/include/core/SkSurface.h
index de84766647..8ccfa31124 100644
--- a/include/core/SkSurface.h
+++ b/include/core/SkSurface.h
@@ -30,8 +30,6 @@ class GrRenderTarget;
*/
class SK_API SkSurface : public SkRefCnt {
public:
- SK_DECLARE_INST_COUNT(SkSurface)
-
/**
* Indicates whether a new surface or image should count against a cache budget. Currently this
* is only used by the GPU backend (sw-raster surfaces and images are never counted against the
@@ -84,7 +82,7 @@ public:
* Return a new surface using the specified render target.
*/
static SkSurface* NewRenderTargetDirect(GrRenderTarget*, const SkSurfaceProps*);
-
+
static SkSurface* NewRenderTargetDirect(GrRenderTarget* target) {
return NewRenderTargetDirect(target, NULL);
}
@@ -95,7 +93,7 @@ public:
*/
static SkSurface* NewWrappedRenderTarget(GrContext*, GrBackendTextureDesc,
const SkSurfaceProps*);
-
+
/**
* Return a new surface whose contents will be drawn to an offscreen
* render target, allocated by the surface.
diff --git a/include/core/SkTypeface.h b/include/core/SkTypeface.h
index f0059deb25..9eac50e03f 100644
--- a/include/core/SkTypeface.h
+++ b/include/core/SkTypeface.h
@@ -41,8 +41,6 @@ typedef uint32_t SkFontTableTag;
*/
class SK_API SkTypeface : public SkWeakRefCnt {
public:
- SK_DECLARE_INST_COUNT(SkTypeface)
-
/** Style specifies the intrinsic style attributes of a given typeface
*/
enum Style {
diff --git a/include/core/SkWeakRefCnt.h b/include/core/SkWeakRefCnt.h
index 91795f7adb..0798f4e509 100644
--- a/include/core/SkWeakRefCnt.h
+++ b/include/core/SkWeakRefCnt.h
@@ -51,8 +51,6 @@
*/
class SK_API SkWeakRefCnt : public SkRefCnt {
public:
- SK_DECLARE_INST_COUNT(SkWeakRefCnt)
-
/** Default construct, initializing the reference counts to 1.
The strong references collectively hold one weak reference. When the
strong reference count goes to zero, the collectively held weak
diff --git a/include/core/SkXfermode.h b/include/core/SkXfermode.h
index 1dd01a2e1d..e7f3bd6541 100644
--- a/include/core/SkXfermode.h
+++ b/include/core/SkXfermode.h
@@ -31,8 +31,6 @@ class SkString;
*/
class SK_API SkXfermode : public SkFlattenable {
public:
- SK_DECLARE_INST_COUNT(SkXfermode)
-
virtual void xfer32(SkPMColor dst[], const SkPMColor src[], int count,
const SkAlpha aa[]) const;
virtual void xfer16(uint16_t dst[], const SkPMColor src[], int count,
@@ -169,7 +167,7 @@ public:
/**
* Returns whether or not the xfer mode can support treating coverage as alpha
- */
+ */
virtual bool supportsCoverageAsAlpha() const;
/**
diff --git a/include/effects/SkLayerDrawLooper.h b/include/effects/SkLayerDrawLooper.h
index d93d08ad7e..c59b8b006a 100644
--- a/include/effects/SkLayerDrawLooper.h
+++ b/include/effects/SkLayerDrawLooper.h
@@ -15,8 +15,6 @@
class SK_API SkLayerDrawLooper : public SkDrawLooper {
public:
- SK_DECLARE_INST_COUNT(SkLayerDrawLooper)
-
virtual ~SkLayerDrawLooper();
/**
diff --git a/include/gpu/GrCaps.h b/include/gpu/GrCaps.h
index 9ad20e53e4..3ae75db72f 100644
--- a/include/gpu/GrCaps.h
+++ b/include/gpu/GrCaps.h
@@ -19,8 +19,6 @@ struct GrContextOptions;
class GrShaderCaps : public SkRefCnt {
public:
- SK_DECLARE_INST_COUNT(GrShaderCaps)
-
/** Info about shader variable precision within a given shader stage. That is, this info
is relevant to a float (or vecNf) variable declared with a GrSLPrecision
in a given GrShaderType. The info here is hoisted from the OpenGL spec. */
@@ -108,7 +106,7 @@ private:
*/
class GrCaps : public SkRefCnt {
public:
- SK_DECLARE_INST_COUNT(GrCaps)
+
GrCaps(const GrContextOptions&);
diff --git a/include/gpu/GrContext.h b/include/gpu/GrContext.h
index 8ff108e2a1..63f577fb15 100644
--- a/include/gpu/GrContext.h
+++ b/include/gpu/GrContext.h
@@ -46,8 +46,6 @@ class GrSoftwarePathRenderer;
class SK_API GrContext : public SkRefCnt {
public:
- SK_DECLARE_INST_COUNT(GrContext)
-
/**
* Creates a GrContext for a backend context.
*/
@@ -90,7 +88,7 @@ public:
}
/**
- * Abandons all GPU resources and assumes the underlying backend 3D API
+ * Abandons all GPU resources and assumes the underlying backend 3D API
* context is not longer usable. Call this if you have lost the associated
* GPU context, and thus internal texture, buffer, etc. references/IDs are
* now invalid. Should be called even when GrContext is no longer going to
@@ -172,7 +170,7 @@ public:
int getRecommendedSampleCount(GrPixelConfig config, SkScalar dpi) const;
/**
- * Returns a helper object to orchestrate draws.
+ * Returns a helper object to orchestrate draws.
* Callers should take a ref if they rely on the GrDrawContext sticking around.
* NULL will be returned if the context has been abandoned.
*
@@ -181,7 +179,7 @@ public:
* @return a draw context
*/
GrDrawContext* drawContext(const SkSurfaceProps* surfaceProps = NULL) {
- return fDrawingMgr.drawContext(surfaceProps);
+ return fDrawingMgr.drawContext(surfaceProps);
}
///////////////////////////////////////////////////////////////////////////
@@ -211,7 +209,7 @@ public:
void flushIfNecessary() {
if (fFlushToReduceCacheSize) {
this->flush();
- }
+ }
}
/**
@@ -363,7 +361,7 @@ private:
GrResourceCache* fResourceCache;
// this union exists because the inheritance of GrTextureProvider->GrResourceProvider
// is in a private header.
- union {
+ union {
GrResourceProvider* fResourceProvider;
GrTextureProvider* fTextureProvider;
};
@@ -398,7 +396,7 @@ private:
// and hands the appropriate one back given the user's request.
// All of the GrDrawContexts still land in the same GrDrawTarget!
//
- // In the future this class will allocate a new GrDrawContext for
+ // In the future this class will allocate a new GrDrawContext for
// each GrRenderTarget/GrDrawTarget and manage the DAG.
class DrawingMgr {
public:
diff --git a/include/gpu/GrDrawContext.h b/include/gpu/GrDrawContext.h
index 12bf9430a8..2a1d016541 100644
--- a/include/gpu/GrDrawContext.h
+++ b/include/gpu/GrDrawContext.h
@@ -40,8 +40,6 @@ class SkTextBlob;
*/
class SK_API GrDrawContext : public SkRefCnt {
public:
- SK_DECLARE_INST_COUNT(GrDrawContext)
-
~GrDrawContext() override;
void copySurface(GrRenderTarget* dst, GrSurface* src,
@@ -253,7 +251,7 @@ private:
const GrPaint* paint);
GrTextContext* createTextContext(GrRenderTarget*, const SkSurfaceProps&);
- // A simpler version of the above which just returns true on success; false on failure.
+ // A simpler version of the above which just returns true on success; false on failure.
// Clip is *NOT* set
bool prepareToDraw(GrRenderTarget* rt);
diff --git a/include/gpu/GrGpuResource.h b/include/gpu/GrGpuResource.h
index 6f9855f17c..d726115a72 100644
--- a/include/gpu/GrGpuResource.h
+++ b/include/gpu/GrGpuResource.h
@@ -11,7 +11,6 @@
#include "GrResourceKey.h"
#include "GrTypesPriv.h"
#include "SkData.h"
-#include "SkInstCnt.h"
class GrContext;
class GrGpu;
@@ -46,8 +45,6 @@ class GrResourceCache;
*/
template <typename DERIVED> class GrIORef : public SkNoncopyable {
public:
- SK_DECLARE_INST_COUNT(GrIORef)
-
// Some of the signatures are written to mirror SkRefCnt so that GrGpuResource can work with
// templated helper classes (e.g. SkAutoTUnref). However, we have different categories of
// refs (e.g. pending reads). We also don't require thread safety as GrCacheable objects are
@@ -59,7 +56,7 @@ public:
void unref() const {
this->validate();
-
+
if (!(--fRefCnt)) {
if (!static_cast<const DERIVED*>(this)->notifyRefCountIsZero()) {
return;
@@ -141,7 +138,7 @@ private:
*/
class SK_API GrGpuResource : public GrIORef<GrGpuResource> {
public:
- SK_DECLARE_INST_COUNT(GrGpuResource)
+
enum LifeCycle {
/**
diff --git a/include/gpu/GrGpuResourceRef.h b/include/gpu/GrGpuResourceRef.h
index b8ba334ff3..70d2568784 100644
--- a/include/gpu/GrGpuResourceRef.h
+++ b/include/gpu/GrGpuResourceRef.h
@@ -36,8 +36,6 @@
*/
class GrGpuResourceRef : SkNoncopyable {
public:
- SK_DECLARE_INST_COUNT(GrGpuResourceRef);
-
~GrGpuResourceRef();
GrGpuResource* getResource() const { return fResource; }
diff --git a/include/gpu/GrPathRendererChain.h b/include/gpu/GrPathRendererChain.h
index 9b703dacdd..bacf2d4521 100644
--- a/include/gpu/GrPathRendererChain.h
+++ b/include/gpu/GrPathRendererChain.h
@@ -34,8 +34,6 @@ public:
kNoRestriction_StencilSupport,
};
- SK_DECLARE_INST_COUNT(GrPathRendererChain)
-
GrPathRendererChain(GrContext* context);
~GrPathRendererChain();
diff --git a/include/gpu/GrProcessor.h b/include/gpu/GrProcessor.h
index 8a8d685e51..719577377d 100644
--- a/include/gpu/GrProcessor.h
+++ b/include/gpu/GrProcessor.h
@@ -57,8 +57,6 @@ private:
*/
class GrProcessor : public GrProgramElement {
public:
- SK_DECLARE_INST_COUNT(GrProcessor)
-
virtual ~GrProcessor();
/** Human-meaningful string to identify this prcoessor; may be embedded
diff --git a/include/gpu/GrProgramElement.h b/include/gpu/GrProgramElement.h
index 5ebf150a84..2d834de5d7 100644
--- a/include/gpu/GrProgramElement.h
+++ b/include/gpu/GrProgramElement.h
@@ -25,8 +25,6 @@ class GrGpuResourceRef;
*/
class GrProgramElement : public SkNoncopyable {
public:
- SK_DECLARE_INST_COUNT(GrProgramElement)
-
virtual ~GrProgramElement() {
// fRefCnt can be one when an effect is created statically using GR_CREATE_STATIC_EFFECT
SkASSERT((0 == fRefCnt || 1 == fRefCnt) && 0 == fPendingExecutions);
diff --git a/include/gpu/GrRenderTarget.h b/include/gpu/GrRenderTarget.h
index 91a67ae133..67dcd4f4c2 100644
--- a/include/gpu/GrRenderTarget.h
+++ b/include/gpu/GrRenderTarget.h
@@ -23,8 +23,6 @@ class GrRenderTargetPriv;
*/
class GrRenderTarget : virtual public GrSurface {
public:
- SK_DECLARE_INST_COUNT(GrRenderTarget)
-
// GrSurface overrides
GrRenderTarget* asRenderTarget() override { return this; }
const GrRenderTarget* asRenderTarget() const override { return this; }
diff --git a/include/gpu/GrSurface.h b/include/gpu/GrSurface.h
index 123ab1b3c7..543ccd134f 100644
--- a/include/gpu/GrSurface.h
+++ b/include/gpu/GrSurface.h
@@ -20,8 +20,6 @@ class GrTexture;
class GrSurface : public GrGpuResource {
public:
- SK_DECLARE_INST_COUNT(GrSurface);
-
/**
* Retrieves the width of the surface.
*/
@@ -122,14 +120,14 @@ public:
* if the surface has MSAA it will be resolved.
*/
void prepareForExternalRead();
-
+
/** Access methods that are only to be used within Skia code. */
inline GrSurfacePriv surfacePriv();
inline const GrSurfacePriv surfacePriv() const;
typedef void* ReleaseCtx;
typedef void (*ReleaseProc)(ReleaseCtx);
-
+
void setRelease(ReleaseProc proc, ReleaseCtx ctx) {
fReleaseProc = proc;
fReleaseCtx = ctx;
@@ -170,7 +168,7 @@ private:
fReleaseProc = NULL;
}
}
-
+
ReleaseProc fReleaseProc;
ReleaseCtx fReleaseCtx;
diff --git a/include/gpu/GrTextureAccess.h b/include/gpu/GrTextureAccess.h
index db6f752bec..df0bdfda0f 100644
--- a/include/gpu/GrTextureAccess.h
+++ b/include/gpu/GrTextureAccess.h
@@ -113,8 +113,6 @@ private:
*/
class GrTextureAccess : public SkNoncopyable {
public:
- SK_DECLARE_INST_COUNT(GrTextureAccess);
-
/**
* A default GrTextureAccess must have reset() called on it in a GrProcessor subclass's
* constructor if it will be accessible via GrProcessor::textureAccess().
diff --git a/include/gpu/SkGrPixelRef.h b/include/gpu/SkGrPixelRef.h
index 97780f91ef..c06154db10 100644
--- a/include/gpu/SkGrPixelRef.h
+++ b/include/gpu/SkGrPixelRef.h
@@ -20,7 +20,6 @@
*/
class SK_API SkROLockPixelsPixelRef : public SkPixelRef {
public:
- SK_DECLARE_INST_COUNT(SkROLockPixelsPixelRef)
SkROLockPixelsPixelRef(const SkImageInfo&);
virtual ~SkROLockPixelsPixelRef();
@@ -39,7 +38,6 @@ private:
*/
class SK_API SkGrPixelRef : public SkROLockPixelsPixelRef {
public:
- SK_DECLARE_INST_COUNT(SkGrPixelRef)
/**
* Constructs a pixel ref around a GrSurface.
*/
diff --git a/include/gpu/gl/GrGLInterface.h b/include/gpu/gl/GrGLInterface.h
index 8c7252685e..8626dc3719 100644
--- a/include/gpu/gl/GrGLInterface.h
+++ b/include/gpu/gl/GrGLInterface.h
@@ -121,7 +121,7 @@ private:
typedef SkRefCnt INHERITED;
public:
- SK_DECLARE_INST_COUNT(GrGLInterface)
+
GrGLInterface();
diff --git a/include/gpu/gl/SkGLContext.h b/include/gpu/gl/SkGLContext.h
index 8209c3168c..3d232e558e 100644
--- a/include/gpu/gl/SkGLContext.h
+++ b/include/gpu/gl/SkGLContext.h
@@ -18,7 +18,7 @@
class SK_API SkGLContext : public SkRefCnt {
public:
- SK_DECLARE_INST_COUNT(SkGLContext)
+
~SkGLContext() override;
diff --git a/include/images/SkMovie.h b/include/images/SkMovie.h
index e52a3a8f40..00dad67885 100644
--- a/include/images/SkMovie.h
+++ b/include/images/SkMovie.h
@@ -17,7 +17,7 @@ class SkStreamRewindable;
class SkMovie : public SkRefCnt {
public:
- SK_DECLARE_INST_COUNT(SkMovie)
+
/** Try to create a movie from the stream. If the stream format is not
supported, return NULL.
diff --git a/include/ports/SkFontConfigInterface.h b/include/ports/SkFontConfigInterface.h
index d8b27c086f..fd5e812a5b 100644
--- a/include/ports/SkFontConfigInterface.h
+++ b/include/ports/SkFontConfigInterface.h
@@ -24,7 +24,7 @@ struct SkBaseMutex;
*/
class SK_API SkFontConfigInterface : public SkRefCnt {
public:
- SK_DECLARE_INST_COUNT(SkFontConfigInterface)
+
/**
* Returns the global SkFontConfigInterface instance, and if it is not
diff --git a/include/ports/SkFontMgr.h b/include/ports/SkFontMgr.h
index 48a0494a7a..cdf72646ab 100644
--- a/include/ports/SkFontMgr.h
+++ b/include/ports/SkFontMgr.h
@@ -19,7 +19,7 @@ class SkTypeface;
class SK_API SkFontStyleSet : public SkRefCnt {
public:
- SK_DECLARE_INST_COUNT(SkFontStyleSet)
+
virtual int count() = 0;
virtual void getStyle(int index, SkFontStyle*, SkString* style) = 0;
@@ -36,7 +36,7 @@ class SkTypeface;
class SK_API SkFontMgr : public SkRefCnt {
public:
- SK_DECLARE_INST_COUNT(SkFontMgr)
+
int countFamilies() const;
void getFamilyName(int index, SkString* familyName) const;
diff --git a/include/ports/SkRemotableFontMgr.h b/include/ports/SkRemotableFontMgr.h
index 29ca6e82a5..63c032c821 100644
--- a/include/ports/SkRemotableFontMgr.h
+++ b/include/ports/SkRemotableFontMgr.h
@@ -35,7 +35,7 @@ struct SK_API SkFontIdentity {
class SK_API SkRemotableFontIdentitySet : public SkRefCnt {
public:
- SK_DECLARE_INST_COUNT(SkRemotableFontIdentitySet)
+
SkRemotableFontIdentitySet(int count, SkFontIdentity** data);
@@ -57,7 +57,7 @@ private:
class SK_API SkRemotableFontMgr : public SkRefCnt {
public:
- SK_DECLARE_INST_COUNT(SkRemotableFontMgr)
+
/**
* Returns the names of the known fonts on the system.
diff --git a/include/utils/SkBoundaryPatch.h b/include/utils/SkBoundaryPatch.h
index cf001d5ba8..f8edd594b9 100644
--- a/include/utils/SkBoundaryPatch.h
+++ b/include/utils/SkBoundaryPatch.h
@@ -13,7 +13,7 @@
class SkBoundary : public SkRefCnt {
public:
- SK_DECLARE_INST_COUNT(SkBoundary)
+
// These must be 0, 1, 2, 3 for efficiency in the subclass implementations
enum Edge {
diff --git a/include/utils/SkDumpCanvas.h b/include/utils/SkDumpCanvas.h
index cbae148a16..b825b39adf 100644
--- a/include/utils/SkDumpCanvas.h
+++ b/include/utils/SkDumpCanvas.h
@@ -57,7 +57,7 @@ public:
*/
class Dumper : public SkRefCnt {
public:
- SK_DECLARE_INST_COUNT(Dumper)
+
virtual void dump(SkDumpCanvas*, SkDumpCanvas::Verb, const char str[],
const SkPaint*) = 0;
diff --git a/include/utils/SkLayer.h b/include/utils/SkLayer.h
index 70fa01bfe7..7fdc6b2208 100644
--- a/include/utils/SkLayer.h
+++ b/include/utils/SkLayer.h
@@ -23,7 +23,7 @@ class SkCanvas;
class SkLayer : public SkRefCnt {
public:
- SK_DECLARE_INST_COUNT(SkLayer)
+
SkLayer();
SkLayer(const SkLayer&);
diff --git a/include/views/SkEventSink.h b/include/views/SkEventSink.h
index 01d4f7a252..9714532f97 100644
--- a/include/views/SkEventSink.h
+++ b/include/views/SkEventSink.h
@@ -21,7 +21,7 @@ struct SkTagList;
*/
class SkEventSink : public SkRefCnt {
public:
- SK_DECLARE_INST_COUNT(SkEventSink)
+
SkEventSink();
virtual ~SkEventSink();
diff --git a/include/views/SkView.h b/include/views/SkView.h
index db712317e5..e099e0d405 100644
--- a/include/views/SkView.h
+++ b/include/views/SkView.h
@@ -258,7 +258,7 @@ public:
*/
class Artist : public SkRefCnt {
public:
- SK_DECLARE_INST_COUNT(Artist)
+
void draw(SkView*, SkCanvas*);
void inflate(const SkDOM&, const SkDOM::Node*);
@@ -286,7 +286,7 @@ public:
*/
class Layout : public SkRefCnt {
public:
- SK_DECLARE_INST_COUNT(Layout)
+
void layoutChildren(SkView* parent);
void inflate(const SkDOM&, const SkDOM::Node*);
diff --git a/include/views/animated/SkWidgetViews.h b/include/views/animated/SkWidgetViews.h
index 40346600c3..728eec2876 100644
--- a/include/views/animated/SkWidgetViews.h
+++ b/include/views/animated/SkWidgetViews.h
@@ -289,7 +289,7 @@ private:
class SkListSource : public SkRefCnt {
public:
- SK_DECLARE_INST_COUNT(SkListSource)
+
virtual int countFields();
virtual void getFieldName(int index, SkString* field);
diff --git a/samplecode/SampleApp.h b/samplecode/SampleApp.h
index 44eda1ecd8..3258193110 100644
--- a/samplecode/SampleApp.h
+++ b/samplecode/SampleApp.h
@@ -68,7 +68,7 @@ public:
*/
class DeviceManager : public SkRefCnt {
public:
- SK_DECLARE_INST_COUNT(DeviceManager)
+
virtual void setUpBackend(SampleWindow* win, int msaaSampleCount) = 0;
diff --git a/src/core/SkAdvancedTypefaceMetrics.h b/src/core/SkAdvancedTypefaceMetrics.h
index 877a2d60fb..37434a3912 100644
--- a/src/core/SkAdvancedTypefaceMetrics.h
+++ b/src/core/SkAdvancedTypefaceMetrics.h
@@ -25,7 +25,7 @@
class SkAdvancedTypefaceMetrics : public SkRefCnt {
public:
- SK_DECLARE_INST_COUNT(SkAdvancedTypefaceMetrics)
+
SkString fFontName;
diff --git a/src/core/SkBBoxHierarchy.h b/src/core/SkBBoxHierarchy.h
index 1ea9e6bdb0..69fb4fd982 100644
--- a/src/core/SkBBoxHierarchy.h
+++ b/src/core/SkBBoxHierarchy.h
@@ -37,7 +37,7 @@ public:
// Get the root bound.
virtual SkRect getRootBound() const = 0;
- SK_DECLARE_INST_COUNT(SkBBoxHierarchy)
+
private:
typedef SkRefCnt INHERITED;
};
diff --git a/src/core/SkBitmapHeap.h b/src/core/SkBitmapHeap.h
index fe171ffbbf..07f629c77a 100644
--- a/src/core/SkBitmapHeap.h
+++ b/src/core/SkBitmapHeap.h
@@ -52,7 +52,7 @@ private:
class SkBitmapHeapReader : public SkRefCnt {
public:
- SK_DECLARE_INST_COUNT(SkBitmapHeapReader)
+
SkBitmapHeapReader() : INHERITED() {}
virtual SkBitmap* getBitmap(int32_t slot) const = 0;
@@ -69,7 +69,7 @@ class SkBitmapHeap : public SkBitmapHeapReader {
public:
class ExternalStorage : public SkRefCnt {
public:
- SK_DECLARE_INST_COUNT(ExternalStorage)
+
virtual bool insert(const SkBitmap& bitmap, int32_t slot) = 0;
diff --git a/src/core/SkDeviceProfile.h b/src/core/SkDeviceProfile.h
index 6ef8dfb839..d949444f8e 100644
--- a/src/core/SkDeviceProfile.h
+++ b/src/core/SkDeviceProfile.h
@@ -12,7 +12,7 @@
class SkDeviceProfile : public SkRefCnt {
public:
- SK_DECLARE_INST_COUNT(SkDeviceProfile)
+
enum LCDConfig {
kNone_LCDConfig, // disables LCD text rendering, uses A8 instead
diff --git a/src/core/SkInstCnt.cpp b/src/core/SkInstCnt.cpp
deleted file mode 100644
index b58c3c0dcb..0000000000
--- a/src/core/SkInstCnt.cpp
+++ /dev/null
@@ -1,15 +0,0 @@
-/*
- * Copyright 2012 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#include "SkInstCnt.h"
-
-#if SK_ENABLE_INST_COUNT && !defined(SKIA_DLL) // See SkInstCnt.h
- bool gPrintInstCount = false;
- void SkInstCountPrintLeaksOnExit() { gPrintInstCount = true; }
-#else
- void SkInstCountPrintLeaksOnExit() {}
-#endif
diff --git a/src/core/SkMaskGamma.h b/src/core/SkMaskGamma.h
index fb67c1abc0..be5d034c81 100644
--- a/src/core/SkMaskGamma.h
+++ b/src/core/SkMaskGamma.h
@@ -92,7 +92,7 @@ void SkTMaskGamma_build_correcting_lut(uint8_t table[256], U8CPU srcI, SkScalar
* @param B The number of luminance bits to use [1, 8] from the blue channel.
*/
template <int R_LUM_BITS, int G_LUM_BITS, int B_LUM_BITS> class SkTMaskGamma : public SkRefCnt {
- SK_DECLARE_INST_COUNT(SkTMaskGamma)
+
public:
/** Creates a linear SkTMaskGamma. */
diff --git a/src/core/SkPictureFlat.h b/src/core/SkPictureFlat.h
index d421c47603..af6c1b4fcb 100644
--- a/src/core/SkPictureFlat.h
+++ b/src/core/SkPictureFlat.h
@@ -182,7 +182,7 @@ class SkFlatData;
class SkFlatController : public SkRefCnt {
public:
- SK_DECLARE_INST_COUNT(SkFlatController)
+
SkFlatController(uint32_t writeBufferFlags = 0);
virtual ~SkFlatController();
diff --git a/src/core/SkPtrRecorder.h b/src/core/SkPtrRecorder.h
index 83200f5275..325471ea71 100644
--- a/src/core/SkPtrRecorder.h
+++ b/src/core/SkPtrRecorder.h
@@ -22,7 +22,7 @@
*/
class SkPtrSet : public SkRefCnt {
public:
- SK_DECLARE_INST_COUNT(SkPtrSet)
+
/**
* Search for the specified ptr in the set. If it is found, return its
@@ -144,7 +144,7 @@ class SkFactorySet : public SkTPtrSet<SkFlattenable::Factory> {};
*/
class SkNamedFactorySet : public SkRefCnt {
public:
- SK_DECLARE_INST_COUNT(SkNamedFactorySet)
+
SkNamedFactorySet();
diff --git a/src/core/SkRTree.h b/src/core/SkRTree.h
index 9db6d33797..205c0b60c2 100644
--- a/src/core/SkRTree.h
+++ b/src/core/SkRTree.h
@@ -31,7 +31,7 @@
*/
class SkRTree : public SkBBoxHierarchy {
public:
- SK_DECLARE_INST_COUNT(SkRTree)
+
/**
* If you have some prior information about the distribution of bounds you're expecting, you
diff --git a/src/core/SkResourceCache.cpp b/src/core/SkResourceCache.cpp
index efe55b4838..f0fe72113e 100644
--- a/src/core/SkResourceCache.cpp
+++ b/src/core/SkResourceCache.cpp
@@ -74,7 +74,7 @@ void SkResourceCache::init() {
class SkOneShotDiscardablePixelRef : public SkPixelRef {
public:
- SK_DECLARE_INST_COUNT(SkOneShotDiscardablePixelRef)
+
// Ownership of the discardablememory is transfered to the pixelref
SkOneShotDiscardablePixelRef(const SkImageInfo&, SkDiscardableMemory*, size_t rowBytes);
~SkOneShotDiscardablePixelRef();
diff --git a/src/effects/SkLightingImageFilter.cpp b/src/effects/SkLightingImageFilter.cpp
index 3e6a903eab..1b309abd0a 100644
--- a/src/effects/SkLightingImageFilter.cpp
+++ b/src/effects/SkLightingImageFilter.cpp
@@ -682,7 +682,7 @@ class GrGLLight;
class SkLight : public SkRefCnt {
public:
- SK_DECLARE_INST_COUNT(SkLight)
+
enum LightType {
kDistant_LightType,
diff --git a/src/fonts/SkTestScalerContext.h b/src/fonts/SkTestScalerContext.h
index 5838c801c5..95316d7d5b 100644
--- a/src/fonts/SkTestScalerContext.h
+++ b/src/fonts/SkTestScalerContext.h
@@ -30,7 +30,7 @@ struct SkTestFontData {
class SkTestFont : public SkRefCnt {
public:
- SK_DECLARE_INST_COUNT(SkTestFont)
+
SkTestFont(const SkTestFontData& );
virtual ~SkTestFont();
diff --git a/src/gpu/GrBatch.h b/src/gpu/GrBatch.h
index 9c1647d2df..eb385635bc 100644
--- a/src/gpu/GrBatch.h
+++ b/src/gpu/GrBatch.h
@@ -39,7 +39,7 @@ struct GrInitInvariantOutput;
class GrBatch : public SkRefCnt {
public:
- SK_DECLARE_INST_COUNT(GrBatch)
+
GrBatch() : fClassID(kIllegalBatchClassID), fNumberOfDraws(0) { SkDEBUGCODE(fUsed = false;) }
virtual ~GrBatch() {}
diff --git a/src/gpu/GrBatchAtlas.cpp b/src/gpu/GrBatchAtlas.cpp
index 20e73e4531..c11c32b38d 100644
--- a/src/gpu/GrBatchAtlas.cpp
+++ b/src/gpu/GrBatchAtlas.cpp
@@ -33,7 +33,7 @@ static GrBatchAtlas::AtlasID create_id(int index, int generation) {
class BatchPlot : public SkRefCnt {
public:
typedef GrBatchAtlas::BatchToken BatchToken;
- SK_DECLARE_INST_COUNT(BatchPlot);
+
SK_DECLARE_INTERNAL_LLIST_INTERFACE(BatchPlot);
// index() refers to the index of the plot in the owning GrAtlas's plot array. genID() is a
diff --git a/src/gpu/GrDrawTarget.h b/src/gpu/GrDrawTarget.h
index 30a6cee4fa..cc9cda94f3 100644
--- a/src/gpu/GrDrawTarget.h
+++ b/src/gpu/GrDrawTarget.h
@@ -37,7 +37,7 @@ class GrPipeline;
class GrDrawTarget : public SkRefCnt {
public:
- SK_DECLARE_INST_COUNT(GrDrawTarget)
+
typedef GrPathRange::PathIndexType PathIndexType;
typedef GrPathRendering::PathTransformType PathTransformType;
diff --git a/src/gpu/GrFontScaler.h b/src/gpu/GrFontScaler.h
index 54d1e3f9cc..5e769905d0 100644
--- a/src/gpu/GrFontScaler.h
+++ b/src/gpu/GrFontScaler.h
@@ -21,7 +21,7 @@ class SkPath;
*/
class GrFontDescKey : public SkRefCnt {
public:
- SK_DECLARE_INST_COUNT(GrFontDescKey)
+
typedef uint32_t Hash;
@@ -60,7 +60,7 @@ private:
*/
class GrFontScaler : public SkRefCnt {
public:
- SK_DECLARE_INST_COUNT(GrFontScaler)
+
explicit GrFontScaler(SkGlyphCache* strike);
virtual ~GrFontScaler();
diff --git a/src/gpu/GrGeometryBuffer.h b/src/gpu/GrGeometryBuffer.h
index 55d43d7c66..adccbf80e4 100644
--- a/src/gpu/GrGeometryBuffer.h
+++ b/src/gpu/GrGeometryBuffer.h
@@ -19,7 +19,7 @@ class GrGpu;
*/
class GrGeometryBuffer : public GrGpuResource {
public:
- SK_DECLARE_INST_COUNT(GrGeometryBuffer);
+
/**
*Retrieves whether the buffer was created with the dynamic flag
diff --git a/src/gpu/GrPath.h b/src/gpu/GrPath.h
index 91975218c2..f74baf317d 100644
--- a/src/gpu/GrPath.h
+++ b/src/gpu/GrPath.h
@@ -15,7 +15,7 @@
class GrPath : public GrGpuResource {
public:
- SK_DECLARE_INST_COUNT(GrPath);
+
/**
* Initialize to a path with a fixed stroke. Stroke must not be hairline.
diff --git a/src/gpu/GrPathRange.h b/src/gpu/GrPathRange.h
index 6820ada21b..0ba3996ecf 100644
--- a/src/gpu/GrPathRange.h
+++ b/src/gpu/GrPathRange.h
@@ -23,7 +23,7 @@ class SkDescriptor;
class GrPathRange : public GrGpuResource {
public:
- SK_DECLARE_INST_COUNT(GrPathRange);
+
enum PathIndexType {
kU8_PathIndexType, //!< uint8_t
diff --git a/src/gpu/GrPathRenderer.h b/src/gpu/GrPathRenderer.h
index 8e03edb893..3400eadfe1 100644
--- a/src/gpu/GrPathRenderer.h
+++ b/src/gpu/GrPathRenderer.h
@@ -30,7 +30,7 @@ struct GrPoint;
*/
class SK_API GrPathRenderer : public SkRefCnt {
public:
- SK_DECLARE_INST_COUNT(GrPathRenderer)
+
/**
* This is called to install custom path renderers in every GrContext at create time. The
diff --git a/src/gpu/GrPipeline.h b/src/gpu/GrPipeline.h
index 2de9ba0846..e91baeb35e 100644
--- a/src/gpu/GrPipeline.h
+++ b/src/gpu/GrPipeline.h
@@ -28,7 +28,7 @@ class GrPipelineBuilder;
*/
class GrPipeline {
public:
- SK_DECLARE_INST_COUNT(GrPipeline)
+
GrPipeline(const GrPipelineBuilder&,
const GrProcOptInfo& colorPOI,
diff --git a/src/gpu/GrStencilAttachment.h b/src/gpu/GrStencilAttachment.h
index ba9781d4ce..2aa8e8ce55 100644
--- a/src/gpu/GrStencilAttachment.h
+++ b/src/gpu/GrStencilAttachment.h
@@ -18,7 +18,7 @@ class GrResourceKey;
class GrStencilAttachment : public GrGpuResource {
public:
- SK_DECLARE_INST_COUNT(GrStencilAttachment);
+
virtual ~GrStencilAttachment() {
// TODO: allow SB to be purged and detach itself from rts
diff --git a/src/gpu/gl/GrGLCaps.h b/src/gpu/gl/GrGLCaps.h
index fd03da5e46..1e07a76ed5 100644
--- a/src/gpu/gl/GrGLCaps.h
+++ b/src/gpu/gl/GrGLCaps.h
@@ -26,7 +26,7 @@ class GrGLSLCaps;
*/
class GrGLCaps : public GrCaps {
public:
- SK_DECLARE_INST_COUNT(GrGLCaps)
+
typedef GrGLStencilAttachment::Format StencilFormat;
diff --git a/src/gpu/gl/GrGLCreateNullInterface.cpp b/src/gpu/gl/GrGLCreateNullInterface.cpp
index 41d8f5ddd0..886aacdcb8 100644
--- a/src/gpu/gl/GrGLCreateNullInterface.cpp
+++ b/src/gpu/gl/GrGLCreateNullInterface.cpp
@@ -20,7 +20,7 @@ namespace {
class BufferObj {
public:
- SK_DECLARE_INST_COUNT(BufferObj);
+
BufferObj(GrGLuint id) : fID(id), fDataPtr(NULL), fSize(0), fMapped(false) {
}
@@ -53,7 +53,7 @@ private:
// This class maintains a sparsely populated array of buffer pointers.
class BufferManager {
public:
- SK_DECLARE_INST_COUNT(BufferManager);
+
BufferManager() : fFreeListHead(kFreeListEnd) {}
@@ -122,7 +122,7 @@ private:
*/
struct ThreadContext {
public:
- SK_DECLARE_INST_COUNT(ThreadContext);
+
BufferManager fBufferManager;
GrGLuint fCurrArrayBuffer;
diff --git a/src/gpu/gl/GrGLGpuProgramCache.cpp b/src/gpu/gl/GrGLGpuProgramCache.cpp
index 06efe299c1..919e9bbb9f 100644
--- a/src/gpu/gl/GrGLGpuProgramCache.cpp
+++ b/src/gpu/gl/GrGLGpuProgramCache.cpp
@@ -22,7 +22,7 @@ SK_CONF_DECLARE(bool, c_DisplayCache, "gpu.displayCache", false,
typedef GrGLProgramDataManager::UniformHandle UniformHandle;
struct GrGLGpu::ProgramCache::Entry {
- SK_DECLARE_INST_COUNT(Entry);
+
Entry() : fProgram(NULL), fLRUStamp(0) {}
SkAutoTUnref<GrGLProgram> fProgram;
diff --git a/src/gpu/gl/GrGLProgram.h b/src/gpu/gl/GrGLProgram.h
index 086fb7ac2a..dd86640195 100644
--- a/src/gpu/gl/GrGLProgram.h
+++ b/src/gpu/gl/GrGLProgram.h
@@ -34,7 +34,7 @@ class GrPipeline;
*/
class GrGLProgram : public SkRefCnt {
public:
- SK_DECLARE_INST_COUNT(GrGLProgram)
+
typedef GrGLProgramBuilder::BuiltinUniformHandles BuiltinUniformHandles;
diff --git a/src/gpu/gl/SkNullGLContext.cpp b/src/gpu/gl/SkNullGLContext.cpp
index 1d67578cae..c59fb98ad2 100644
--- a/src/gpu/gl/SkNullGLContext.cpp
+++ b/src/gpu/gl/SkNullGLContext.cpp
@@ -19,7 +19,7 @@ static SkNullGLContext::ContextState* current_context();
class BufferObj {
public:
- SK_DECLARE_INST_COUNT(BufferObj);
+
BufferObj(GrGLuint id) : fID(id), fDataPtr(NULL), fSize(0), fMapped(false) {}
~BufferObj() { SkDELETE_ARRAY(fDataPtr); }
@@ -51,7 +51,7 @@ private:
// This class maintains a sparsely populated array of buffer pointers.
class BufferManager {
public:
- SK_DECLARE_INST_COUNT(BufferManager);
+
BufferManager() : fFreeListHead(kFreeListEnd) {}
@@ -117,7 +117,7 @@ private:
*/
class SkNullGLContext::ContextState : public SkRefCnt {
public:
- SK_DECLARE_INST_COUNT(ContextState);
+
BufferManager fBufferManager;
GrGLuint fCurrArrayBuffer;
diff --git a/src/gpu/gl/debug/GrGLCreateDebugInterface.cpp b/src/gpu/gl/debug/GrGLCreateDebugInterface.cpp
index 5c5e407c32..8b0f8c5d53 100644
--- a/src/gpu/gl/debug/GrGLCreateDebugInterface.cpp
+++ b/src/gpu/gl/debug/GrGLCreateDebugInterface.cpp
@@ -781,7 +781,7 @@ GrGLvoid GR_GL_FUNCTION_TYPE debugGLGetBufferParameteriv(GrGLenum target,
struct GrDebugGLInterface : public GrGLInterface {
public:
- SK_DECLARE_INST_COUNT(GrDebugGLInterface)
+
GrDebugGLInterface()
: fWrapped(NULL) {
diff --git a/src/gpu/glsl/GrGLSLCaps.h b/src/gpu/glsl/GrGLSLCaps.h
index 3264535704..b68b3b4a22 100755
--- a/src/gpu/glsl/GrGLSLCaps.h
+++ b/src/gpu/glsl/GrGLSLCaps.h
@@ -14,7 +14,7 @@
class GrGLSLCaps : public GrShaderCaps {
public:
- SK_DECLARE_INST_COUNT(GrGLSLCaps)
+
/**
* Indicates how GLSL must interact with advanced blend equations. The KHR extension requires
diff --git a/src/image/SkImage_Gpu.h b/src/image/SkImage_Gpu.h
index 30638873e6..df26f82b74 100644
--- a/src/image/SkImage_Gpu.h
+++ b/src/image/SkImage_Gpu.h
@@ -17,7 +17,7 @@
class SkImage_Gpu : public SkImage_Base {
public:
- SK_DECLARE_INST_COUNT(SkImage_Gpu)
+
/**
* An "image" can be a subset/window into a larger texture, so we explicit take the
diff --git a/src/image/SkSurface_Gpu.h b/src/image/SkSurface_Gpu.h
index 4e19a58465..025cb7d8e2 100644
--- a/src/image/SkSurface_Gpu.h
+++ b/src/image/SkSurface_Gpu.h
@@ -16,7 +16,7 @@ class SkGpuDevice;
class SkSurface_Gpu : public SkSurface_Base {
public:
- SK_DECLARE_INST_COUNT(SkSurface_Gpu)
+
SkSurface_Gpu(SkGpuDevice*);
virtual ~SkSurface_Gpu();
diff --git a/src/lazy/SkCachingPixelRef.h b/src/lazy/SkCachingPixelRef.h
index 4889b83693..25fde0a781 100644
--- a/src/lazy/SkCachingPixelRef.h
+++ b/src/lazy/SkCachingPixelRef.h
@@ -26,7 +26,7 @@ class SkColorTable;
*/
class SkCachingPixelRef : public SkPixelRef {
public:
- SK_DECLARE_INST_COUNT(SkCachingPixelRef)
+
/**
* Takes ownership of SkImageGenerator. If this method fails for
* whatever reason, it will return false and immediatetely delete
diff --git a/src/lazy/SkDiscardablePixelRef.h b/src/lazy/SkDiscardablePixelRef.h
index 5d248a2975..6f422e31db 100644
--- a/src/lazy/SkDiscardablePixelRef.h
+++ b/src/lazy/SkDiscardablePixelRef.h
@@ -20,7 +20,7 @@
*/
class SkDiscardablePixelRef : public SkPixelRef {
public:
- SK_DECLARE_INST_COUNT(SkDiscardablePixelRef)
+
protected:
~SkDiscardablePixelRef();
diff --git a/src/pdf/SkPDFFont.h b/src/pdf/SkPDFFont.h
index 6f8a9232c2..d85c5826d3 100644
--- a/src/pdf/SkPDFFont.h
+++ b/src/pdf/SkPDFFont.h
@@ -78,7 +78,7 @@ private:
reference to each instantiated class.
*/
class SkPDFFont : public SkPDFDict {
- SK_DECLARE_INST_COUNT(SkPDFFont)
+
public:
virtual ~SkPDFFont();
diff --git a/src/pdf/SkPDFGraphicState.h b/src/pdf/SkPDFGraphicState.h
index dddf439db3..e989f50c59 100644
--- a/src/pdf/SkPDFGraphicState.h
+++ b/src/pdf/SkPDFGraphicState.h
@@ -24,7 +24,7 @@ class SkPDFFormXObject;
once, we want to canonicalize them.
*/
class SkPDFGraphicState : public SkPDFObject {
- SK_DECLARE_INST_COUNT(SkPDFGraphicState)
+
public:
enum SkPDFSMaskMode {
kAlpha_SMaskMode,
diff --git a/src/pdf/SkPDFShader.h b/src/pdf/SkPDFShader.h
index 8ebe8a279f..1cc36cee19 100644
--- a/src/pdf/SkPDFShader.h
+++ b/src/pdf/SkPDFShader.h
@@ -51,7 +51,7 @@ public:
};
class SkPDFFunctionShader : public SkPDFDict {
- SK_DECLARE_INST_COUNT(SkPDFFunctionShader);
+
public:
static SkPDFFunctionShader* Create(SkPDFCanon*,
diff --git a/src/pdf/SkPDFStream.h b/src/pdf/SkPDFStream.h
index e3a4ebf924..d29d9b19ba 100644
--- a/src/pdf/SkPDFStream.h
+++ b/src/pdf/SkPDFStream.h
@@ -23,7 +23,7 @@ class SkPDFObjNumMap;
SkObjRef).
*/
class SkPDFStream : public SkPDFDict {
- SK_DECLARE_INST_COUNT(SkPDFStream)
+
public:
/** Create a PDF stream. A Length entry is automatically added to the
* stream dictionary.
diff --git a/src/pdf/SkPDFTypes.h b/src/pdf/SkPDFTypes.h
index 35922f81eb..3df2e23766 100644
--- a/src/pdf/SkPDFTypes.h
+++ b/src/pdf/SkPDFTypes.h
@@ -30,7 +30,7 @@ class SkWStream;
*/
class SkPDFObject : public SkRefCnt {
public:
- SK_DECLARE_INST_COUNT(SkPDFObject);
+
/** Subclasses must implement this method to print the object to the
* PDF file.
@@ -188,7 +188,7 @@ private:
*/
class SkPDFArray : public SkPDFObject {
public:
- SK_DECLARE_INST_COUNT(SkPDFArray)
+
static const int kMaxLen = 8191;
@@ -239,7 +239,7 @@ private:
*/
class SkPDFDict : public SkPDFObject {
public:
- SK_DECLARE_INST_COUNT(SkPDFDict)
+
/** Create a PDF dictionary. Maximum number of entries is 4095.
*/
diff --git a/src/ports/SkRemotableFontMgr_win_dw.cpp b/src/ports/SkRemotableFontMgr_win_dw.cpp
index 8c6dd84ba5..d787a95374 100644
--- a/src/ports/SkRemotableFontMgr_win_dw.cpp
+++ b/src/ports/SkRemotableFontMgr_win_dw.cpp
@@ -80,7 +80,7 @@ private:
}
public:
- SK_DECLARE_INST_COUNT(SkRemotableFontMgr_DirectWrite)
+
/** localeNameLength must include the null terminator. */
SkRemotableFontMgr_DirectWrite(IDWriteFontCollection* fontCollection,
diff --git a/tests/GrMemoryPoolTest.cpp b/tests/GrMemoryPoolTest.cpp
index 1ba184b45f..81392ce3d5 100644
--- a/tests/GrMemoryPoolTest.cpp
+++ b/tests/GrMemoryPoolTest.cpp
@@ -9,7 +9,6 @@
// This is a GPU-backend specific test
#if SK_SUPPORT_GPU
#include "GrMemoryPool.h"
-#include "SkInstCnt.h"
#include "SkRandom.h"
#include "SkTDArray.h"
#include "SkTemplates.h"
@@ -44,22 +43,14 @@ public:
}
}
- SK_DECLARE_INST_COUNT(A);
-
static A* Create(SkRandom* r);
static void SetAllocator(size_t preallocSize, size_t minAllocSize) {
-#if SK_ENABLE_INST_COUNT
- SkASSERT(0 == GetInstanceCount());
-#endif
GrMemoryPool* pool = new GrMemoryPool(preallocSize, minAllocSize);
gPool.reset(pool);
}
static void ResetAllocator() {
-#if SK_ENABLE_INST_COUNT
- SkASSERT(0 == GetInstanceCount());
-#endif
gPool.reset(NULL);
}
@@ -232,9 +223,6 @@ DEF_TEST(GrMemoryPool, reporter) {
REPORTER_ASSERT(reporter, rec.fInstance->checkValues(rec.fValue));
delete rec.fInstance;
}
-#if SK_ENABLE_INST_COUNT
- REPORTER_ASSERT(reporter, !A::GetInstanceCount());
-#endif
}
}
}
diff --git a/tests/LListTest.cpp b/tests/LListTest.cpp
index 34bbb4dcba..3d1921514c 100644
--- a/tests/LListTest.cpp
+++ b/tests/LListTest.cpp
@@ -5,7 +5,6 @@
* found in the LICENSE file.
*/
-#include "SkInstCnt.h"
#include "SkRandom.h"
#include "SkTInternalLList.h"
#include "SkTLList.h"
@@ -17,15 +16,10 @@ public:
}
bool operator== (const ListElement& other) { return fID == other.fID; }
-#if SK_ENABLE_INST_COUNT
- // Make the instance count available publicly.
- static int InstanceCount() { return GetInstanceCount(); }
-#endif
-
int fID;
private:
- SK_DECLARE_INST_COUNT(ListElement);
+
SK_DECLARE_INTERNAL_LLIST_INTERFACE(ListElement);
};
@@ -134,10 +128,6 @@ static void TestTLList(skiatest::Reporter* reporter) {
Iter iter3;
Iter iter4;
-#if SK_ENABLE_INST_COUNT
- SkASSERT(0 == ListElement::InstanceCount());
-#endif
-
REPORTER_ASSERT(reporter, list1.isEmpty());
REPORTER_ASSERT(reporter, NULL == iter1.init(list1, Iter::kHead_IterStart));
REPORTER_ASSERT(reporter, NULL == iter1.init(list1, Iter::kTail_IterStart));
@@ -150,9 +140,6 @@ static void TestTLList(skiatest::Reporter* reporter) {
// Create two identical lists, one by appending to head and the other to the tail.
list1.addToHead(ListElement(1));
list2.addToTail(ListElement(1));
-#if SK_ENABLE_INST_COUNT
- SkASSERT(2 == ListElement::InstanceCount());
-#endif
iter1.init(list1, Iter::kHead_IterStart);
iter2.init(list1, Iter::kTail_IterStart);
REPORTER_ASSERT(reporter, iter1.get()->fID == iter2.get()->fID);
@@ -177,10 +164,6 @@ static void TestTLList(skiatest::Reporter* reporter) {
iter4.init(list2, Iter::kTail_IterStart);
list2.addToHead(ListElement(2));
-#if SK_ENABLE_INST_COUNT
- SkASSERT(3 == ListElement::InstanceCount());
-#endif
-
REPORTER_ASSERT(reporter, iter3.get()->fID == iter1.get()->fID);
REPORTER_ASSERT(reporter, iter4.get()->fID == iter1.get()->fID);
REPORTER_ASSERT(reporter, 1 == Iter(list2, Iter::kTail_IterStart).get()->fID);
@@ -188,16 +171,10 @@ static void TestTLList(skiatest::Reporter* reporter) {
REPORTER_ASSERT(reporter, list1 != list2);
list1.addToHead(ListElement(2));
REPORTER_ASSERT(reporter, list1 == list2);
-#if SK_ENABLE_INST_COUNT
- SkASSERT(4 == ListElement::InstanceCount());
-#endif
REPORTER_ASSERT(reporter, !list1.isEmpty());
list1.reset();
list2.reset();
-#if SK_ENABLE_INST_COUNT
- SkASSERT(0 == ListElement::InstanceCount());
-#endif
REPORTER_ASSERT(reporter, list1.isEmpty() && list2.isEmpty());
// randomly perform insertions and deletions on a list and perform tests
@@ -300,14 +277,8 @@ static void TestTLList(skiatest::Reporter* reporter) {
--count;
}
REPORTER_ASSERT(reporter, count == list1.count());
-#if SK_ENABLE_INST_COUNT
- SkASSERT(count == ListElement::InstanceCount());
-#endif
}
list1.reset();
-#if SK_ENABLE_INST_COUNT
- SkASSERT(0 == ListElement::InstanceCount());
-#endif
}
}
diff --git a/tests/RefDictTest.cpp b/tests/RefDictTest.cpp
index 23e4b114a5..469026ebc9 100644
--- a/tests/RefDictTest.cpp
+++ b/tests/RefDictTest.cpp
@@ -10,7 +10,7 @@
class TestRC : public SkRefCnt {
public:
- SK_DECLARE_INST_COUNT(TestRC)
+
private:
typedef SkRefCnt INHERITED;
};
diff --git a/tests/ResourceCacheTest.cpp b/tests/ResourceCacheTest.cpp
index 6f1d40450c..07cd65518e 100644
--- a/tests/ResourceCacheTest.cpp
+++ b/tests/ResourceCacheTest.cpp
@@ -240,7 +240,7 @@ class TestResource : public GrGpuResource {
static const size_t kDefaultSize = 100;
enum ScratchConstructor { kScratchConstructor };
public:
- SK_DECLARE_INST_COUNT(TestResource);
+
/** Property that distinctly categorizes the resource.
* For example, textures have width, height, ... */
enum SimulatedProperty { kA_SimulatedProperty, kB_SimulatedProperty };
diff --git a/tests/UtilsTest.cpp b/tests/UtilsTest.cpp
index 81e6492f3c..6db8104acc 100644
--- a/tests/UtilsTest.cpp
+++ b/tests/UtilsTest.cpp
@@ -14,7 +14,7 @@
class RefClass : public SkRefCnt {
public:
- SK_DECLARE_INST_COUNT(RefClass)
+
RefClass(int n) : fN(n) {}
int get() const { return fN; }
diff --git a/tests/skia_test.cpp b/tests/skia_test.cpp
index 3379e3971d..2c1822d38b 100644
--- a/tests/skia_test.cpp
+++ b/tests/skia_test.cpp
@@ -10,7 +10,6 @@
#include "Resources.h"
#include "SkCommonFlags.h"
#include "SkGraphics.h"
-#include "SkInstCnt.h"
#include "SkOSFile.h"
#include "SkRunnable.h"
#include "SkTArray.h"
@@ -131,12 +130,6 @@ int test_main();
int test_main() {
SetupCrashHandler();
-#if SK_ENABLE_INST_COUNT
- if (FLAGS_leaks) {
- gPrintInstCount = true;
- }
-#endif
-
SkAutoGraphics ag;
{
diff --git a/tools/bench_pictures_main.cpp b/tools/bench_pictures_main.cpp
index f919812d13..b29f4d106e 100644
--- a/tools/bench_pictures_main.cpp
+++ b/tools/bench_pictures_main.cpp
@@ -204,8 +204,8 @@ static bool run_single_benchmark(const SkString& inputPath,
SkString filename = SkOSPath::Basename(inputPath.c_str());
- gWriter.bench(filename.c_str(),
- SkScalarCeilToInt(picture->cullRect().width()),
+ gWriter.bench(filename.c_str(),
+ SkScalarCeilToInt(picture->cullRect().width()),
SkScalarCeilToInt(picture->cullRect().height()));
benchmark.run(picture, FLAGS_mpd);
@@ -444,9 +444,6 @@ int tool_main(int argc, char** argv) {
gWriter.add(&gLogWriter);
-#if SK_ENABLE_INST_COUNT
- gPrintInstCount = true;
-#endif
SkAutoGraphics ag;
sk_tools::PictureBenchmark benchmark;
diff --git a/tools/filtermain.cpp b/tools/filtermain.cpp
index 6883ff2047..c1edb48adf 100644
--- a/tools/filtermain.cpp
+++ b/tools/filtermain.cpp
@@ -638,7 +638,7 @@ static int filter_picture(const SkString& inFile, const SkString& outFile) {
memset(localCount, 0, sizeof(localCount));
- SkDebugCanvas debugCanvas(SkScalarCeilToInt(inPicture->cullRect().width()),
+ SkDebugCanvas debugCanvas(SkScalarCeilToInt(inPicture->cullRect().width()),
SkScalarCeilToInt(inPicture->cullRect().height()));
inPicture->playback(&debugCanvas);
@@ -678,8 +678,8 @@ static int filter_picture(const SkString& inFile, const SkString& outFile) {
if (!outFile.isEmpty()) {
SkPictureRecorder recorder;
- SkCanvas* canvas = recorder.beginRecording(inPicture->cullRect().width(),
- inPicture->cullRect().height(),
+ SkCanvas* canvas = recorder.beginRecording(inPicture->cullRect().width(),
+ inPicture->cullRect().height(),
NULL, 0);
debugCanvas.draw(canvas);
SkAutoTUnref<SkPicture> outPicture(recorder.endRecording());
@@ -712,10 +712,6 @@ static int filter_picture(const SkString& inFile, const SkString& outFile) {
int tool_main(int argc, char** argv); // suppress a warning on mac
int tool_main(int argc, char** argv) {
-#if SK_ENABLE_INST_COUNT
- gPrintInstCount = true;
-#endif
-
SkGraphics::Init();
if (argc < 3) {
diff --git a/tools/flags/SkCommonFlags.cpp b/tools/flags/SkCommonFlags.cpp
index 1a9018bec1..09e74ba790 100644
--- a/tools/flags/SkCommonFlags.cpp
+++ b/tools/flags/SkCommonFlags.cpp
@@ -26,8 +26,6 @@ DEFINE_string(gpuAPI, "", "Force use of specific gpu API. Using \"gl\" "
DEFINE_string(images, "resources", "Directory of images to decode.");
-DEFINE_bool2(leaks, l, false, "show leaked ref cnt'd objects.");
-
DEFINE_string2(match, m, NULL,
"[~][^]substring[$] [...] of GM name to run.\n"
"Multiple matches may be separated by spaces.\n"
diff --git a/tools/flags/SkCommonFlags.h b/tools/flags/SkCommonFlags.h
index 6a5ff58f4f..d6fb2c1d9b 100644
--- a/tools/flags/SkCommonFlags.h
+++ b/tools/flags/SkCommonFlags.h
@@ -16,7 +16,6 @@ DECLARE_bool(dryRun);
DECLARE_bool(gpu);
DECLARE_string(gpuAPI);
DECLARE_string(images);
-DECLARE_bool(leaks);
DECLARE_string(match);
DECLARE_bool(quiet);
DECLARE_bool(resetGpuContext);