class PlacedRefCnt : public SkRefCnt {
public:
+ SK_DECLARE_INST_COUNT(PlacedRefCnt)
+
PlacedRefCnt() : SkRefCnt() { }
void operator delete(void *p) { }
+
+private:
+ typedef SkRefCnt INHERITED;
};
+SK_DEFINE_INST_COUNT(PlacedRefCnt)
+
class RefCntBench_Heap : public SkBenchmark {
public:
RefCntBench_Heap(void* param) : INHERITED(param) {
#include "SkPaint.h"
#include "SkParse.h"
+SK_DEFINE_INST_COUNT(SkBenchmark)
+
template BenchRegistry* BenchRegistry::gHead;
SkBenchmark::SkBenchmark(void* defineDict) {
class SkBenchmark : public SkRefCnt {
public:
+ SK_DECLARE_INST_COUNT(SkBenchmark)
+
SkBenchmark(void* defineDict);
const char* getName();
SkTriState::State fDither;
bool fHasStrokeWidth;
SkScalar strokeWidth;
+
+ typedef SkRefCnt INHERITED;
};
typedef SkTRegistry<SkBenchmark*, void*> BenchRegistry;
class SkAdvancedTypefaceMetrics : public SkRefCnt {
public:
+ SK_DECLARE_INST_COUNT(SkAdvancedTypefaceMetrics)
+
SkString fFontName;
enum FontType {
// The mapping from glyph to Unicode, only populated if
// kToUnicode_PerGlyphInfo is passed to GetAdvancedTypefaceMetrics.
SkTDArray<SkUnichar> fGlyphToUnicode;
+
+private:
+ typedef SkRefCnt INHERITED;
};
namespace skia_advanced_typeface_metrics_utils {
class Allocator : public SkRefCnt {
public:
+ SK_DECLARE_INST_COUNT(Allocator)
+
/** Allocate the pixel memory for the bitmap, given its dimensions and
config. Return true on success, where success means either setPixels
or setPixelRef was called. The pixels need not be locked when this
colortable should be left unchanged.
*/
virtual bool allocPixelRef(SkBitmap*, SkColorTable*) = 0;
+ private:
+ typedef SkRefCnt INHERITED;
};
/** Subclass of Allocator that returns a pixelref that allocates its pixel
friend class SkDrawIter;
friend struct Draw1Glyph;
friend class SkMaskFilter;
+
+ typedef SkRefCnt INHERITED;
};
#endif
*/
class SK_API SkCanvas : public SkRefCnt {
public:
+ SK_DECLARE_INST_COUNT(SkCanvas)
+
SkCanvas();
/** Construct a canvas with the specified device to draw into.
#else
void validateClip() const {}
#endif
+
+ typedef SkRefCnt INHERITED;
};
/** Stack helper class to automatically call restoreToCount() on the canvas
*/
class SkData : public SkRefCnt {
public:
+ SK_DECLARE_INST_COUNT(SkData)
+
/**
* Returns the number of bytes stored.
*/
SkData(const void* ptr, size_t size, ReleaseProc, void* context);
~SkData();
+
+ typedef SkRefCnt INHERITED;
};
/**
class SK_API SkDevice : public SkRefCnt {
public:
+ SK_DECLARE_INST_COUNT(SkDevice)
+
/**
* 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,
SkBitmap fBitmap;
SkIPoint fOrigin;
SkMetaData* fMetaData;
+
+ typedef SkRefCnt INHERITED;
};
#endif
class SkDeviceProfile : public SkRefCnt {
public:
+ SK_DECLARE_INST_COUNT(SkDeviceProfile)
+
enum LCDConfig {
kNone_LCDConfig, // disables LCD text rendering, uses A8 instead
kRGB_Horizontal_LCDConfig,
float fContrastScale;
LCDConfig fLCDConfig;
FontHintLevel fFontHintLevel;
+
+ typedef SkRefCnt INHERITED;
};
#endif
* The implementation may modify the paint as they wish.
*/
virtual void filter(SkPaint*, Type) = 0;
+
+private:
+ typedef SkRefCnt INHERITED;
};
#endif
*/
class SK_API SkFlattenable : public SkRefCnt {
public:
+ SK_DECLARE_INST_COUNT(SkFlattenable)
+
typedef SkFlattenable* (*Factory)(SkFlattenableReadBuffer&);
SkFlattenable() {}
friend class SkGraphics;
friend class SkFlattenableWriteBuffer;
+
+ typedef SkRefCnt INHERITED;
};
// helpers for matrix and region
#define SK_DECLARE_INST_COUNT_INTERNAL(className, initStep) \
class SkInstanceCountHelper { \
public: \
- typedef void (*PFCheckInstCnt)(); \
+ typedef void (*PFCheckInstCnt)(int level); \
SkInstanceCountHelper() { \
if (!gInited) { \
initStep \
return SkInstanceCountHelper::gInstanceCount; \
} \
\
- static void CheckInstanceCount() { \
+ static void CheckInstanceCount(int level = 0) { \
if (0 != SkInstanceCountHelper::gInstanceCount) { \
- SkDebugf("Leaked %s objects: %d\n", #className, \
+ SkDebugf("%*c Leaked %s objects: %d\n", \
+ 4*level, ' ', #className, \
SkInstanceCountHelper::gInstanceCount); \
} \
- for (int i = 0; i < SkInstanceCountHelper::gChildren.count(); ++i) { \
- (*SkInstanceCountHelper::gChildren[i])(); \
+ for (int i = 0; i < SkInstanceCountHelper::gChildren.count(); ++i) {\
+ (*SkInstanceCountHelper::gChildren[i])(level+1); \
} \
} \
\
*/
class SK_API SkPicture : public SkRefCnt {
public:
+ SK_DECLARE_INST_COUNT(SkPicture)
+
/** The constructor prepares the picture to record.
@param width the width of the virtual device the picture records.
@param height the height of the virtual device the picture records.
friend class SkFlatPicture;
friend class SkPicturePlayback;
+
+ typedef SkRefCnt INHERITED;
};
class SkAutoPictureRecord : SkNoncopyable {
*/
class SkPtrSet : public SkRefCnt {
public:
+ SK_DECLARE_INST_COUNT(SkPtrSet)
+
/**
* Search for the specified ptr in the set. If it is found, return its
* 32bit ID [1..N], or if not found, return 0. Always returns 0 for NULL.
class SK_API SkStream : public SkRefCnt {
public:
+ SK_DECLARE_INST_COUNT(SkStream)
+
virtual ~SkStream();
/** Called to rewind to the beginning of the stream. If this cannot be
done, return false.
bool readBool() { return this->readU8() != 0; }
SkScalar readScalar();
size_t readPackedUInt();
+
+private:
+ typedef SkRefCnt INHERITED;
};
class SK_API SkWStream : SkNoncopyable {
/* Invariant: fWeakCnt = #weak + (fRefCnt > 0 ? 1 : 0) */
mutable int32_t fWeakCnt;
+
+ typedef SkRefCnt INHERITED;
};
#endif
class GrCustomStage : public GrRefCnt {
public:
+ SK_DECLARE_INST_COUNT(GrCustomStage)
+
typedef GrProgramStageFactory::StageKey StageKey;
GrCustomStage();
FNPTR_TYPE fPtr;
};
+ typedef GrRefCnt INHERITED;
+
public:
+ SK_DECLARE_INST_COUNT(GrGLInterface)
+
GrGLInterface();
// Validates that the GrGLInterface supports a binding. This means that
class SkGLContext : public SkRefCnt {
public:
+ SK_DECLARE_INST_COUNT(SkGLContext)
+
SkGLContext();
virtual ~SkGLContext();
GrGLuint fColorBufferID;
GrGLuint fDepthStencilBufferID;
const GrGLInterface* fGL;
+
+ typedef SkRefCnt INHERITED;
};
/**
*/
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.
*/
virtual bool peek(const char tag[], const void* data, size_t length) = 0;
+ private:
+ typedef SkRefCnt INHERITED;
};
Peeker* getPeeker() const { return fPeeker; }
*/
class Chooser : public SkRefCnt {
public:
+ SK_DECLARE_INST_COUNT(Chooser)
+
virtual void begin(int count) {}
virtual void inspect(int index, SkBitmap::Config config, int width, int height) {}
/** Return the index of the subimage you want, or -1 to choose none of them.
*/
virtual int choose() = 0;
+
+ private:
+ typedef SkRefCnt INHERITED;
};
Chooser* getChooser() const { return fChooser; }
*/
class SkImageDecoderFactory : public SkRefCnt {
public:
+ SK_DECLARE_INST_COUNT(SkImageDecoderFactory)
+
virtual SkImageDecoder* newDecoder(SkStream*) = 0;
+
+private:
+ typedef SkRefCnt INHERITED;
};
class SkDefaultImageDecoderFactory : SkImageDecoderFactory {
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.
*/
bool fNeedBitmap;
void ensureInfo();
+
+ typedef SkRefCnt INHERITED;
};
#endif
class SkTextStyle : public SkRefCnt {
public:
+ SK_DECLARE_INST_COUNT(SkTextStyle)
+
SkTextStyle();
SkTextStyle(const SkTextStyle&);
explicit SkTextStyle(const SkPaint&);
private:
SkPaint fPaint;
+
+ typedef SkRefCnt INHERITED;
};
class SkTextLayout {
#include "SkAdvancedTypefaceMetrics.h"
#include "SkTypes.h"
+SK_DEFINE_INST_COUNT(SkAdvancedTypefaceMetrics)
+
#if defined(SK_BUILD_FOR_UNIX) || defined(SK_BUILD_FOR_ANDROID)
#include <ft2build.h>
#include FT_FREETYPE_H
#include "SkPackBits.h"
#include <new>
+SK_DEFINE_INST_COUNT(SkBitmap::Allocator)
+
extern int32_t SkNextPixelRefGenerationID();
static bool isPos32Bits(const Sk64& value) {
#include "SkTLazy.h"
#include "SkUtils.h"
+SK_DEFINE_INST_COUNT(SkCanvas)
+
//#define SK_TRACE_SAVERESTORE
#ifdef SK_TRACE_SAVERESTORE
#include "SkData.h"
+SK_DEFINE_INST_COUNT(SkData)
+
SkData::SkData(const void* ptr, size_t size, ReleaseProc proc, void* context) {
fPtr = ptr;
fSize = size;
#include "SkMetaData.h"
#include "SkRect.h"
+SK_DEFINE_INST_COUNT(SkDevice)
+
///////////////////////////////////////////////////////////////////////////////
SkDevice::SkDevice(const SkBitmap& bitmap) : fBitmap(bitmap) {
+/*
+ * 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 "SkDeviceProfile.h"
+SK_DEFINE_INST_COUNT(SkDeviceProfile)
+
#define DEFAULT_GAMMAEXP 2.2f
#define DEFAULT_CONTRASTSCALE 0.5f
#define DEFAULT_LCDCONFIG SkDeviceProfile::kNone_LCDConfig
#include "SkFlattenable.h"
#include "SkTypeface.h"
+SK_DEFINE_INST_COUNT(SkFlattenable)
+
///////////////////////////////////////////////////////////////////////////////
void SkFlattenable::flatten(SkFlattenableWriteBuffer&) const
#include "SkReader32.h"
#include "SkWriter32.h"
+SK_DEFINE_INST_COUNT(SkPicture)
+
#define DUMP_BUFFER_SIZE 65536
//#define ENABLE_TIME_DRAW // dumps milliseconds for each draw
#include "SkPtrRecorder.h"
#include "SkTSearch.h"
+SK_DEFINE_INST_COUNT(SkPtrSet)
+
void SkPtrSet::reset() {
Pair* p = fList.begin();
Pair* stop = fList.end();
#include "SkString.h"
#include "SkOSFile.h"
+SK_DEFINE_INST_COUNT(SkStream)
+
SkStream::~SkStream() {}
const char* SkStream::getFileName()
#include "GrContext.h"
#include "GrCustomStage.h"
+SK_DEFINE_INST_COUNT(GrCustomStage)
+
int32_t GrProgramStageFactory::fCurrStageClassID =
GrProgramStageFactory::kIllegalStageClassID;
#include <stdio.h>
+SK_DEFINE_INST_COUNT(GrGLInterface)
+
#if GR_GL_PER_GL_FUNC_CALLBACK
namespace {
void GrGLDefaultInterfaceCallback(const GrGLInterface*) {}
#include "gl/SkGLContext.h"
#include "gl/GrGLUtil.h"
+SK_DEFINE_INST_COUNT(SkGLContext)
+
SkGLContext::SkGLContext()
: fFBO(0)
, fColorBufferID(0)
#include "SkStream.h"
#include "SkTemplates.h"
+SK_DEFINE_INST_COUNT(SkImageDecoder::Peeker)
+SK_DEFINE_INST_COUNT(SkImageDecoder::Chooser)
+SK_DEFINE_INST_COUNT(SkImageDecoderFactory)
+
static SkBitmap::Config gDeviceConfig = SkBitmap::kNo_Config;
SkBitmap::Config SkImageDecoder::GetDeviceConfig()
#include "SkCanvas.h"
#include "SkPaint.h"
+SK_DEFINE_INST_COUNT(SkMovie)
+
// We should never see this in normal operation since our time values are
// 0-based. So we use it as a sentinal.
#define UNINITIALIZED_MSEC ((SkMSec)-1)
*/
#include "SkTextLayout.h"
+SK_DEFINE_INST_COUNT(SkTextStyle)
+
SkTextStyle::SkTextStyle() {
fPaint.setAntiAlias(true);
}