Index: include/core/SkPathRef.h |
=================================================================== |
--- include/core/SkPathRef.h (revision 12667) |
+++ include/core/SkPathRef.h (working copy) |
@@ -49,7 +49,8 @@ |
/** |
* Returns the array of points. |
*/ |
- SkPoint* points() { return fPathRef->fPoints; } |
+ SkPoint* points() { return fPathRef->getPoints(); } |
+ const SkPoint* points() const { return fPathRef->points(); } |
/** |
* Gets the ith point. Shortcut for this->points() + i |
@@ -58,6 +59,10 @@ |
SkASSERT((unsigned) i < (unsigned) fPathRef->fPointCnt); |
return this->points() + i; |
}; |
+ const SkPoint* atPoint(int i) const { |
+ SkASSERT((unsigned) i < (unsigned) fPathRef->fPointCnt); |
+ return this->points() + i; |
+ }; |
/** |
* Adds the verb and allocates space for the number of points indicated by the verb. The |
@@ -89,6 +94,7 @@ |
void resetToSize(int newVerbCnt, int newPointCnt, int newConicCount) { |
fPathRef->resetToSize(newVerbCnt, newPointCnt, newConicCount); |
} |
+ |
/** |
* Gets the path ref that is wrapped in the Editor. |
*/ |
@@ -96,6 +102,8 @@ |
void setIsOval(bool isOval) { fPathRef->setIsOval(isOval); } |
+ void setBounds(const SkRect& rect) { fPathRef->setBounds(rect); } |
+ |
private: |
SkPathRef* fPathRef; |
}; |
@@ -158,13 +166,6 @@ |
return fBounds; |
} |
- void setBounds(const SkRect& rect) { |
- SkASSERT(rect.fLeft <= rect.fRight && rect.fTop <= rect.fBottom); |
- fBounds = rect; |
- fBoundsIsDirty = false; |
- fIsFinite = fBounds.isFinite(); |
- } |
- |
/** |
* Transforms a path ref by a matrix, allocating a new one only if necessary. |
*/ |
@@ -299,6 +300,13 @@ |
fBoundsIsDirty = false; |
} |
+ void setBounds(const SkRect& rect) { |
+ SkASSERT(rect.fLeft <= rect.fRight && rect.fTop <= rect.fBottom); |
+ fBounds = rect; |
+ fBoundsIsDirty = false; |
+ fIsFinite = fBounds.isFinite(); |
+ } |
+ |
/** Makes additional room but does not change the counts or change the genID */ |
void incReserve(int additionalVerbs, int additionalPoints) { |
SkDEBUGCODE(this->validate();) |
@@ -418,6 +426,12 @@ |
void setIsOval(bool isOval) { fIsOval = isOval; } |
+ SkPoint* getPoints() { |
+ SkDEBUGCODE(this->validate();) |
+ fIsOval = false; |
+ return fPoints; |
+ } |
+ |
enum { |
kMinSize = 256, |
}; |
@@ -441,6 +455,7 @@ |
mutable uint32_t fGenerationID; |
SkDEBUGCODE(int32_t fEditorsAttached;) // assert that only one editor in use at any time. |
+ friend class PathRefTest_Private; |
typedef SkRefCnt INHERITED; |
}; |