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

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

Issue 1993213003: Make GrAtlasTextBlob::run own effects it points to. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 7 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/GrAtlasTextBlob.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 2016 Google Inc. 2 * Copyright 2016 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 "GrAtlasTextBlob.h" 8 #include "GrAtlasTextBlob.h"
9 9
10 #include "GrBatchFlushState.h" 10 #include "GrBatchFlushState.h"
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 static_assert(!regenGlyphs || regenTexCoords, "must regenTexCoords along reg enGlyphs"); 151 static_assert(!regenGlyphs || regenTexCoords, "must regenTexCoords along reg enGlyphs");
152 GrBatchTextStrike* strike = nullptr; 152 GrBatchTextStrike* strike = nullptr;
153 if (regenTexCoords) { 153 if (regenTexCoords) {
154 info->resetBulkUseToken(); 154 info->resetBulkUseToken();
155 155
156 const SkDescriptor* desc = (run->fOverrideDescriptor && !info->drawAsDis tanceFields()) 156 const SkDescriptor* desc = (run->fOverrideDescriptor && !info->drawAsDis tanceFields())
157 ? run->fOverrideDescriptor->getDesc() 157 ? run->fOverrideDescriptor->getDesc()
158 : run->fDescriptor.getDesc(); 158 : run->fDescriptor.getDesc();
159 159
160 if (!*lazyCache || (*lazyCache)->getDescriptor() != *desc) { 160 if (!*lazyCache || (*lazyCache)->getDescriptor() != *desc) {
161 lazyCache->reset(SkGlyphCache::DetachCache(run->fTypeface, run->fEff ects, desc)); 161 SkScalerContextEffects effects;
162 effects.fPathEffect = run->fPathEffect.get();
163 effects.fRasterizer = run->fRasterizer.get();
164 effects.fMaskFilter = run->fMaskFilter.get();
165 lazyCache->reset(SkGlyphCache::DetachCache(run->fTypeface, effects, desc));
162 } 166 }
163 167
164 if (regenGlyphs) { 168 if (regenGlyphs) {
165 strike = fontCache->getStrike(lazyCache->get()); 169 strike = fontCache->getStrike(lazyCache->get());
166 } else { 170 } else {
167 strike = info->strike(); 171 strike = info->strike();
168 } 172 }
169 } 173 }
170 174
171 bool brokenRun = false; 175 bool brokenRun = false;
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 // set use tokens for all of the glyphs in our subrun. This is only valid if we 305 // set use tokens for all of the glyphs in our subrun. This is only valid if we
302 // have a valid atlas generation 306 // have a valid atlas generation
303 fontCache->setUseTokenBulk(*info.bulkUseToken(), target->nextDrawTok en(), 307 fontCache->setUseTokenBulk(*info.bulkUseToken(), target->nextDrawTok en(),
304 info.maskFormat()); 308 info.maskFormat());
305 break; 309 break;
306 } 310 }
307 311
308 *byteCount = info.byteCount(); 312 *byteCount = info.byteCount();
309 *vertices = fVertices + info.vertexStartIndex(); 313 *vertices = fVertices + info.vertexStartIndex();
310 } 314 }
OLDNEW
« no previous file with comments | « src/gpu/text/GrAtlasTextBlob.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698