| OLD | NEW |
| 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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 // a run | 158 // a run |
| 159 const SkDescriptor* newDesc = (run->fOverrideDescriptor && !info->drawAs
DistanceFields()) ? | 159 const SkDescriptor* newDesc = (run->fOverrideDescriptor && !info->drawAs
DistanceFields()) ? |
| 160 run->fOverrideDescriptor->getDesc() : | 160 run->fOverrideDescriptor->getDesc() : |
| 161 run->fDescriptor.getDesc(); | 161 run->fDescriptor.getDesc(); |
| 162 if (!*cache || !SkTypeface::Equal(*typeface, run->fTypeface) || | 162 if (!*cache || !SkTypeface::Equal(*typeface, run->fTypeface) || |
| 163 !((*desc)->equals(*newDesc))) { | 163 !((*desc)->equals(*newDesc))) { |
| 164 if (*cache) { | 164 if (*cache) { |
| 165 SkGlyphCache::AttachCache(*cache); | 165 SkGlyphCache::AttachCache(*cache); |
| 166 } | 166 } |
| 167 *desc = newDesc; | 167 *desc = newDesc; |
| 168 *cache = SkGlyphCache::DetachCache(run->fTypeface, run->fEffects, *d
esc); | 168 *cache = SkGlyphCache::DetachCache(run->fTypeface, *desc); |
| 169 *scaler = GrTextUtils::GetGrFontScaler(*cache); | 169 *scaler = GrTextUtils::GetGrFontScaler(*cache); |
| 170 *typeface = run->fTypeface; | 170 *typeface = run->fTypeface; |
| 171 } | 171 } |
| 172 | 172 |
| 173 if (regenGlyphs) { | 173 if (regenGlyphs) { |
| 174 strike = fontCache->getStrike(*scaler); | 174 strike = fontCache->getStrike(*scaler); |
| 175 } else { | 175 } else { |
| 176 strike = info->strike(); | 176 strike = info->strike(); |
| 177 } | 177 } |
| 178 } | 178 } |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 312 // set use tokens for all of the glyphs in our subrun. This is only
valid if we | 312 // set use tokens for all of the glyphs in our subrun. This is only
valid if we |
| 313 // have a valid atlas generation | 313 // have a valid atlas generation |
| 314 fontCache->setUseTokenBulk(*info.bulkUseToken(), target->nextDrawTok
en(), | 314 fontCache->setUseTokenBulk(*info.bulkUseToken(), target->nextDrawTok
en(), |
| 315 info.maskFormat()); | 315 info.maskFormat()); |
| 316 break; | 316 break; |
| 317 } | 317 } |
| 318 | 318 |
| 319 *byteCount = info.byteCount(); | 319 *byteCount = info.byteCount(); |
| 320 *vertices = fVertices + info.vertexStartIndex(); | 320 *vertices = fVertices + info.vertexStartIndex(); |
| 321 } | 321 } |
| OLD | NEW |