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 "GrBitmapTextContext.h" | 10 #include "GrBitmapTextContext.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 #include "SkPath.h" | 27 #include "SkPath.h" |
28 #include "SkRTConf.h" | 28 #include "SkRTConf.h" |
29 #include "SkStrokeRec.h" | 29 #include "SkStrokeRec.h" |
30 #include "effects/GrDistanceFieldTextureEffect.h" | 30 #include "effects/GrDistanceFieldTextureEffect.h" |
31 | 31 |
32 SK_CONF_DECLARE(bool, c_DumpFontCache, "gpu.dumpFontCache", false, | 32 SK_CONF_DECLARE(bool, c_DumpFontCache, "gpu.dumpFontCache", false, |
33 "Dump the contents of the font cache before every purge."); | 33 "Dump the contents of the font cache before every purge."); |
34 | 34 |
35 static const int kSmallDFFontSize = 32; | 35 static const int kSmallDFFontSize = 32; |
36 static const int kSmallDFFontLimit = 32; | 36 static const int kSmallDFFontLimit = 32; |
37 static const int kMediumDFFontSize = 70; | 37 static const int kMediumDFFontSize = 72; |
38 static const int kMediumDFFontLimit = 70; | 38 static const int kMediumDFFontLimit = 72; |
39 static const int kLargeDFFontSize = 156; | 39 static const int kLargeDFFontSize = 162; |
40 SK_COMPILE_ASSERT(GR_SDF_MAX_SIZE >= kLargeDFFontSize, sdf_too_big); | |
41 | 40 |
42 static const int kVerticesPerGlyph = 4; | 41 static const int kVerticesPerGlyph = 4; |
43 static const int kIndicesPerGlyph = 6; | 42 static const int kIndicesPerGlyph = 6; |
44 | 43 |
45 GrDistanceFieldTextContext::GrDistanceFieldTextContext(GrContext* context, | 44 GrDistanceFieldTextContext::GrDistanceFieldTextContext(GrContext* context, |
46 const SkDeviceProperties&
properties, | 45 const SkDeviceProperties&
properties, |
47 bool enable) | 46 bool enable) |
48 : GrTextContext(context, pro
perties) { | 47 : GrTextContext(context, pro
perties) { |
49 #if SK_FORCE_DISTANCE_FIELD_TEXT | 48 #if SK_FORCE_DISTANCE_FIELD_TEXT |
50 fEnableDFRendering = true; | 49 fEnableDFRendering = true; |
(...skipping 668 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
719 } | 718 } |
720 } | 719 } |
721 | 720 |
722 inline void GrDistanceFieldTextContext::finish() { | 721 inline void GrDistanceFieldTextContext::finish() { |
723 this->flush(); | 722 this->flush(); |
724 fTotalVertexCount = 0; | 723 fTotalVertexCount = 0; |
725 | 724 |
726 GrTextContext::finish(); | 725 GrTextContext::finish(); |
727 } | 726 } |
728 | 727 |
OLD | NEW |