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 "GrBitmapTextContext.h" | 8 #include "GrBitmapTextContext.h" |
9 #include "GrAtlas.h" | 9 #include "GrAtlas.h" |
10 #include "GrDefaultGeoProcFactory.h" | 10 #include "GrDefaultGeoProcFactory.h" |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 fTotalVertexCount = kVerticesPerGlyph*numGlyphs; | 131 fTotalVertexCount = kVerticesPerGlyph*numGlyphs; |
132 | 132 |
133 const char* stop = text + byteLength; | 133 const char* stop = text + byteLength; |
134 | 134 |
135 SkAutoKern autokern; | 135 SkAutoKern autokern; |
136 | 136 |
137 SkFixed fxMask = ~0; | 137 SkFixed fxMask = ~0; |
138 SkFixed fyMask = ~0; | 138 SkFixed fyMask = ~0; |
139 SkFixed halfSampleX, halfSampleY; | 139 SkFixed halfSampleX, halfSampleY; |
140 if (cache->isSubpixel()) { | 140 if (cache->isSubpixel()) { |
141 halfSampleX = halfSampleY = (SK_FixedHalf >> SkGlyph::kSubBits); | 141 halfSampleX = halfSampleY = SkGlyph::kSubpixelRound; |
142 SkAxisAlignment baseline = SkComputeAxisAlignmentForHText(viewMatrix); | 142 SkAxisAlignment baseline = SkComputeAxisAlignmentForHText(viewMatrix); |
143 if (kX_SkAxisAlignment == baseline) { | 143 if (kX_SkAxisAlignment == baseline) { |
144 fyMask = 0; | 144 fyMask = 0; |
145 halfSampleY = SK_FixedHalf; | 145 halfSampleY = SK_FixedHalf; |
146 } else if (kY_SkAxisAlignment == baseline) { | 146 } else if (kY_SkAxisAlignment == baseline) { |
147 fxMask = 0; | 147 fxMask = 0; |
148 halfSampleX = SK_FixedHalf; | 148 halfSampleX = SK_FixedHalf; |
149 } | 149 } |
150 } else { | 150 } else { |
151 halfSampleX = halfSampleY = SK_FixedHalf; | 151 halfSampleX = halfSampleY = SK_FixedHalf; |
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
597 } | 597 } |
598 } | 598 } |
599 | 599 |
600 inline void GrBitmapTextContext::finish() { | 600 inline void GrBitmapTextContext::finish() { |
601 this->flush(); | 601 this->flush(); |
602 fTotalVertexCount = 0; | 602 fTotalVertexCount = 0; |
603 | 603 |
604 GrTextContext::finish(); | 604 GrTextContext::finish(); |
605 } | 605 } |
606 | 606 |
OLD | NEW |