OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 "GrStencilAndCoverTextContext.h" | 8 #include "GrStencilAndCoverTextContext.h" |
9 #include "GrBitmapTextContext.h" | 9 #include "GrBitmapTextContext.h" |
10 #include "GrDrawTarget.h" | 10 #include "GrDrawTarget.h" |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 } | 136 } |
137 | 137 |
138 SkAutoKern autokern; | 138 SkAutoKern autokern; |
139 | 139 |
140 SkFixed fixedSizeRatio = SkScalarToFixed(fTextRatio); | 140 SkFixed fixedSizeRatio = SkScalarToFixed(fTextRatio); |
141 | 141 |
142 SkFixed fx = SkScalarToFixed(x); | 142 SkFixed fx = SkScalarToFixed(x); |
143 SkFixed fy = SkScalarToFixed(y); | 143 SkFixed fy = SkScalarToFixed(y); |
144 while (text < stop) { | 144 while (text < stop) { |
145 const SkGlyph& glyph = glyphCacheProc(fGlyphCache, &text, 0, 0); | 145 const SkGlyph& glyph = glyphCacheProc(fGlyphCache, &text, 0, 0); |
146 fx += SkFixedMul_portable(autokern.adjust(glyph), fixedSizeRatio); | 146 fx += SkFixedMul(autokern.adjust(glyph), fixedSizeRatio); |
147 if (glyph.fWidth) { | 147 if (glyph.fWidth) { |
148 this->appendGlyph(glyph, SkPoint::Make(SkFixedToScalar(fx), SkFixedT
oScalar(fy))); | 148 this->appendGlyph(glyph, SkPoint::Make(SkFixedToScalar(fx), SkFixedT
oScalar(fy))); |
149 } | 149 } |
150 | 150 |
151 fx += SkFixedMul_portable(glyph.fAdvanceX, fixedSizeRatio); | 151 fx += SkFixedMul(glyph.fAdvanceX, fixedSizeRatio); |
152 fy += SkFixedMul_portable(glyph.fAdvanceY, fixedSizeRatio); | 152 fy += SkFixedMul(glyph.fAdvanceY, fixedSizeRatio); |
153 } | 153 } |
154 | 154 |
155 this->finish(); | 155 this->finish(); |
156 } | 156 } |
157 | 157 |
158 void GrStencilAndCoverTextContext::onDrawPosText(GrRenderTarget* rt, | 158 void GrStencilAndCoverTextContext::onDrawPosText(GrRenderTarget* rt, |
159 const GrClip& clip, | 159 const GrClip& clip, |
160 const GrPaint& paint, | 160 const GrPaint& paint, |
161 const SkPaint& skPaint, | 161 const SkPaint& skPaint, |
162 const SkMatrix& viewMatrix, | 162 const SkMatrix& viewMatrix, |
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
463 | 463 |
464 SkGlyphCache::AttachCache(fGlyphCache); | 464 SkGlyphCache::AttachCache(fGlyphCache); |
465 fGlyphCache = NULL; | 465 fGlyphCache = NULL; |
466 | 466 |
467 fPipelineBuilder.stencil()->setDisabled(); | 467 fPipelineBuilder.stencil()->setDisabled(); |
468 fStateRestore.set(NULL); | 468 fStateRestore.set(NULL); |
469 fViewMatrix = fContextInitialMatrix; | 469 fViewMatrix = fContextInitialMatrix; |
470 GrTextContext::finish(); | 470 GrTextContext::finish(); |
471 } | 471 } |
472 | 472 |
OLD | NEW |