| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #ifndef SkTextToPathIter_DEFINED | 8 #ifndef SkTextToPathIter_DEFINED |
| 9 #define SkTextToPathIter_DEFINED | 9 #define SkTextToPathIter_DEFINED |
| 10 | 10 |
| 11 #include "SkAutoKern.h" | 11 #include "SkAutoKern.h" |
| 12 #include "SkPaint.h" | 12 #include "SkPaint.h" |
| 13 | 13 |
| 14 class SkGlyphCache; | 14 class SkGlyphCache; |
| 15 | 15 |
| 16 class SkTextBaseIter { | 16 class SkTextBaseIter { |
| 17 protected: | 17 protected: |
| 18 SkTextBaseIter(const char text[], size_t length, const SkPaint& paint, | 18 SkTextBaseIter(const char text[], size_t length, const SkPaint& paint, |
| 19 bool applyStrokeAndPathEffects); | 19 bool applyStrokeAndPathEffects); |
| 20 ~SkTextBaseIter(); | 20 ~SkTextBaseIter(); |
| 21 | 21 |
| 22 SkGlyphCache* fCache; | 22 SkGlyphCache* fCache; |
| 23 SkPaint fPaint; | 23 SkPaint fPaint; |
| 24 SkScalar fScale; | 24 SkScalar fScale; |
| 25 SkFixed fPrevAdvance; | 25 SkFixed fPrevAdvance; |
| 26 const char* fText; | 26 const char* fText; |
| 27 const char* fStop; | 27 const char* fStop; |
| 28 SkMeasureCacheProc fGlyphCacheProc; | 28 SkPaint::GlyphCacheProc fGlyphCacheProc; |
| 29 | 29 |
| 30 SkScalar fXPos; // accumulated xpos, returned in next | 30 SkScalar fXPos; // accumulated xpos, returned in next |
| 31 SkAutoKern fAutoKern; | 31 SkAutoKern fAutoKern; |
| 32 int fXYIndex; // cache for horizontal -vs- vertical text | 32 int fXYIndex; // cache for horizontal -vs- vertical text |
| 33 }; | 33 }; |
| 34 | 34 |
| 35 class SkTextToPathIter : SkTextBaseIter { | 35 class SkTextToPathIter : SkTextBaseIter { |
| 36 public: | 36 public: |
| 37 SkTextToPathIter(const char text[], size_t length, const SkPaint& paint, | 37 SkTextToPathIter(const char text[], size_t length, const SkPaint& paint, |
| 38 bool applyStrokeAndPathEffects) | 38 bool applyStrokeAndPathEffects) |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 fPrevAdvance = 0; | 94 fPrevAdvance = 0; |
| 95 } | 95 } |
| 96 | 96 |
| 97 private: | 97 private: |
| 98 SkScalar fBounds[2]; | 98 SkScalar fBounds[2]; |
| 99 SkScalar fBoundsBase[2]; | 99 SkScalar fBoundsBase[2]; |
| 100 TextType fTextType; | 100 TextType fTextType; |
| 101 }; | 101 }; |
| 102 | 102 |
| 103 #endif | 103 #endif |
| OLD | NEW |