| 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 static const size_t kTextVAColorSize = 2 * sizeof(SkPoint) + sizeof(GrColor); | 57 static const size_t kTextVAColorSize = 2 * sizeof(SkPoint) + sizeof(GrColor); |
| 58 | 58 |
| 59 static const int kVerticesPerGlyph = 4; | 59 static const int kVerticesPerGlyph = 4; |
| 60 static const int kIndicesPerGlyph = 6; | 60 static const int kIndicesPerGlyph = 6; |
| 61 }; | 61 }; |
| 62 | 62 |
| 63 GrDistanceFieldTextContext::GrDistanceFieldTextContext(GrContext* context, | 63 GrDistanceFieldTextContext::GrDistanceFieldTextContext(GrContext* context, |
| 64 const SkDeviceProperties&
properties, | 64 const SkDeviceProperties&
properties, |
| 65 bool enable) | 65 bool enable) |
| 66 : GrTextContext(context, pro
perties) { | 66 : GrTextContext(context, pro
perties) { |
| 67 #if SK_FORCE_DISTANCE_FIELD_TEXT | 67 #if SK_FORCE_DISTANCEFIELD_FONTS |
| 68 fEnableDFRendering = true; | 68 fEnableDFRendering = true; |
| 69 #else | 69 #else |
| 70 fEnableDFRendering = enable; | 70 fEnableDFRendering = enable; |
| 71 #endif | 71 #endif |
| 72 fStrike = NULL; | 72 fStrike = NULL; |
| 73 fGammaTexture = NULL; | 73 fGammaTexture = NULL; |
| 74 | 74 |
| 75 fEffectTextureUniqueID = SK_InvalidUniqueID; | 75 fEffectTextureUniqueID = SK_InvalidUniqueID; |
| 76 fEffectColor = GrColor_ILLEGAL; | 76 fEffectColor = GrColor_ILLEGAL; |
| 77 fEffectFlags = kInvalid_DistanceFieldEffectFlag; | 77 fEffectFlags = kInvalid_DistanceFieldEffectFlag; |
| (...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 689 } | 689 } |
| 690 } | 690 } |
| 691 | 691 |
| 692 inline void GrDistanceFieldTextContext::finish() { | 692 inline void GrDistanceFieldTextContext::finish() { |
| 693 this->flush(); | 693 this->flush(); |
| 694 fTotalVertexCount = 0; | 694 fTotalVertexCount = 0; |
| 695 | 695 |
| 696 GrTextContext::finish(); | 696 GrTextContext::finish(); |
| 697 } | 697 } |
| 698 | 698 |
| OLD | NEW |