From 1dfe88e00aeddf20690fd2469fd17e43f670ee3a Mon Sep 17 00:00:00 2001 From: "bsalomon@google.com" Date: Wed, 3 Oct 2012 13:46:20 +0000 Subject: Revert r5557 (which itself was a revert of r5433). Relands SkPathRef. Will follow with change for extra debug checks to attempt to ferret out http://www.crbug.com/148637. git-svn-id: http://skia.googlecode.com/svn/trunk@5783 2bbb7eff-a529-9590-31e7-b0007b416f81 --- include/core/SkPath.h | 13 +++++-------- include/core/SkRefCnt.h | 6 ++++++ 2 files changed, 11 insertions(+), 8 deletions(-) (limited to 'include/core') diff --git a/include/core/SkPath.h b/include/core/SkPath.h index cf9f19a93c..bf284f1b90 100644 --- a/include/core/SkPath.h +++ b/include/core/SkPath.h @@ -13,6 +13,7 @@ #include "SkInstCnt.h" #include "SkMatrix.h" #include "SkTDArray.h" +#include "SkRefCnt.h" #ifdef SK_BUILD_FOR_ANDROID #define GEN_ID_INC fGenerationID++ @@ -26,6 +27,7 @@ class SkReader32; class SkWriter32; class SkAutoPathBoundsUpdate; class SkString; +class SkPathRef; /** \class SkPath @@ -255,9 +257,7 @@ public: /** Return the number of points in the path */ - int countPoints() const { - return this->getPoints(NULL, 0); - } + int countPoints() const; /** Return the point at the specified index. If the index is out of range (i.e. is not 0 <= index < countPoints()) then the returned coordinates @@ -275,9 +275,7 @@ public: /** Return the number of verbs in the path */ - int countVerbs() const { - return this->getVerbs(NULL, 0); - } + int countVerbs() const; /** Returns the number of verbs in the path. Up to max verbs are copied. The verbs are copied as one byte per verb. @@ -832,8 +830,7 @@ private: kSegmentMask_SerializationShift = 0 }; - SkTDArray fPts; - SkTDArray fVerbs; + SkAutoTUnref fPathRef; mutable SkRect fBounds; int fLastMoveToIndex; uint8_t fFillType; diff --git a/include/core/SkRefCnt.h b/include/core/SkRefCnt.h index f527ebe0af..3a0f8be383 100644 --- a/include/core/SkRefCnt.h +++ b/include/core/SkRefCnt.h @@ -159,6 +159,12 @@ public: fObj = obj; } + void swap(SkAutoTUnref* other) { + T* tmp = fObj; + fObj = other->fObj; + other->fObj = tmp; + } + /** * Return the hosted object (which may be null), transferring ownership. * The reference count is not modified, and the internal ptr is set to NULL -- cgit v1.2.3