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

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

Issue 1322433006: Rename flag from "distance field" to "device independent." (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add legacy alias for chrome Created 5 years, 3 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 | « samplecode/SampleApp.cpp ('k') | src/gpu/GrContext.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 2015 Google Inc. 2 * Copyright 2015 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 #include "GrAtlasTextContext.h" 7 #include "GrAtlasTextContext.h"
8 8
9 #include "GrBatchFontCache.h" 9 #include "GrBatchFontCache.h"
10 #include "GrBatchFlushState.h" 10 #include "GrBatchFlushState.h"
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after
451 } 451 }
452 452
453 SkScalar maxScale = viewMatrix.getMaxScale(); 453 SkScalar maxScale = viewMatrix.getMaxScale();
454 SkScalar scaledTextSize = maxScale*skPaint.getTextSize(); 454 SkScalar scaledTextSize = maxScale*skPaint.getTextSize();
455 // Hinted text looks far better at small resolutions 455 // Hinted text looks far better at small resolutions
456 // Scaling up beyond 2x yields undesireable artifacts 456 // Scaling up beyond 2x yields undesireable artifacts
457 if (scaledTextSize < kMinDFFontSize || scaledTextSize > kLargeDFFontLimit) { 457 if (scaledTextSize < kMinDFFontSize || scaledTextSize > kLargeDFFontLimit) {
458 return false; 458 return false;
459 } 459 }
460 460
461 bool useDFT = fSurfaceProps.isUseDistanceFieldFonts(); 461 bool useDFT = fSurfaceProps.isUseDeviceIndependentFonts();
462 #if SK_FORCE_DISTANCE_FIELD_TEXT 462 #if SK_FORCE_DISTANCE_FIELD_TEXT
463 useDFT = true; 463 useDFT = true;
464 #endif 464 #endif
465 465
466 if (!useDFT && scaledTextSize < kLargeDFFontSize) { 466 if (!useDFT && scaledTextSize < kLargeDFFontSize) {
467 return false; 467 return false;
468 } 468 }
469 469
470 // rasterizers and mask filters modify alpha, which doesn't 470 // rasterizers and mask filters modify alpha, which doesn't
471 // translate well to distance 471 // translate well to distance
(...skipping 1813 matching lines...) Expand 10 before | Expand all | Expand 10 after
2285 gTextContext->createDrawTextBlob(rt, clip, grPaint, skPaint, viewMat rix, text, 2285 gTextContext->createDrawTextBlob(rt, clip, grPaint, skPaint, viewMat rix, text,
2286 static_cast<size_t>(textLen), 0, 0, noClip)); 2286 static_cast<size_t>(textLen), 0, 0, noClip));
2287 2287
2288 SkScalar transX = static_cast<SkScalar>(random->nextU()); 2288 SkScalar transX = static_cast<SkScalar>(random->nextU());
2289 SkScalar transY = static_cast<SkScalar>(random->nextU()); 2289 SkScalar transY = static_cast<SkScalar>(random->nextU());
2290 const GrAtlasTextBlob::Run::SubRunInfo& info = blob->fRuns[0].fSubRunInfo[0] ; 2290 const GrAtlasTextBlob::Run::SubRunInfo& info = blob->fRuns[0].fSubRunInfo[0] ;
2291 return gTextContext->createBatch(blob, info, textLen, 0, 0, color, transX, t ransY, skPaint); 2291 return gTextContext->createBatch(blob, info, textLen, 0, 0, color, transX, t ransY, skPaint);
2292 } 2292 }
2293 2293
2294 #endif 2294 #endif
OLDNEW
« no previous file with comments | « samplecode/SampleApp.cpp ('k') | src/gpu/GrContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698