OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 GrStencilAndCoverTextContext_DEFINED | 8 #ifndef GrStencilAndCoverTextContext_DEFINED |
9 #define GrStencilAndCoverTextContext_DEFINED | 9 #define GrStencilAndCoverTextContext_DEFINED |
10 | 10 |
(...skipping 18 matching lines...) Expand all Loading... |
29 size_t byteLength, | 29 size_t byteLength, |
30 SkScalar x, SkScalar y) SK_OVERRIDE; | 30 SkScalar x, SkScalar y) SK_OVERRIDE; |
31 virtual void drawPosText(const GrPaint&, const SkPaint&, | 31 virtual void drawPosText(const GrPaint&, const SkPaint&, |
32 const char text[], size_t byteLength, | 32 const char text[], size_t byteLength, |
33 const SkScalar pos[], SkScalar constY, | 33 const SkScalar pos[], SkScalar constY, |
34 int scalarsPerPosition) SK_OVERRIDE; | 34 int scalarsPerPosition) SK_OVERRIDE; |
35 | 35 |
36 virtual bool canDraw(const SkPaint& paint) SK_OVERRIDE; | 36 virtual bool canDraw(const SkPaint& paint) SK_OVERRIDE; |
37 | 37 |
38 private: | 38 private: |
| 39 class GlyphPathRange; |
| 40 static const int kGlyphBufferSize = 1024; |
| 41 |
39 void init(const GrPaint&, const SkPaint&, size_t textByteLength); | 42 void init(const GrPaint&, const SkPaint&, size_t textByteLength); |
40 void appendGlyph(GrGlyph::PackedID, const SkPoint&, | 43 void initGlyphs(SkGlyphCache* cache); |
41 GrTextStrike*, GrFontScaler*); | 44 void appendGlyph(uint16_t glyphID, float x, float y); |
| 45 void flush(); |
42 void finish(); | 46 void finish(); |
43 | 47 |
44 GrDrawState::AutoRestoreEffects fStateRestore; | 48 GrDrawState::AutoRestoreEffects fStateRestore; |
45 SkScalar fTextRatio; | 49 SkScalar fTextRatio; |
46 SkStrokeRec fStroke; | 50 SkStrokeRec fStroke; |
47 SkTDArray<const GrPath*> fPaths; | 51 SkGlyphCache* fGlyphCache; |
48 SkTDArray<SkMatrix> fTransforms; | 52 GlyphPathRange* fGlyphs; |
49 SkPath fTmpPath; | 53 uint32_t fIndexBuffer[kGlyphBufferSize]; |
| 54 float fTransformBuffer[6 * kGlyphBufferSize]; |
| 55 int fPendingGlyphCount; |
50 SkMatrix fGlyphTransform; | 56 SkMatrix fGlyphTransform; |
51 bool fNeedsDeviceSpaceGlyphs; | 57 bool fNeedsDeviceSpaceGlyphs; |
52 }; | 58 }; |
53 | 59 |
54 #endif | 60 #endif |
OLD | NEW |