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

Side by Side Diff: src/gpu/text/GrTextUtils.cpp

Issue 1606943002: A few more small changes to make GrAtlasTextBlob nearly self contained (Closed) Base URL: https://skia.googlesource.com/skia.git@cleanuptext16
Patch Set: cleanup Created 4 years, 11 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/gpu/text/GrAtlasTextContext.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 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 7
8 #include "GrTextUtils.h" 8 #include "GrTextUtils.h"
9 9
10 #include "GrAtlasTextBlob.h" 10 #include "GrAtlasTextBlob.h"
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 } 229 }
230 230
231 // Because there can be multiple runs in the blob, we want the overall maxMi nScale, and 231 // Because there can be multiple runs in the blob, we want the overall maxMi nScale, and
232 // minMaxScale to make regeneration decisions. Specifically, we want the ma ximum minimum scale 232 // minMaxScale to make regeneration decisions. Specifically, we want the ma ximum minimum scale
233 // we can tolerate before we'd drop to a lower mip size, and the minimum max imum scale we can 233 // we can tolerate before we'd drop to a lower mip size, and the minimum max imum scale we can
234 // tolerate before we'd have to move to a large mip size. When we actually test these values 234 // tolerate before we'd have to move to a large mip size. When we actually test these values
235 // we look at the delta in scale between the new viewmatrix and the old view matrix, and test 235 // we look at the delta in scale between the new viewmatrix and the old view matrix, and test
236 // against these values to decide if we can reuse or not(ie, will a given sc ale change our mip 236 // against these values to decide if we can reuse or not(ie, will a given sc ale change our mip
237 // level) 237 // level)
238 SkASSERT(dfMaskScaleFloor <= scaledTextSize && scaledTextSize <= dfMaskScale Ceil); 238 SkASSERT(dfMaskScaleFloor <= scaledTextSize && scaledTextSize <= dfMaskScale Ceil);
239 blob->fMaxMinScale = SkMaxScalar(dfMaskScaleFloor / scaledTextSize, blob->fM axMinScale); 239 blob->setMinAndMaxScale(dfMaskScaleFloor / scaledTextSize, dfMaskScaleCeil / scaledTextSize);
240 blob->fMinMaxScale = SkMinScalar(dfMaskScaleCeil / scaledTextSize, blob->fMi nMaxScale);
241 240
242 skPaint->setLCDRenderText(false); 241 skPaint->setLCDRenderText(false);
243 skPaint->setAutohinted(false); 242 skPaint->setAutohinted(false);
244 skPaint->setHinting(SkPaint::kNormal_Hinting); 243 skPaint->setHinting(SkPaint::kNormal_Hinting);
245 skPaint->setSubpixelText(true); 244 skPaint->setSubpixelText(true);
246 } 245 }
247 246
248 void GrTextUtils::DrawDfText(GrAtlasTextBlob* blob, int runIndex, 247 void GrTextUtils::DrawDfText(GrAtlasTextBlob* blob, int runIndex,
249 GrBatchFontCache* fontCache, const SkSurfaceProps& props, 248 GrBatchFontCache* fontCache, const SkSurfaceProps& props,
250 const SkPaint& skPaint, GrColor color, 249 const SkPaint& skPaint, GrColor color,
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
530 529
531 matrix[SkMatrix::kMTransX] = loc.fX; 530 matrix[SkMatrix::kMTransX] = loc.fX;
532 matrix[SkMatrix::kMTransY] = loc.fY; 531 matrix[SkMatrix::kMTransY] = loc.fY;
533 GrBlurUtils::drawPathWithMaskFilter(context, dc, clip, *path, pa int, 532 GrBlurUtils::drawPathWithMaskFilter(context, dc, clip, *path, pa int,
534 viewMatrix, &matrix, clipBou nds, false); 533 viewMatrix, &matrix, clipBou nds, false);
535 } 534 }
536 } 535 }
537 pos += scalarsPerPosition; 536 pos += scalarsPerPosition;
538 } 537 }
539 } 538 }
OLDNEW
« no previous file with comments | « src/gpu/text/GrAtlasTextContext.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698