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 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 // transform is not part of SkPaint::measureText API, and thus we use the | 181 // transform is not part of SkPaint::measureText API, and thus we use the |
182 // same glyphs as what were measured. | 182 // same glyphs as what were measured. |
183 | 183 |
184 this->init(rt, clip, paint, skPaint, byteLength, kMaxPerformance_RenderMode,
viewMatrix); | 184 this->init(rt, clip, paint, skPaint, byteLength, kMaxPerformance_RenderMode,
viewMatrix); |
185 | 185 |
186 SkDrawCacheProc glyphCacheProc = fSkPaint.getDrawCacheProc(); | 186 SkDrawCacheProc glyphCacheProc = fSkPaint.getDrawCacheProc(); |
187 | 187 |
188 const char* stop = text + byteLength; | 188 const char* stop = text + byteLength; |
189 | 189 |
190 SkTextMapStateProc tmsProc(SkMatrix::I(), offset, scalarsPerPosition); | 190 SkTextMapStateProc tmsProc(SkMatrix::I(), offset, scalarsPerPosition); |
191 SkTextAlignProcScalar alignProc(fSkPaint.getTextAlign()); | 191 SkTextAlignProc alignProc(fSkPaint.getTextAlign()); |
192 while (text < stop) { | 192 while (text < stop) { |
193 const SkGlyph& glyph = glyphCacheProc(fGlyphCache, &text, 0, 0); | 193 const SkGlyph& glyph = glyphCacheProc(fGlyphCache, &text, 0, 0); |
194 if (glyph.fWidth) { | 194 if (glyph.fWidth) { |
195 SkPoint tmsLoc; | 195 SkPoint tmsLoc; |
196 tmsProc(pos, &tmsLoc); | 196 tmsProc(pos, &tmsLoc); |
197 SkPoint loc; | 197 SkPoint loc; |
198 alignProc(tmsLoc, glyph, &loc); | 198 alignProc(tmsLoc, glyph, &loc); |
199 | 199 |
200 this->appendGlyph(glyph, loc); | 200 this->appendGlyph(glyph, loc); |
201 } | 201 } |
(...skipping 261 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 |