OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 #include "GrDistanceFieldTextContext.h" | 8 #include "GrDistanceFieldTextContext.h" |
9 #include "GrAtlas.h" | 9 #include "GrAtlas.h" |
10 #include "GrDrawTarget.h" | 10 #include "GrDrawTarget.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 static const int kGlyphCoordsAttributeIndex = 1; | 21 static const int kGlyphCoordsAttributeIndex = 1; |
22 | 22 |
23 static const int kBaseDFFontSize = 32; | 23 static const int kBaseDFFontSize = 32; |
24 | 24 |
25 SK_CONF_DECLARE(bool, c_DumpFontCache, "gpu.dumpFontCache", false, | 25 SK_CONF_DECLARE(bool, c_DumpFontCache, "gpu.dumpFontCache", false, |
26 "Dump the contents of the font cache before every purge."); | 26 "Dump the contents of the font cache before every purge."); |
27 | 27 |
28 GrDistanceFieldTextContext::GrDistanceFieldTextContext(GrContext* context, | 28 GrDistanceFieldTextContext::GrDistanceFieldTextContext(GrContext* context, |
29 const GrPaint& grPaint, | 29 const GrPaint& grPaint, |
30 const SkPaint& skPaint) | 30 const SkPaint& skPaint) |
31 : GrTextContext(context, gr
Paint, skPaint) { | 31 : GrTextContext(context, gr
Paint), |
| 32 fSkPaint(skPaint) { |
32 fStrike = NULL; | 33 fStrike = NULL; |
33 | 34 |
34 fCurrTexture = NULL; | 35 fCurrTexture = NULL; |
35 fCurrVertex = 0; | 36 fCurrVertex = 0; |
36 | 37 |
37 fVertices = NULL; | 38 fVertices = NULL; |
38 fMaxVertices = 0; | 39 fMaxVertices = 0; |
39 | 40 |
40 fTextRatio = fSkPaint.getTextSize()/kBaseDFFontSize; | 41 fTextRatio = fSkPaint.getTextSize()/kBaseDFFontSize; |
41 | 42 |
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
397 SkScalarToFixed(x) - (glyph.fAdvanceX >> a
lignShift) | 398 SkScalarToFixed(x) - (glyph.fAdvanceX >> a
lignShift) |
398 + SK_FixedHalf, //d1g.fHalfSampleX, | 399 + SK_FixedHalf, //d1g.fHalfSampleX, |
399 SkScalarToFixed(y) - (glyph.fAdvanceY >> a
lignShift) | 400 SkScalarToFixed(y) - (glyph.fAdvanceY >> a
lignShift) |
400 + SK_FixedHalf, //d1g.fHalfSampleY, | 401 + SK_FixedHalf, //d1g.fHalfSampleY, |
401 fontScaler); | 402 fontScaler); |
402 } | 403 } |
403 pos += scalarsPerPosition; | 404 pos += scalarsPerPosition; |
404 } | 405 } |
405 } | 406 } |
406 } | 407 } |
OLD | NEW |