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

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

Issue 1863013003: Pass effects directly to fontcache (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: removed DUMMY effects 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
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;
263 // We apply the fake-gamma by altering the distance in the shader, so we ign ore the 264 // We apply the fake-gamma by altering the distance in the shader, so we ign ore the
264 // fakeGamma parameter. (It's only used when we fall-back to bitmap text). 265 // fakeGamma parameter. (It's only used when we fall-back to bitmap text).
265 skPaint.getScalerContextDescriptor(&desc, props, SkPaint::FakeGamma::Off, nu llptr); 266 skPaint.getScalerContextDescriptor(&desc, &effects, props, SkPaint::FakeGamm a::Off, nullptr);
266 SkGlyphCache* origPaintCache = SkGlyphCache::DetachCache(skPaint.getTypeface (), 267 SkGlyphCache* origPaintCache = SkGlyphCache::DetachCache(skPaint.getTypeface (), effects,
267 desc.getDesc()); 268 desc.getDesc());
268 269
269 SkTArray<SkScalar> positions; 270 SkTArray<SkScalar> positions;
270 271
271 const char* textPtr = text; 272 const char* textPtr = text;
272 SkScalar stopX = 0; 273 SkScalar stopX = 0;
273 SkScalar stopY = 0; 274 SkScalar stopY = 0;
274 SkScalar origin = 0; 275 SkScalar origin = 0;
275 switch (skPaint.getTextAlign()) { 276 switch (skPaint.getTextAlign()) {
276 case SkPaint::kRight_Align: origin = SK_Scalar1; break; 277 case SkPaint::kRight_Align: origin = SK_Scalar1; break;
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
580 if (cache->getAuxProcData(glyph_cache_aux_proc, &auxData)) { 581 if (cache->getAuxProcData(glyph_cache_aux_proc, &auxData)) {
581 scaler = (GrFontScaler*)auxData; 582 scaler = (GrFontScaler*)auxData;
582 } 583 }
583 if (nullptr == scaler) { 584 if (nullptr == scaler) {
584 scaler = new GrFontScaler(cache); 585 scaler = new GrFontScaler(cache);
585 cache->setAuxProc(glyph_cache_aux_proc, scaler); 586 cache->setAuxProc(glyph_cache_aux_proc, scaler);
586 } 587 }
587 588
588 return scaler; 589 return scaler;
589 } 590 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698