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

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

Issue 1872253004: Revert of Pass effects directly to fontcache (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 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/gpu/text/GrStencilAndCoverTextContext.cpp ('k') | src/ports/SkFontHost_FreeType.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 7
8 #include "GrTextUtils.h" 8 #include "GrTextUtils.h"
9 9
10 #include "GrAtlasTextBlob.h" 10 #include "GrAtlasTextBlob.h"
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 SkScalar x, SkScalar y) { 253 SkScalar x, SkScalar y) {
254 SkASSERT(byteLength == 0 || text != nullptr); 254 SkASSERT(byteLength == 0 || text != nullptr);
255 255
256 // nothing to draw 256 // nothing to draw
257 if (text == nullptr || byteLength == 0) { 257 if (text == nullptr || byteLength == 0) {
258 return; 258 return;
259 } 259 }
260 260
261 SkPaint::GlyphCacheProc glyphCacheProc = skPaint.getGlyphCacheProc(true); 261 SkPaint::GlyphCacheProc glyphCacheProc = skPaint.getGlyphCacheProc(true);
262 SkAutoDescriptor desc; 262 SkAutoDescriptor desc;
263 SkScalerContextEffects effects;
264 // We apply the fake-gamma by altering the distance in the shader, so we ign ore the 263 // We apply the fake-gamma by altering the distance in the shader, so we ign ore the
265 // passed-in scaler context flags. (It's only used when we fall-back to bitm ap text). 264 // passed-in scaler context flags. (It's only used when we fall-back to bitm ap text).
266 skPaint.getScalerContextDescriptor(&effects, &desc, props, SkPaint::kNone_Sc alerContextFlags, 265 skPaint.getScalerContextDescriptor(&desc, props, SkPaint::kNone_ScalerContex tFlags, nullptr);
267 nullptr); 266 SkGlyphCache* origPaintCache = SkGlyphCache::DetachCache(skPaint.getTypeface (),
268 SkGlyphCache* origPaintCache = SkGlyphCache::DetachCache(skPaint.getTypeface (), effects,
269 desc.getDesc()); 267 desc.getDesc());
270 268
271 SkTArray<SkScalar> positions; 269 SkTArray<SkScalar> positions;
272 270
273 const char* textPtr = text; 271 const char* textPtr = text;
274 SkScalar stopX = 0; 272 SkScalar stopX = 0;
275 SkScalar stopY = 0; 273 SkScalar stopY = 0;
276 SkScalar origin = 0; 274 SkScalar origin = 0;
277 switch (skPaint.getTextAlign()) { 275 switch (skPaint.getTextAlign()) {
278 case SkPaint::kRight_Align: origin = SK_Scalar1; break; 276 case SkPaint::kRight_Align: origin = SK_Scalar1; break;
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
582 if (cache->getAuxProcData(glyph_cache_aux_proc, &auxData)) { 580 if (cache->getAuxProcData(glyph_cache_aux_proc, &auxData)) {
583 scaler = (GrFontScaler*)auxData; 581 scaler = (GrFontScaler*)auxData;
584 } 582 }
585 if (nullptr == scaler) { 583 if (nullptr == scaler) {
586 scaler = new GrFontScaler(cache); 584 scaler = new GrFontScaler(cache);
587 cache->setAuxProc(glyph_cache_aux_proc, scaler); 585 cache->setAuxProc(glyph_cache_aux_proc, scaler);
588 } 586 }
589 587
590 return scaler; 588 return scaler;
591 } 589 }
OLDNEW
« no previous file with comments | « src/gpu/text/GrStencilAndCoverTextContext.cpp ('k') | src/ports/SkFontHost_FreeType.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698