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), | 31 : GrTextContext(context, gr
Paint, skPaint) { |
32 fSkPaint(skPaint) { | |
33 fStrike = NULL; | 32 fStrike = NULL; |
34 | 33 |
35 fCurrTexture = NULL; | 34 fCurrTexture = NULL; |
36 fCurrVertex = 0; | 35 fCurrVertex = 0; |
37 | 36 |
38 fVertices = NULL; | 37 fVertices = NULL; |
39 fMaxVertices = 0; | 38 fMaxVertices = 0; |
40 | 39 |
41 fTextRatio = fSkPaint.getTextSize()/kBaseDFFontSize; | 40 fTextRatio = fSkPaint.getTextSize()/kBaseDFFontSize; |
42 | 41 |
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
398 SkScalarToFixed(x) - (glyph.fAdvanceX >> a
lignShift) | 397 SkScalarToFixed(x) - (glyph.fAdvanceX >> a
lignShift) |
399 + SK_FixedHalf, //d1g.fHalfSampleX, | 398 + SK_FixedHalf, //d1g.fHalfSampleX, |
400 SkScalarToFixed(y) - (glyph.fAdvanceY >> a
lignShift) | 399 SkScalarToFixed(y) - (glyph.fAdvanceY >> a
lignShift) |
401 + SK_FixedHalf, //d1g.fHalfSampleY, | 400 + SK_FixedHalf, //d1g.fHalfSampleY, |
402 fontScaler); | 401 fontScaler); |
403 } | 402 } |
404 pos += scalarsPerPosition; | 403 pos += scalarsPerPosition; |
405 } | 404 } |
406 } | 405 } |
407 } | 406 } |
OLD | NEW |