OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2010 Google Inc. | 2 * Copyright 2010 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 "GrTextContext.h" | 8 #include "GrTextContext.h" |
9 #include "GrBlurUtils.h" | 9 #include "GrBlurUtils.h" |
10 #include "GrContext.h" | 10 #include "GrContext.h" |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 SkScalar matrixScale = paint.setupForAsPaths(); | 211 SkScalar matrixScale = paint.setupForAsPaths(); |
212 | 212 |
213 SkMatrix matrix; | 213 SkMatrix matrix; |
214 matrix.setScale(matrixScale, matrixScale); | 214 matrix.setScale(matrixScale, matrixScale); |
215 | 215 |
216 // Temporarily jam in kFill, so we only ever ask for the raw outline from th
e cache. | 216 // Temporarily jam in kFill, so we only ever ask for the raw outline from th
e cache. |
217 paint.setStyle(SkPaint::kFill_Style); | 217 paint.setStyle(SkPaint::kFill_Style); |
218 paint.setPathEffect(NULL); | 218 paint.setPathEffect(NULL); |
219 | 219 |
220 SkDrawCacheProc glyphCacheProc = paint.getDrawCacheProc(); | 220 SkDrawCacheProc glyphCacheProc = paint.getDrawCacheProc(); |
221 SkAutoGlyphCache autoCache(paint, NULL, NULL); | 221 SkAutoGlyphCache autoCache(paint, &fSurfaceProps, NULL); |
222 SkGlyphCache* cache = autoCache.getCache(); | 222 SkGlyphCache* cache = autoCache.getCache(); |
223 | 223 |
224 const char* stop = text + byteLength; | 224 const char* stop = text + byteLength; |
225 SkTextAlignProc alignProc(paint.getTextAlign()); | 225 SkTextAlignProc alignProc(paint.getTextAlign()); |
226 SkTextMapStateProc tmsProc(SkMatrix::I(), offset, scalarsPerPosition); | 226 SkTextMapStateProc tmsProc(SkMatrix::I(), offset, scalarsPerPosition); |
227 | 227 |
228 // Now restore the original settings, so we "draw" with whatever style/strok
ing. | 228 // Now restore the original settings, so we "draw" with whatever style/strok
ing. |
229 paint.setStyle(origPaint.getStyle()); | 229 paint.setStyle(origPaint.getStyle()); |
230 paint.setPathEffect(origPaint.getPathEffect()); | 230 paint.setPathEffect(origPaint.getPathEffect()); |
231 | 231 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 if (cache->getAuxProcData(GlyphCacheAuxProc, &auxData)) { | 286 if (cache->getAuxProcData(GlyphCacheAuxProc, &auxData)) { |
287 scaler = (GrFontScaler*)auxData; | 287 scaler = (GrFontScaler*)auxData; |
288 } | 288 } |
289 if (NULL == scaler) { | 289 if (NULL == scaler) { |
290 scaler = SkNEW_ARGS(GrFontScaler, (cache)); | 290 scaler = SkNEW_ARGS(GrFontScaler, (cache)); |
291 cache->setAuxProc(GlyphCacheAuxProc, scaler); | 291 cache->setAuxProc(GlyphCacheAuxProc, scaler); |
292 } | 292 } |
293 | 293 |
294 return scaler; | 294 return scaler; |
295 } | 295 } |
OLD | NEW |