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

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

Issue 200423003: Get correct text metrics for distance fields, and fix dropouts due to thin features. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Address oddities Created 6 years, 9 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/SkDistanceFieldGen.cpp ('k') | no next file » | 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 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 fCurrVertex = 0; 301 fCurrVertex = 0;
302 302
303 fVertices = NULL; 303 fVertices = NULL;
304 fMaxVertices = 0; 304 fMaxVertices = 0;
305 305
306 fTextRatio = fSkPaint.getTextSize()/kBaseDFFontSize; 306 fTextRatio = fSkPaint.getTextSize()/kBaseDFFontSize;
307 307
308 fSkPaint.setTextSize(SkIntToScalar(kBaseDFFontSize)); 308 fSkPaint.setTextSize(SkIntToScalar(kBaseDFFontSize));
309 fSkPaint.setLCDRenderText(false); 309 fSkPaint.setLCDRenderText(false);
310 fSkPaint.setAutohinted(false); 310 fSkPaint.setAutohinted(false);
311 fSkPaint.setSubpixelText(false); 311 fSkPaint.setSubpixelText(true);
312 } 312 }
313 313
314 inline void GrDistanceFieldTextContext::finish() { 314 inline void GrDistanceFieldTextContext::finish() {
315 flushGlyphs(); 315 flushGlyphs();
316 316
317 GrTextContext::finish(); 317 GrTextContext::finish();
318 } 318 }
319 319
320 void GrDistanceFieldTextContext::drawText(const GrPaint& paint, const SkPaint& s kPaint, 320 void GrDistanceFieldTextContext::drawText(const GrPaint& paint, const SkPaint& s kPaint,
321 const char text[], size_t byteLength, 321 const char text[], size_t byteLength,
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 SkScalarToFixed(y) - (glyph.fAdvanceY >> a lignShift) 449 SkScalarToFixed(y) - (glyph.fAdvanceY >> a lignShift)
450 + SK_FixedHalf, //d1g.fHalfSampleY, 450 + SK_FixedHalf, //d1g.fHalfSampleY,
451 fontScaler); 451 fontScaler);
452 } 452 }
453 pos += scalarsPerPosition; 453 pos += scalarsPerPosition;
454 } 454 }
455 } 455 }
456 456
457 this->finish(); 457 this->finish();
458 } 458 }
OLDNEW
« no previous file with comments | « src/core/SkDistanceFieldGen.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698