Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(188)

Side by Side Diff: src/gpu/GrDistanceFieldTextContext.cpp

Issue 227593010: Move distance field generation to the glyph cache (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Move GrFontScaler back to public interface Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/core/SkGlyphCache.cpp ('k') | src/gpu/GrTextStrike.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "GrDrawTarget.h" 10 #include "GrDrawTarget.h"
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 SkPath* path = SkNEW(SkPath); 232 SkPath* path = SkNEW(SkPath);
233 if (!scaler->getGlyphPath(glyph->glyphID(), path)) { 233 if (!scaler->getGlyphPath(glyph->glyphID(), path)) {
234 // flag the glyph as being dead? 234 // flag the glyph as being dead?
235 delete path; 235 delete path;
236 return; 236 return;
237 } 237 }
238 glyph->fPath = path; 238 glyph->fPath = path;
239 } 239 }
240 240
241 GrContext::AutoMatrix am; 241 GrContext::AutoMatrix am;
242 SkMatrix translate; 242 SkMatrix ctm;
243 translate.setTranslate(sx, sy); 243 ctm.setScale(fTextRatio, fTextRatio);
244 ctm.postTranslate(sx, sy);
244 GrPaint tmpPaint(fPaint); 245 GrPaint tmpPaint(fPaint);
245 am.setPreConcat(fContext, translate, &tmpPaint); 246 am.setPreConcat(fContext, ctm, &tmpPaint);
246 SkStrokeRec stroke(SkStrokeRec::kFill_InitStyle); 247 SkStrokeRec stroke(SkStrokeRec::kFill_InitStyle);
247 fContext->drawPath(tmpPaint, *glyph->fPath, stroke); 248 fContext->drawPath(tmpPaint, *glyph->fPath, stroke);
248 return; 249 return;
249 } 250 }
250 251
251 HAS_ATLAS: 252 HAS_ATLAS:
252 SkASSERT(glyph->fPlot); 253 SkASSERT(glyph->fPlot);
253 GrDrawTarget::DrawToken drawToken = fDrawTarget->getCurrentDrawToken(); 254 GrDrawTarget::DrawToken drawToken = fDrawTarget->getCurrentDrawToken();
254 glyph->fPlot->setDrawToken(drawToken); 255 glyph->fPlot->setDrawToken(drawToken);
255 256
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
493 SkScalarToFixed(y) - (glyph.fAdvanceY >> a lignShift) 494 SkScalarToFixed(y) - (glyph.fAdvanceY >> a lignShift)
494 + SK_FixedHalf, //d1g.fHalfSampleY, 495 + SK_FixedHalf, //d1g.fHalfSampleY,
495 fontScaler); 496 fontScaler);
496 } 497 }
497 pos += scalarsPerPosition; 498 pos += scalarsPerPosition;
498 } 499 }
499 } 500 }
500 501
501 this->finish(); 502 this->finish();
502 } 503 }
OLDNEW
« no previous file with comments | « src/core/SkGlyphCache.cpp ('k') | src/gpu/GrTextStrike.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698