diff options
author | djsollen@google.com <djsollen@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-04-15 13:41:26 +0000 |
---|---|---|
committer | djsollen@google.com <djsollen@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-04-15 13:41:26 +0000 |
commit | f5dbe2f00f853c6a1719924bdd0c33335a53423a (patch) | |
tree | 4244625eb50b4615a8f9016ee17ae2afb09e57f3 /include/core | |
parent | 61eb040e2f18d367c66c0bfc08d2707dc75f7cf2 (diff) |
Upstream android changes.
reviewed by: reed
git-svn-id: http://skia.googlecode.com/svn/trunk@1134 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/core')
-rw-r--r-- | include/core/SkPaint.h | 14 | ||||
-rw-r--r-- | include/core/SkPath.h | 30 |
2 files changed, 38 insertions, 6 deletions
diff --git a/include/core/SkPaint.h b/include/core/SkPaint.h index a931ccd96c..f4b325fea5 100644 --- a/include/core/SkPaint.h +++ b/include/core/SkPaint.h @@ -89,9 +89,7 @@ public: return static_cast<Hinting>(fHinting); } - void setHinting(Hinting hintingLevel) { - fHinting = hintingLevel; - } + void setHinting(Hinting hintingLevel); /** Specifies the bit values that are stored in the paint's flags. */ @@ -817,6 +815,13 @@ public: void getTextPath(const void* text, size_t length, SkScalar x, SkScalar y, SkPath* path) const; +#ifdef ANDROID + const SkGlyph& getUnicharMetrics(SkUnichar); + const void* findImage(const SkGlyph&); + + uint32_t getGenerationID() const; +#endif + private: SkTypeface* fTypeface; SkScalar fTextSize; @@ -841,6 +846,9 @@ private: unsigned fStyle : 2; unsigned fTextEncoding : 2; // 3 values unsigned fHinting : 2; +#ifdef ANDROID + uint32_t fGenerationID; +#endif SkDrawCacheProc getDrawCacheProc() const; SkMeasureCacheProc getMeasureCacheProc(TextBufferDirection dir, diff --git a/include/core/SkPath.h b/include/core/SkPath.h index 34f30b10c4..d9a7093a81 100644 --- a/include/core/SkPath.h +++ b/include/core/SkPath.h @@ -20,6 +20,14 @@ #include "SkMatrix.h" #include "SkTDArray.h" +#ifdef 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 SkFlattenableReadBuffer; class SkFlattenableWriteBuffer; class SkAutoPathBoundsUpdate; @@ -72,7 +80,10 @@ public: @param ft The new fill type for this path */ - void setFillType(FillType ft) { fFillType = SkToU8(ft); } + void setFillType(FillType ft) { + fFillType = SkToU8(ft); + GEN_ID_INC; + } /** Returns true if the filltype is one of the Inverse variants */ bool isInverseFillType() const { return (fFillType & 2) != 0; } @@ -80,7 +91,10 @@ public: /** Toggle between inverse and normal filltypes. This reverse the return value of isInverseFillType() */ - void toggleInverseFillType() { fFillType ^= 2; } + void toggleInverseFillType() { + fFillType ^= 2; + GEN_ID_INC; + } /** Returns true if the path is flagged as being convex. This is not a confirmed by any analysis, it is just the value set earlier. @@ -92,7 +106,10 @@ public: not convex can give undefined results when drawn. Paths default to isConvex == false */ - void setIsConvex(bool isConvex) { fIsConvex = (isConvex != 0); } + void setIsConvex(bool isConvex) { + fIsConvex = (isConvex != 0); + GEN_ID_INC; + } /** Clear any lines and curves from the path, making it empty. This frees up internal storage associated with those segments. @@ -571,6 +588,10 @@ public: */ void subdivide(SkScalar dist, bool bendLines, SkPath* dst = NULL) const; +#ifdef ANDROID + uint32_t getGenerationID() const; +#endif + SkDEBUGCODE(void validate() const;) private: @@ -580,6 +601,9 @@ private: mutable uint8_t fBoundsIsDirty; uint8_t fFillType; uint8_t fIsConvex; +#ifdef ANDROID + uint32_t fGenerationID; +#endif // called, if dirty, by getBounds() void computeBounds() const; |