aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-12-03 00:23:39 +0000
committerGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-12-03 00:23:39 +0000
commitca316f576eaa925157575985eac425206308aaf4 (patch)
treedeaf2fe1ff64e04686d0be0d7a6fbfa0e8e21a21 /include
parent4178ec0582987d7b191c609a937d389abc2e74bc (diff)
Revert of r12450 (Move fIsOval from SkPath to SkPathRef)
git-svn-id: http://skia.googlecode.com/svn/trunk@12452 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include')
-rw-r--r--include/core/SkPath.h5
-rw-r--r--include/core/SkPathRef.h29
-rw-r--r--include/core/SkPicture.h3
3 files changed, 5 insertions, 32 deletions
diff --git a/include/core/SkPath.h b/include/core/SkPath.h
index 5c4860eb8e..ac4dd3bf56 100644
--- a/include/core/SkPath.h
+++ b/include/core/SkPath.h
@@ -151,7 +151,7 @@ public:
* optimization for performance and so some paths that are in
* fact ovals can report false.
*/
- bool isOval(SkRect* rect) const { return fPathRef->isOval(rect); }
+ bool isOval(SkRect* rect) const;
/** Clear any lines and curves from the path, making it empty. This frees up
internal storage associated with those segments.
@@ -938,8 +938,8 @@ private:
#ifndef DELETE_THIS_CODE_WHEN_SKPS_ARE_REBUILT_AT_V14_AND_ALL_OTHER_INSTANCES_TOO
// rename to kUnused_SerializationShift
kOldIsFinite_SerializationShift = 25, // 1 bit
- kOldIsOval_SerializationShift = 24, // requires 1 bit
#endif
+ kIsOval_SerializationShift = 24, // requires 1 bit
kConvexity_SerializationShift = 16, // requires 8 bits
kFillType_SerializationShift = 8, // requires 8 bits
kSegmentMask_SerializationShift = 0 // requires 4 bits
@@ -952,6 +952,7 @@ private:
uint8_t fSegmentMask;
mutable uint8_t fConvexity;
mutable uint8_t fDirection;
+ mutable SkBool8 fIsOval;
#ifdef SK_BUILD_FOR_ANDROID
const SkPath* fSourcePath;
#endif
diff --git a/include/core/SkPathRef.h b/include/core/SkPathRef.h
index 1b3251e0a8..aea0a91275 100644
--- a/include/core/SkPathRef.h
+++ b/include/core/SkPathRef.h
@@ -23,7 +23,7 @@ class SkWBuffer;
* Holds the path verbs and points. It is versioned by a generation ID. None of its public methods
* modify the contents. To modify or append to the verbs/points wrap the SkPathRef in an
* SkPathRef::Editor object. Installing the editor resets the generation ID. It also performs
- * copy-on-write if the SkPathRef is shared by multiple SkPaths. The caller passes the Editor's
+ * copy-on-write if the SkPathRef is shared by multipls SkPaths. The caller passes the Editor's
* constructor a SkAutoTUnref, which may be updated to point to a new SkPathRef after the editor's
* constructor returns.
*
@@ -100,8 +100,6 @@ public:
*/
SkPathRef* pathRef() { return fPathRef; }
- void setIsOval(bool isOval) { fPathRef->setIsOval(isOval); }
-
private:
SkPathRef* fPathRef;
};
@@ -123,24 +121,6 @@ public:
return SkToBool(fIsFinite);
}
- /** Returns true if the path is an oval.
- *
- * @param rect returns the bounding rect of this oval. It's a circle
- * if the height and width are the same.
- *
- * @return true if this path is an oval.
- * Tracking whether a path is an oval is considered an
- * optimization for performance and so some paths that are in
- * fact ovals can report false.
- */
- bool isOval(SkRect* rect) const {
- if (fIsOval && NULL != rect) {
- *rect = getBounds();
- }
-
- return SkToBool(fIsOval);
- }
-
bool hasComputedBounds() const {
return !fBoundsIsDirty;
}
@@ -257,7 +237,6 @@ public:
private:
enum SerializationOffsets {
kIsFinite_SerializationShift = 25, // requires 1 bit
- kIsOval_SerializationShift = 24, // requires 1 bit
};
SkPathRef() {
@@ -268,7 +247,6 @@ private:
fPoints = NULL;
fFreeSpace = 0;
fGenerationID = kEmptyGenID;
- fIsOval = false;
SkDEBUGCODE(fEditorsAttached = 0;)
SkDEBUGCODE(this->validate();)
}
@@ -311,8 +289,6 @@ private:
fBoundsIsDirty = true; // this also invalidates fIsFinite
fGenerationID = 0;
- fIsOval = false;
-
size_t newSize = sizeof(uint8_t) * verbCount + sizeof(SkPoint) * pointCount;
size_t newReserve = sizeof(uint8_t) * reserveVerbs + sizeof(SkPoint) * reservePoints;
size_t minSize = newSize + newReserve;
@@ -418,8 +394,6 @@ private:
*/
static void CreateEmptyImpl(SkPathRef** empty);
- void setIsOval(bool isOval) { fIsOval = isOval; }
-
enum {
kMinSize = 256,
};
@@ -427,7 +401,6 @@ private:
mutable SkRect fBounds;
mutable uint8_t fBoundsIsDirty;
mutable SkBool8 fIsFinite; // only meaningful if bounds are valid
- mutable SkBool8 fIsOval;
SkPoint* fPoints; // points to begining of the allocation
uint8_t* fVerbs; // points just past the end of the allocation (verbs grow backwards)
diff --git a/include/core/SkPicture.h b/include/core/SkPicture.h
index 42d9d93ff2..42566eddbd 100644
--- a/include/core/SkPicture.h
+++ b/include/core/SkPicture.h
@@ -219,14 +219,13 @@ protected:
// parameterize blurs by sigma rather than radius
// V14: Add flags word to PathRef serialization
// V15: Remove A1 bitmpa config (and renumber remaining configs)
- // V16: Move SkPath's isOval flag to SkPathRef
#ifndef DELETE_THIS_CODE_WHEN_SKPS_ARE_REBUILT_AT_V13_AND_ALL_OTHER_INSTANCES_TOO
static const uint32_t PRIOR_PRIOR_PICTURE_VERSION = 12; // TODO: remove when .skps regenerated
#endif
#ifndef DELETE_THIS_CODE_WHEN_SKPS_ARE_REBUILT_AT_V14_AND_ALL_OTHER_INSTANCES_TOO
static const uint32_t PRIOR_PICTURE_VERSION2 = 13; // TODO: remove when .skps regenerated
#endif
- static const uint32_t PICTURE_VERSION = 16;
+ static const uint32_t PICTURE_VERSION = 15;
// fPlayback, fRecord, fWidth & fHeight are protected to allow derived classes to
// install their own SkPicturePlayback-derived players,SkPictureRecord-derived