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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 inline bool canDrawAsDistanceFields(const SkPaint&, const SkMatrix& viewMatr
ix); | 57 inline bool canDrawAsDistanceFields(const SkPaint&, const SkMatrix& viewMatr
ix); |
58 GrAtlasTextBlob* setupDFBlob(int glyphCount, const SkPaint& origPaint, | 58 GrAtlasTextBlob* setupDFBlob(int glyphCount, const SkPaint& origPaint, |
59 const SkMatrix& viewMatrix, SkPaint* dfPaint, | 59 const SkMatrix& viewMatrix, SkPaint* dfPaint, |
60 SkScalar* textRatio); | 60 SkScalar* textRatio); |
61 void bmpAppendGlyph(GrAtlasTextBlob*, int runIndex, const SkGlyph&, int left
, int top, | 61 void bmpAppendGlyph(GrAtlasTextBlob*, int runIndex, const SkGlyph&, int left
, int top, |
62 GrColor color, GrFontScaler*); | 62 GrColor color, GrFontScaler*); |
63 bool dfAppendGlyph(GrAtlasTextBlob*, int runIndex, const SkGlyph&, SkScalar
sx, SkScalar sy, | 63 bool dfAppendGlyph(GrAtlasTextBlob*, int runIndex, const SkGlyph&, SkScalar
sx, SkScalar sy, |
64 GrColor color, GrFontScaler*, SkScalar textRatio, | 64 GrColor color, GrFontScaler*, SkScalar textRatio, |
65 const SkMatrix& viewMatrix); | 65 const SkMatrix& viewMatrix); |
66 | 66 |
67 inline void flushRunAsPaths(GrDrawContext*, | |
68 const SkTextBlobRunIterator&, const GrClip& clip
, | |
69 const SkPaint&, SkDrawFilter*, | |
70 const SkMatrix& viewMatrix, const SkIRect& clipB
ounds, SkScalar x, | |
71 SkScalar y); | |
72 inline GrDrawBatch* createBatch(GrAtlasTextBlob*, const PerSubRunInfo&, | |
73 int glyphCount, int run, int subRun, | |
74 GrColor, SkScalar transX, SkScalar transY, | |
75 const SkPaint&); | |
76 inline void flushRun(GrDrawContext*, GrPipelineBuilder*, GrAtlasTextBlob*, i
nt run, GrColor, | |
77 SkScalar transX, SkScalar transY, const SkPaint&); | |
78 inline void flushBigGlyphs(GrAtlasTextBlob* cacheBlob, GrDrawContext*, | |
79 const GrClip& clip, const SkPaint& skPaint, | |
80 SkScalar transX, SkScalar transY, const SkIRect&
clipBounds); | |
81 | |
82 // We have to flush SkTextBlobs differently from drawText / drawPosText | |
83 void flush(const SkTextBlob*, GrAtlasTextBlob*, GrDrawContext*, | |
84 const SkPaint&, const GrPaint&, SkDrawFilter*, const GrClip&, | |
85 const SkMatrix& viewMatrix, const SkIRect& clipBounds, SkScalar x
, SkScalar y, | |
86 SkScalar transX, SkScalar transY); | |
87 void flush(GrAtlasTextBlob*, GrDrawContext*, const SkPaint&, | |
88 const GrPaint&, const GrClip&, const SkIRect& clipBounds); | |
89 | |
90 // A helper for drawing BitmapText in a run of distance fields | 67 // A helper for drawing BitmapText in a run of distance fields |
91 inline void fallbackDrawPosText(GrAtlasTextBlob*, int runIndex, | 68 inline void fallbackDrawPosText(GrAtlasTextBlob*, int runIndex, |
92 const GrClip&, GrColor color, | 69 const GrClip&, GrColor color, |
93 const SkPaint&, const SkMatrix& viewMatrix, | 70 const SkPaint&, const SkMatrix& viewMatrix, |
94 const SkTDArray<char>& fallbackTxt, | 71 const SkTDArray<char>& fallbackTxt, |
95 const SkTDArray<SkScalar>& fallbackPos, | 72 const SkTDArray<SkScalar>& fallbackPos, |
96 int scalarsPerPosition, | 73 int scalarsPerPosition, |
97 const SkPoint& offset); | 74 const SkPoint& offset); |
98 | 75 |
99 void internalDrawBMPText(GrAtlasTextBlob*, int runIndex, SkGlyphCache*, cons
t SkPaint&, | 76 void internalDrawBMPText(GrAtlasTextBlob*, int runIndex, SkGlyphCache*, cons
t SkPaint&, |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 const SkPaint&, const SkMatrix& v
iewMatrix, | 118 const SkPaint&, const SkMatrix& v
iewMatrix, |
142 const char text[], size_t byteLen
gth, | 119 const char text[], size_t byteLen
gth, |
143 SkScalar x, SkScalar y, | 120 SkScalar x, SkScalar y, |
144 const SkIRect& regionClipBounds); | 121 const SkIRect& regionClipBounds); |
145 inline GrAtlasTextBlob* createDrawPosTextBlob(const GrClip&, const GrPaint&, | 122 inline GrAtlasTextBlob* createDrawPosTextBlob(const GrClip&, const GrPaint&, |
146 const SkPaint&, const SkMatrix
& viewMatrix, | 123 const SkPaint&, const SkMatrix
& viewMatrix, |
147 const char text[], size_t byte
Length, | 124 const char text[], size_t byte
Length, |
148 const SkScalar pos[], int scal
arsPerPosition, | 125 const SkScalar pos[], int scal
arsPerPosition, |
149 const SkPoint& offset, | 126 const SkPoint& offset, |
150 const SkIRect& regionClipBound
s); | 127 const SkIRect& regionClipBound
s); |
| 128 const GrDistanceFieldAdjustTable* dfAdjustTable() const { return fDistanceAd
justTable; } |
151 | 129 |
152 GrBatchTextStrike* fCurrStrike; | 130 GrBatchTextStrike* fCurrStrike; |
153 GrTextBlobCache* fCache; | 131 GrTextBlobCache* fCache; |
154 SkAutoTUnref<const GrDistanceFieldAdjustTable> fDistanceAdjustTable; | 132 SkAutoTUnref<const GrDistanceFieldAdjustTable> fDistanceAdjustTable; |
155 | 133 |
156 #ifdef GR_TEST_UTILS | 134 #ifdef GR_TEST_UTILS |
157 DRAW_BATCH_TEST_FRIEND(TextBlobBatch); | 135 DRAW_BATCH_TEST_FRIEND(TextBlobBatch); |
158 #endif | 136 #endif |
159 | 137 |
160 typedef GrTextContext INHERITED; | 138 typedef GrTextContext INHERITED; |
161 }; | 139 }; |
162 | 140 |
163 #endif | 141 #endif |
OLD | NEW |