OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 GrAtlasTextContext_DEFINED | 8 #ifndef GrAtlasTextContext_DEFINED |
9 #define GrAtlasTextContext_DEFINED | 9 #define GrAtlasTextContext_DEFINED |
10 | 10 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 const SkPoint& offset, const SkIRect& regionClipBounds) o
verride; | 50 const SkPoint& offset, const SkIRect& regionClipBounds) o
verride; |
51 void drawTextBlob(GrDrawContext*, GrRenderTarget*, const GrClip&, const SkPa
int&, | 51 void drawTextBlob(GrDrawContext*, GrRenderTarget*, const GrClip&, const SkPa
int&, |
52 const SkMatrix& viewMatrix, const SkTextBlob*, SkScalar x,
SkScalar y, | 52 const SkMatrix& viewMatrix, const SkTextBlob*, SkScalar x,
SkScalar y, |
53 SkDrawFilter*, const SkIRect& clipBounds) override; | 53 SkDrawFilter*, const SkIRect& clipBounds) override; |
54 | 54 |
55 typedef GrAtlasTextBlob::Run Run; | 55 typedef GrAtlasTextBlob::Run Run; |
56 typedef Run::SubRunInfo PerSubRunInfo; | 56 typedef Run::SubRunInfo PerSubRunInfo; |
57 | 57 |
58 inline bool canDrawAsDistanceFields(const SkPaint&, const SkMatrix& viewMatr
ix); | 58 inline bool canDrawAsDistanceFields(const SkPaint&, const SkMatrix& viewMatr
ix); |
59 GrAtlasTextBlob* setupDFBlob(int glyphCount, const SkPaint& origPaint, | 59 GrAtlasTextBlob* setupDFBlob(int glyphCount, const SkPaint& origPaint, |
60 const SkMatrix& viewMatrix, SkGlyphCache** cache
, | 60 const SkMatrix& viewMatrix, SkPaint* dfPaint, |
61 SkPaint* dfPaint, SkScalar* textRatio); | 61 SkScalar* textRatio); |
62 void bmpAppendGlyph(GrAtlasTextBlob*, int runIndex, const SkGlyph&, int left
, int top, | 62 void bmpAppendGlyph(GrAtlasTextBlob*, int runIndex, const SkGlyph&, int left
, int top, |
63 GrColor color, GrFontScaler*, const SkIRect& clipRect); | 63 GrColor color, GrFontScaler*, const SkIRect& clipRect); |
64 bool dfAppendGlyph(GrAtlasTextBlob*, int runIndex, const SkGlyph&, SkScalar
sx, SkScalar sy, | 64 bool dfAppendGlyph(GrAtlasTextBlob*, int runIndex, const SkGlyph&, SkScalar
sx, SkScalar sy, |
65 GrColor color, GrFontScaler*, const SkIRect& clipRect, Sk
Scalar textRatio, | 65 GrColor color, GrFontScaler*, const SkIRect& clipRect, Sk
Scalar textRatio, |
66 const SkMatrix& viewMatrix); | 66 const SkMatrix& viewMatrix); |
67 inline void appendGlyphPath(GrAtlasTextBlob*, GrGlyph*, GrFontScaler*, const
SkGlyph&, | 67 inline void appendGlyphPath(GrAtlasTextBlob*, GrGlyph*, GrFontScaler*, const
SkGlyph&, |
68 SkScalar x, SkScalar y, SkScalar scale = 1.0f, | 68 SkScalar x, SkScalar y, SkScalar scale = 1.0f, |
69 bool applyVM = false); | 69 bool applyVM = false); |
70 inline void appendGlyphCommon(GrAtlasTextBlob*, Run*, Run::SubRunInfo*, | 70 inline void appendGlyphCommon(GrAtlasTextBlob*, Run*, Run::SubRunInfo*, |
71 const SkRect& positions, GrColor color, | 71 const SkRect& positions, GrColor color, |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 void internalDrawBMPText(GrAtlasTextBlob*, int runIndex, SkGlyphCache*, cons
t SkPaint&, | 108 void internalDrawBMPText(GrAtlasTextBlob*, int runIndex, SkGlyphCache*, cons
t SkPaint&, |
109 GrColor color, const SkMatrix& viewMatrix, | 109 GrColor color, const SkMatrix& viewMatrix, |
110 const char text[], size_t byteLength, | 110 const char text[], size_t byteLength, |
111 SkScalar x, SkScalar y, const SkIRect& clipRect); | 111 SkScalar x, SkScalar y, const SkIRect& clipRect); |
112 void internalDrawBMPPosText(GrAtlasTextBlob*, int runIndex, SkGlyphCache*, c
onst SkPaint&, | 112 void internalDrawBMPPosText(GrAtlasTextBlob*, int runIndex, SkGlyphCache*, c
onst SkPaint&, |
113 GrColor color, const SkMatrix& viewMatrix, | 113 GrColor color, const SkMatrix& viewMatrix, |
114 const char text[], size_t byteLength, | 114 const char text[], size_t byteLength, |
115 const SkScalar pos[], int scalarsPerPosition, | 115 const SkScalar pos[], int scalarsPerPosition, |
116 const SkPoint& offset, const SkIRect& clipRect); | 116 const SkPoint& offset, const SkIRect& clipRect); |
117 | 117 |
118 void internalDrawDFText(GrAtlasTextBlob*, int runIndex, SkGlyphCache*, const
SkPaint&, | 118 void internalDrawDFText(GrAtlasTextBlob*, int runIndex, const SkPaint&, |
119 GrColor color, const SkMatrix& viewMatrix, | 119 GrColor color, const SkMatrix& viewMatrix, |
120 const char text[], size_t byteLength, | 120 const char text[], size_t byteLength, |
121 SkScalar x, SkScalar y, const SkIRect& clipRect, | 121 SkScalar x, SkScalar y, const SkIRect& clipRect, |
122 SkScalar textRatio, | 122 SkScalar textRatio, |
123 SkTDArray<char>* fallbackTxt, | 123 SkTDArray<char>* fallbackTxt, |
124 SkTDArray<SkScalar>* fallbackPos, | 124 SkTDArray<SkScalar>* fallbackPos, |
125 SkPoint* offset, const SkPaint& origPaint); | 125 SkPoint* offset, const SkPaint& origPaint); |
126 void internalDrawDFPosText(GrAtlasTextBlob*, int runIndex, SkGlyphCache*, co
nst SkPaint&, | 126 void internalDrawDFPosText(GrAtlasTextBlob*, int runIndex, const SkPaint&, |
127 GrColor color, const SkMatrix& viewMatrix, | 127 GrColor color, const SkMatrix& viewMatrix, |
128 const char text[], size_t byteLength, | 128 const char text[], size_t byteLength, |
129 const SkScalar pos[], int scalarsPerPosition, | 129 const SkScalar pos[], int scalarsPerPosition, |
130 const SkPoint& offset, const SkIRect& clipRect, | 130 const SkPoint& offset, const SkIRect& clipRect, |
131 SkScalar textRatio, | 131 SkScalar textRatio, |
132 SkTDArray<char>* fallbackTxt, | 132 SkTDArray<char>* fallbackTxt, |
133 SkTDArray<SkScalar>* fallbackPos); | 133 SkTDArray<SkScalar>* fallbackPos); |
134 | 134 |
135 // sets up the descriptor on the blob and returns a detached cache. Client
must attach | 135 // sets up the descriptor on the blob and returns a detached cache. Client
must attach |
136 inline static GrColor ComputeCanonicalColor(const SkPaint&, bool lcd); | 136 inline static GrColor ComputeCanonicalColor(const SkPaint&, bool lcd); |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 friend class TextBatch; | 187 friend class TextBatch; |
188 | 188 |
189 #ifdef GR_TEST_UTILS | 189 #ifdef GR_TEST_UTILS |
190 DRAW_BATCH_TEST_FRIEND(TextBlobBatch); | 190 DRAW_BATCH_TEST_FRIEND(TextBlobBatch); |
191 #endif | 191 #endif |
192 | 192 |
193 typedef GrTextContext INHERITED; | 193 typedef GrTextContext INHERITED; |
194 }; | 194 }; |
195 | 195 |
196 #endif | 196 #endif |
OLD | NEW |