aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core
diff options
context:
space:
mode:
authorGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-10-03 13:46:20 +0000
committerGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-10-03 13:46:20 +0000
commit1dfe88e00aeddf20690fd2469fd17e43f670ee3a (patch)
treede3b6e4b3622f1a02b13698a6ed14d00f93bceae /include/core
parent924352685d894e5985eab250a51e507e75e00007 (diff)
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
Diffstat (limited to 'include/core')
-rw-r--r--include/core/SkPath.h13
-rw-r--r--include/core/SkRefCnt.h6
2 files changed, 11 insertions, 8 deletions
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<SkPoint> fPts;
- SkTDArray<uint8_t> fVerbs;
+ SkAutoTUnref<SkPathRef> 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