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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 // A helper for drawing BitmapText in a run of distance fields | 67 // A helper for drawing BitmapText in a run of distance fields |
68 inline void fallbackDrawPosText(GrAtlasTextBlob*, int runIndex, | 68 inline void fallbackDrawPosText(GrAtlasTextBlob*, int runIndex, |
69 GrColor color, | 69 GrColor color, |
70 const SkPaint&, const SkMatrix& viewMatrix, | 70 const SkPaint&, const SkMatrix& viewMatrix, |
71 const SkTDArray<char>& fallbackTxt, | 71 const SkTDArray<char>& fallbackTxt, |
72 const SkTDArray<SkScalar>& fallbackPos, | 72 const SkTDArray<SkScalar>& fallbackPos, |
73 int scalarsPerPosition, | 73 int scalarsPerPosition, |
74 const SkPoint& offset); | 74 const SkPoint& offset); |
75 | 75 |
76 void internalDrawDFText(GrAtlasTextBlob*, int runIndex, | 76 void internalDrawDFText(GrAtlasTextBlob*, int runIndex, |
77 SkGlyphCache*, const SkPaint&, | 77 const SkPaint&, |
78 GrColor color, const SkMatrix& viewMatrix, | 78 GrColor color, const SkMatrix& viewMatrix, |
79 const char text[], size_t byteLength, | 79 const char text[], size_t byteLength, |
80 SkScalar x, SkScalar y, | 80 SkScalar x, SkScalar y, |
81 SkScalar textRatio, const SkPaint& origPaint); | 81 SkScalar textRatio, const SkPaint& origPaint); |
82 void internalDrawDFPosText(GrAtlasTextBlob*, int runIndex, | 82 void internalDrawDFPosText(GrAtlasTextBlob*, int runIndex, |
83 SkGlyphCache*, const SkPaint&, | 83 const SkPaint&, |
84 GrColor color, const SkMatrix& viewMatrix, | 84 GrColor color, const SkMatrix& viewMatrix, |
85 const char text[], size_t byteLength, | 85 const char text[], size_t byteLength, |
86 const SkScalar pos[], int scalarsPerPosition, | 86 const SkScalar pos[], int scalarsPerPosition, |
87 const SkPoint& offset, | 87 const SkPoint& offset, |
88 SkScalar textRatio, | 88 SkScalar textRatio, |
89 const SkPaint& origPaint); | 89 const SkPaint& origPaint); |
90 | 90 |
91 // sets up the descriptor on the blob and returns a detached cache. Client
must attach | 91 // sets up the descriptor on the blob and returns a detached cache. Client
must attach |
92 inline static GrColor ComputeCanonicalColor(const SkPaint&, bool lcd); | 92 inline static GrColor ComputeCanonicalColor(const SkPaint&, bool lcd); |
93 inline SkGlyphCache* setupCache(Run*, const SkPaint&, const SkMatrix* viewMa
trix, bool noGamma); | |
94 void regenerateTextBlob(GrAtlasTextBlob* bmp, const SkPaint& skPaint, GrColo
r, | 93 void regenerateTextBlob(GrAtlasTextBlob* bmp, const SkPaint& skPaint, GrColo
r, |
95 const SkMatrix& viewMatrix, | 94 const SkMatrix& viewMatrix, |
96 const SkTextBlob* blob, SkScalar x, SkScalar y, | 95 const SkTextBlob* blob, SkScalar x, SkScalar y, |
97 SkDrawFilter* drawFilter, | 96 SkDrawFilter* drawFilter, |
98 const GrClip&); | 97 const GrClip&); |
99 inline static bool HasLCD(const SkTextBlob*); | 98 inline static bool HasLCD(const SkTextBlob*); |
100 inline void initDistanceFieldPaint(GrAtlasTextBlob*, SkPaint*, SkScalar* tex
tRatio, | 99 inline void initDistanceFieldPaint(GrAtlasTextBlob*, SkPaint*, SkScalar* tex
tRatio, |
101 const SkMatrix&); | 100 const SkMatrix&); |
102 | 101 |
103 // Test methods | 102 // Test methods |
(...skipping 14 matching lines...) Expand all Loading... |
118 SkAutoTUnref<const GrDistanceFieldAdjustTable> fDistanceAdjustTable; | 117 SkAutoTUnref<const GrDistanceFieldAdjustTable> fDistanceAdjustTable; |
119 | 118 |
120 #ifdef GR_TEST_UTILS | 119 #ifdef GR_TEST_UTILS |
121 DRAW_BATCH_TEST_FRIEND(TextBlobBatch); | 120 DRAW_BATCH_TEST_FRIEND(TextBlobBatch); |
122 #endif | 121 #endif |
123 | 122 |
124 typedef GrTextContext INHERITED; | 123 typedef GrTextContext INHERITED; |
125 }; | 124 }; |
126 | 125 |
127 #endif | 126 #endif |
OLD | NEW |