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 27 matching lines...) Expand all Loading... |
38 const SkMatrix& viewMatrix, | 38 const SkMatrix& viewMatrix, |
39 const char text[], size_t byteLength, | 39 const char text[], size_t byteLength, |
40 SkScalar x, SkScalar y, const SkIRect& regionClipBounds) ove
rride; | 40 SkScalar x, SkScalar y, const SkIRect& regionClipBounds) ove
rride; |
41 void onDrawPosText(GrDrawContext*, GrRenderTarget*, | 41 void onDrawPosText(GrDrawContext*, GrRenderTarget*, |
42 const GrClip&, const GrPaint&, const SkPaint&, | 42 const GrClip&, const GrPaint&, const SkPaint&, |
43 const SkMatrix& viewMatrix, | 43 const SkMatrix& viewMatrix, |
44 const char text[], size_t byteLength, | 44 const char text[], size_t byteLength, |
45 const SkScalar pos[], int scalarsPerPosition, | 45 const SkScalar pos[], int scalarsPerPosition, |
46 const SkPoint& offset, const SkIRect& regionClipBounds) o
verride; | 46 const SkPoint& offset, const SkIRect& regionClipBounds) o
verride; |
47 | 47 |
| 48 class FallbackBlobBuilder; |
| 49 |
48 class TextRun { | 50 class TextRun { |
49 public: | 51 public: |
50 TextRun(const SkPaint& fontAndStroke); | 52 TextRun(const SkPaint& fontAndStroke); |
51 ~TextRun(); | 53 ~TextRun(); |
52 | 54 |
53 void setText(const char text[], size_t byteLength, SkScalar x, SkScalar
y, | 55 void setText(const char text[], size_t byteLength, SkScalar x, SkScalar
y, |
54 GrContext*, const SkSurfaceProps*); | 56 GrContext*, const SkSurfaceProps*); |
55 | 57 |
56 void setPosText(const char text[], size_t byteLength, | 58 void setPosText(const char text[], size_t byteLength, |
57 const SkScalar pos[], int scalarsPerPosition, const SkPo
int& offset, | 59 const SkScalar pos[], int scalarsPerPosition, const SkPo
int& offset, |
58 GrContext*, const SkSurfaceProps*); | 60 GrContext*, const SkSurfaceProps*); |
59 | 61 |
60 void draw(GrDrawContext*, GrRenderTarget*, const GrClip&, const GrPaint&
, const SkMatrix&, | 62 void draw(GrDrawContext*, GrRenderTarget*, const GrClip&, const GrPaint&
, const SkMatrix&, |
61 const SkIRect& regionClipBounds, GrTextContext* fallbackTextCo
ntext, | 63 const SkIRect& regionClipBounds, GrTextContext* fallbackTextCo
ntext, |
62 const SkPaint& originalSkPaint) const; | 64 const SkPaint& originalSkPaint) const; |
63 | 65 |
64 private: | 66 private: |
65 GrPathRange* createGlyphs(GrContext*, SkGlyphCache*); | 67 GrPathRange* createGlyphs(GrContext*, SkGlyphCache*); |
66 | 68 |
67 void appendGlyph(const SkGlyph&, const SkPoint&); | 69 void appendGlyph(const SkGlyph&, const SkPoint&, FallbackBlobBuilder*); |
68 | 70 |
69 GrStrokeInfo fStroke; | 71 GrStrokeInfo fStroke; |
70 SkPaint fFont; | 72 SkPaint fFont; |
71 SkScalar fTextRatio; | 73 SkScalar fTextRatio; |
72 float fTextInverseRatio; | 74 float fTextInverseRatio; |
73 SkMatrix fLocalMatrix; | 75 SkMatrix fLocalMatrix; |
74 bool fUsingRawGlyphPaths; | 76 bool fUsingRawGlyphPaths; |
75 SkAutoTUnref<GrPathRangeDraw> fDraw; | 77 SkAutoTUnref<GrPathRangeDraw> fDraw; |
76 SkSTArray<32, uint16_t, true> fFallbackIndices; | 78 SkAutoTUnref<const SkTextBlob> fFallbackTextBlob; |
77 SkSTArray<32, SkPoint, true> fFallbackPositions; | |
78 }; | 79 }; |
79 | 80 |
80 typedef GrTextContext INHERITED; | 81 typedef GrTextContext INHERITED; |
81 }; | 82 }; |
82 | 83 |
83 #endif | 84 #endif |
OLD | NEW |