diff options
-rw-r--r-- | include/core/SkFlattenable.h | 48 | ||||
-rw-r--r-- | include/core/SkPtrRecorder.h | 45 | ||||
-rw-r--r-- | src/core/SkFlattenable.cpp | 1 | ||||
-rw-r--r-- | src/core/SkGlyphCache.h | 1 | ||||
-rw-r--r-- | src/core/SkOrderedWriteBuffer.cpp | 1 | ||||
-rw-r--r-- | src/core/SkOrderedWriteBuffer.h | 3 | ||||
-rw-r--r-- | src/core/SkPictureFlat.h | 1 |
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" |