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 GrTextUtils_DEFINED | 8 #ifndef GrTextUtils_DEFINED |
9 #define GrTextUtils_DEFINED | 9 #define GrTextUtils_DEFINED |
10 | 10 |
11 #include "GrColor.h" | 11 #include "GrColor.h" |
12 #include "SkPaint.h" | 12 #include "SkPaint.h" |
13 #include "SkScalar.h" | 13 #include "SkScalar.h" |
14 | 14 |
15 class GrAtlasTextBlob; | 15 class GrAtlasTextBlob; |
16 class GrBatchFontCache; | 16 class GrBatchFontCache; |
17 class GrBatchTextStrike; | 17 class GrBatchTextStrike; |
18 class GrClip; | 18 class GrClip; |
19 class GrContext; | 19 class GrContext; |
20 class GrDrawContext; | 20 class GrDrawContext; |
21 class GrFontScaler; | |
22 class GrShaderCaps; | 21 class GrShaderCaps; |
23 class SkGlyph; | 22 class SkGlyph; |
24 class SkMatrix; | 23 class SkMatrix; |
25 struct SkIRect; | 24 struct SkIRect; |
26 struct SkPoint; | 25 struct SkPoint; |
27 class SkGlyphCache; | 26 class SkGlyphCache; |
28 class SkSurfaceProps; | 27 class SkSurfaceProps; |
29 | 28 |
30 /* | 29 /* |
31 * A class to house a bunch of common text utilities. This class should *ONLY*
have static | 30 * A class to house a bunch of common text utilities. This class should *ONLY*
have static |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 GrDrawContext* dc, | 77 GrDrawContext* dc, |
79 const SkSurfaceProps& props, | 78 const SkSurfaceProps& props, |
80 const GrClip& clip, | 79 const GrClip& clip, |
81 const SkPaint& origPaint, const SkMatrix& view
Matrix, | 80 const SkPaint& origPaint, const SkMatrix& view
Matrix, |
82 const char text[], size_t byteLength, | 81 const char text[], size_t byteLength, |
83 const SkScalar pos[], int scalarsPerPosition, | 82 const SkScalar pos[], int scalarsPerPosition, |
84 const SkPoint& offset, const SkIRect& clipBoun
ds); | 83 const SkPoint& offset, const SkIRect& clipBoun
ds); |
85 | 84 |
86 static bool ShouldDisableLCD(const SkPaint& paint); | 85 static bool ShouldDisableLCD(const SkPaint& paint); |
87 | 86 |
88 static GrFontScaler* GetGrFontScaler(SkGlyphCache* cache); | |
89 static uint32_t FilterTextFlags(const SkSurfaceProps& surfaceProps, const Sk
Paint& paint); | 87 static uint32_t FilterTextFlags(const SkSurfaceProps& surfaceProps, const Sk
Paint& paint); |
90 | 88 |
91 private: | 89 private: |
92 static void InitDistanceFieldPaint(GrAtlasTextBlob* blob, | 90 static void InitDistanceFieldPaint(GrAtlasTextBlob* blob, |
93 SkPaint* skPaint, | 91 SkPaint* skPaint, |
94 SkScalar* textRatio, | 92 SkScalar* textRatio, |
95 const SkMatrix& viewMatrix); | 93 const SkMatrix& viewMatrix); |
96 | 94 |
97 static void BmpAppendGlyph(GrAtlasTextBlob*, int runIndex, GrBatchFontCache*
, | 95 static void BmpAppendGlyph(GrAtlasTextBlob*, int runIndex, GrBatchFontCache*
, |
98 GrBatchTextStrike**, const SkGlyph&, int left, in
t top, | 96 GrBatchTextStrike**, const SkGlyph&, int left, in
t top, |
99 GrColor color, GrFontScaler*); | 97 GrColor color, SkGlyphCache*); |
100 | 98 |
101 static bool DfAppendGlyph(GrAtlasTextBlob*, int runIndex, GrBatchFontCache*, | 99 static bool DfAppendGlyph(GrAtlasTextBlob*, int runIndex, GrBatchFontCache*, |
102 GrBatchTextStrike**, const SkGlyph&, | 100 GrBatchTextStrike**, const SkGlyph&, |
103 SkScalar sx, SkScalar sy, GrColor color, | 101 SkScalar sx, SkScalar sy, GrColor color, |
104 GrFontScaler* scaler, | 102 SkGlyphCache* cache, |
105 SkScalar textRatio, const SkMatrix& viewMatrix); | 103 SkScalar textRatio, const SkMatrix& viewMatrix); |
106 }; | 104 }; |
107 | 105 |
108 #endif | 106 #endif |
OLD | NEW |