| 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 const SkPaint&, | 77 SkGlyphCache*, 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 const SkPaint&, | 83 SkGlyphCache*, 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); |
| 93 void regenerateTextBlob(GrAtlasTextBlob* bmp, const SkPaint& skPaint, GrColo
r, | 94 void regenerateTextBlob(GrAtlasTextBlob* bmp, const SkPaint& skPaint, GrColo
r, |
| 94 const SkMatrix& viewMatrix, | 95 const SkMatrix& viewMatrix, |
| 95 const SkTextBlob* blob, SkScalar x, SkScalar y, | 96 const SkTextBlob* blob, SkScalar x, SkScalar y, |
| 96 SkDrawFilter* drawFilter, | 97 SkDrawFilter* drawFilter, |
| 97 const GrClip&); | 98 const GrClip&); |
| 98 inline static bool HasLCD(const SkTextBlob*); | 99 inline static bool HasLCD(const SkTextBlob*); |
| 99 inline void initDistanceFieldPaint(GrAtlasTextBlob*, SkPaint*, SkScalar* tex
tRatio, | 100 inline void initDistanceFieldPaint(GrAtlasTextBlob*, SkPaint*, SkScalar* tex
tRatio, |
| 100 const SkMatrix&); | 101 const SkMatrix&); |
| 101 | 102 |
| 102 // Test methods | 103 // Test methods |
| (...skipping 14 matching lines...) Expand all Loading... |
| 117 SkAutoTUnref<const GrDistanceFieldAdjustTable> fDistanceAdjustTable; | 118 SkAutoTUnref<const GrDistanceFieldAdjustTable> fDistanceAdjustTable; |
| 118 | 119 |
| 119 #ifdef GR_TEST_UTILS | 120 #ifdef GR_TEST_UTILS |
| 120 DRAW_BATCH_TEST_FRIEND(TextBlobBatch); | 121 DRAW_BATCH_TEST_FRIEND(TextBlobBatch); |
| 121 #endif | 122 #endif |
| 122 | 123 |
| 123 typedef GrTextContext INHERITED; | 124 typedef GrTextContext INHERITED; |
| 124 }; | 125 }; |
| 125 | 126 |
| 126 #endif | 127 #endif |
| OLD | NEW |