aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar mike@reedtribe.org <mike@reedtribe.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-08-12 19:25:08 +0000
committerGravatar mike@reedtribe.org <mike@reedtribe.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-08-12 19:25:08 +0000
commit227b516f233df5870d79d3f8dcbdaa02336b7356 (patch)
tree38379fbb6d93ca3d97fa5a64c83b6e6a93751d42
parent43523f8fdac9103231f6251d72d3c460ae0e7f87 (diff)
refactor some subclasses in SkFlattenable.h into SkPtrRecorder.h, in preparation for
privatizing SkPtrRecorder.h git-svn-id: http://skia.googlecode.com/svn/trunk@5046 2bbb7eff-a529-9590-31e7-b0007b416f81
-rw-r--r--include/core/SkFlattenable.h48
-rw-r--r--include/core/SkPtrRecorder.h45
-rw-r--r--src/core/SkFlattenable.cpp1
-rw-r--r--src/core/SkGlyphCache.h1
-rw-r--r--src/core/SkOrderedWriteBuffer.cpp1
-rw-r--r--src/core/SkOrderedWriteBuffer.h3
-rw-r--r--src/core/SkPictureFlat.h1
7 files changed, 52 insertions, 48 deletions
diff --git a/include/core/SkFlattenable.h b/include/core/SkFlattenable.h
index 56bc96648f..9b38032f48 100644
--- a/include/core/SkFlattenable.h
+++ b/include/core/SkFlattenable.h
@@ -103,52 +103,4 @@ private:
typedef SkRefCnt INHERITED;
};
-///////////////////////////////////////////////////////////////////////////////
-
-#include "SkPtrRecorder.h"
-
-/**
- * Subclass of SkTPtrSet specialed to call ref() and unref() when the
- * base class's incPtr() and decPtr() are called. This makes it a valid owner
- * of each ptr, which is released when the set is reset or destroyed.
- */
-class SkRefCntSet : public SkTPtrSet<SkRefCnt*> {
-public:
- virtual ~SkRefCntSet();
-
-protected:
- // overrides
- virtual void incPtr(void*);
- virtual void decPtr(void*);
-};
-
-class SkFactorySet : public SkTPtrSet<SkFlattenable::Factory> {};
-
-/**
- * Similar to SkFactorySet, but only allows Factorys that have registered names.
- * Also has a function to return the next added Factory's name.
- */
-class SkNamedFactorySet : public SkRefCnt {
-public:
- SkNamedFactorySet();
-
- /**
- * Find the specified Factory in the set. If it is not already in the set,
- * and has registered its name, add it to the set, and return its index.
- * If the Factory has no registered name, return 0.
- */
- uint32_t find(SkFlattenable::Factory);
-
- /**
- * If new Factorys have been added to the set, return the name of the first
- * Factory added after the Factory name returned by the last call to this
- * function.
- */
- const char* getNextAddedFactoryName();
-private:
- int fNextAddedFactory;
- SkFactorySet fFactorySet;
- SkTDArray<const char*> fNames;
-};
-
#endif
diff --git a/include/core/SkPtrRecorder.h b/include/core/SkPtrRecorder.h
index 360471fc0c..8a48325298 100644
--- a/include/core/SkPtrRecorder.h
+++ b/include/core/SkPtrRecorder.h
@@ -11,6 +11,7 @@
#define SkPtrSet_DEFINED
#include "SkRefCnt.h"
+#include "SkFlattenable.h"
#include "SkTDArray.h"
/**
@@ -99,4 +100,48 @@ private:
typedef SkPtrSet INHERITED;
};
+/**
+ * Subclass of SkTPtrSet specialed to call ref() and unref() when the
+ * base class's incPtr() and decPtr() are called. This makes it a valid owner
+ * of each ptr, which is released when the set is reset or destroyed.
+ */
+class SkRefCntSet : public SkTPtrSet<SkRefCnt*> {
+public:
+ virtual ~SkRefCntSet();
+
+protected:
+ // overrides
+ virtual void incPtr(void*);
+ virtual void decPtr(void*);
+};
+
+class SkFactorySet : public SkTPtrSet<SkFlattenable::Factory> {};
+
+/**
+ * Similar to SkFactorySet, but only allows Factorys that have registered names.
+ * Also has a function to return the next added Factory's name.
+ */
+class SkNamedFactorySet : public SkRefCnt {
+public:
+ SkNamedFactorySet();
+
+ /**
+ * Find the specified Factory in the set. If it is not already in the set,
+ * and has registered its name, add it to the set, and return its index.
+ * If the Factory has no registered name, return 0.
+ */
+ uint32_t find(SkFlattenable::Factory);
+
+ /**
+ * If new Factorys have been added to the set, return the name of the first
+ * Factory added after the Factory name returned by the last call to this
+ * function.
+ */
+ const char* getNextAddedFactoryName();
+private:
+ int fNextAddedFactory;
+ SkFactorySet fFactorySet;
+ SkTDArray<const char*> fNames;
+};
+
#endif
diff --git a/src/core/SkFlattenable.cpp b/src/core/SkFlattenable.cpp
index 0523c68dba..52377c7d66 100644
--- a/src/core/SkFlattenable.cpp
+++ b/src/core/SkFlattenable.cpp
@@ -6,6 +6,7 @@
* found in the LICENSE file.
*/
#include "SkFlattenable.h"
+#include "SkPtrRecorder.h"
SK_DEFINE_INST_COUNT(SkFlattenable)
diff --git a/src/core/SkGlyphCache.h b/src/core/SkGlyphCache.h
index 5992a6d96d..472bcde522 100644
--- a/src/core/SkGlyphCache.h
+++ b/src/core/SkGlyphCache.h
@@ -16,6 +16,7 @@
#include "SkGlyph.h"
#include "SkScalerContext.h"
#include "SkTemplates.h"
+#include "SkTDArray.h"
class SkPaint;
diff --git a/src/core/SkOrderedWriteBuffer.cpp b/src/core/SkOrderedWriteBuffer.cpp
index f7d6dbbe1d..e278c06386 100644
--- a/src/core/SkOrderedWriteBuffer.cpp
+++ b/src/core/SkOrderedWriteBuffer.cpp
@@ -7,6 +7,7 @@
*/
#include "SkOrderedWriteBuffer.h"
+#include "SkPtrRecorder.h"
#include "SkTypeface.h"
SkOrderedWriteBuffer::SkOrderedWriteBuffer(size_t minSize)
diff --git a/src/core/SkOrderedWriteBuffer.h b/src/core/SkOrderedWriteBuffer.h
index 7be2a90bc3..18d8665b6c 100644
--- a/src/core/SkOrderedWriteBuffer.h
+++ b/src/core/SkOrderedWriteBuffer.h
@@ -18,6 +18,9 @@
#include "SkWriter32.h"
class SkFlattenable;
+class SkFactorySet;
+class SkNamedFactorySet;
+class SkRefCntSet;
class SkOrderedWriteBuffer : public SkFlattenableWriteBuffer {
public:
diff --git a/src/core/SkPictureFlat.h b/src/core/SkPictureFlat.h
index 0f846fd509..436c82cebb 100644
--- a/src/core/SkPictureFlat.h
+++ b/src/core/SkPictureFlat.h
@@ -16,6 +16,7 @@
#include "SkOrderedReadBuffer.h"
#include "SkOrderedWriteBuffer.h"
#include "SkPicture.h"
+#include "SkPtrRecorder.h"
#include "SkMatrix.h"
#include "SkPaint.h"
#include "SkPath.h"