Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Unified Diff: include/core/SkPath.h

Issue 49693002: Use SkPathRef gen id for SkPath::getGenerationID (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: upload again, rietveld diff failed. Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | include/core/SkPathRef.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkPath.h
diff --git a/include/core/SkPath.h b/include/core/SkPath.h
index a6674d9afb4e65cc024ee8a155d5f4f4b4869bfe..9b5dc4bf65f11c33358188042cf45f9bdba98052 100644
--- a/include/core/SkPath.h
+++ b/include/core/SkPath.h
@@ -16,14 +16,6 @@
#include "SkTDArray.h"
#include "SkRefCnt.h"
-#ifdef SK_BUILD_FOR_ANDROID
-#define GEN_ID_INC fGenerationID++
-#define GEN_ID_PTR_INC(ptr) (ptr)->fGenerationID++
-#else
-#define GEN_ID_INC
-#define GEN_ID_PTR_INC(ptr)
-#endif
-
class SkReader32;
class SkWriter32;
class SkAutoPathBoundsUpdate;
@@ -40,10 +32,10 @@ public:
SK_DECLARE_INST_COUNT_ROOT(SkPath);
SkPath();
- SkPath(const SkPath&); // Copies fGenerationID on Android.
+ SkPath(const SkPath&);
~SkPath();
- SkPath& operator=(const SkPath&); // Increments fGenerationID on Android.
+ SkPath& operator=(const SkPath&);
friend SK_API bool operator==(const SkPath&, const SkPath&);
friend bool operator!=(const SkPath& a, const SkPath& b) {
return !(a == b);
@@ -80,7 +72,6 @@ public:
*/
void setFillType(FillType ft) {
fFillType = SkToU8(ft);
- GEN_ID_INC;
}
/** Returns true if the filltype is one of the Inverse variants */
@@ -92,7 +83,6 @@ public:
*/
void toggleInverseFillType() {
fFillType ^= 2;
- GEN_ID_INC;
}
enum Convexity {
@@ -914,16 +904,25 @@ public:
* If buffer is NULL, it still returns the number of bytes.
*/
uint32_t writeToMemory(void* buffer) const;
+
/**
* Initialized the region from the buffer, returning the number
* of bytes actually read.
*/
uint32_t readFromMemory(const void* buffer);
-#ifdef SK_BUILD_FOR_ANDROID
+ /** Returns a non-zero, globally unique value corresponding to the set of verbs
+ and points in the path (but not the fill type [except on Android skbug.com/1762]).
+ Each time the path is modified, a different generation ID will be returned.
+ */
uint32_t getGenerationID() const;
+
+#ifdef SK_BUILD_FOR_ANDROID
+ static const int kPathRefGenIDBitCnt = 30; // leave room for the fill type (skbug.com/1762)
const SkPath* getSourcePath() const;
void setSourcePath(const SkPath* path);
+#else
+ static const int kPathRefGenIDBitCnt = 32;
#endif
SkDEBUGCODE(void validate() const;)
@@ -953,7 +952,6 @@ private:
mutable uint8_t fDirection;
mutable SkBool8 fIsOval;
#ifdef SK_BUILD_FOR_ANDROID
- uint32_t fGenerationID;
const SkPath* fSourcePath;
#endif
« no previous file with comments | « no previous file | include/core/SkPathRef.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698