| 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 15 matching lines...) Expand all Loading... |
| 26 #include "SkPath.h" | 26 #include "SkPath.h" |
| 27 #include "SkRTConf.h" | 27 #include "SkRTConf.h" |
| 28 #include "SkStrokeRec.h" | 28 #include "SkStrokeRec.h" |
| 29 #include "effects/GrDistanceFieldTextureEffect.h" | 29 #include "effects/GrDistanceFieldTextureEffect.h" |
| 30 | 30 |
| 31 SK_CONF_DECLARE(bool, c_DumpFontCache, "gpu.dumpFontCache", false, | 31 SK_CONF_DECLARE(bool, c_DumpFontCache, "gpu.dumpFontCache", false, |
| 32 "Dump the contents of the font cache before every purge."); | 32 "Dump the contents of the font cache before every purge."); |
| 33 | 33 |
| 34 static const int kSmallDFFontSize = 32; | 34 static const int kSmallDFFontSize = 32; |
| 35 static const int kSmallDFFontLimit = 32; | 35 static const int kSmallDFFontLimit = 32; |
| 36 static const int kMediumDFFontSize = 78; | 36 static const int kMediumDFFontSize = 64; |
| 37 static const int kMediumDFFontLimit = 78; | 37 static const int kMediumDFFontLimit = 64; |
| 38 static const int kLargeDFFontSize = 192; | 38 static const int kLargeDFFontSize = 128; |
| 39 | 39 |
| 40 static const int kVerticesPerGlyph = 4; | 40 static const int kVerticesPerGlyph = 4; |
| 41 static const int kIndicesPerGlyph = 6; | 41 static const int kIndicesPerGlyph = 6; |
| 42 | 42 |
| 43 GrDistanceFieldTextContext::GrDistanceFieldTextContext(GrContext* context, | 43 GrDistanceFieldTextContext::GrDistanceFieldTextContext(GrContext* context, |
| 44 const SkDeviceProperties&
properties, | 44 const SkDeviceProperties&
properties, |
| 45 bool enable) | 45 bool enable) |
| 46 : GrTextContext(context, pro
perties) { | 46 : GrTextContext(context, pro
perties) { |
| 47 #if SK_FORCE_DISTANCE_FIELD_TEXT | 47 #if SK_FORCE_DISTANCE_FIELD_TEXT |
| 48 fEnableDFRendering = true; | 48 fEnableDFRendering = true; |
| (...skipping 635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 684 } | 684 } |
| 685 } | 685 } |
| 686 | 686 |
| 687 inline void GrDistanceFieldTextContext::finish() { | 687 inline void GrDistanceFieldTextContext::finish() { |
| 688 this->flush(); | 688 this->flush(); |
| 689 fTotalVertexCount = 0; | 689 fTotalVertexCount = 0; |
| 690 | 690 |
| 691 GrTextContext::finish(); | 691 GrTextContext::finish(); |
| 692 } | 692 } |
| 693 | 693 |
| OLD | NEW |