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

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

Issue 1811723002: free -> reset (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: zarro boogs found Created 4 years, 9 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/GrLayerCache.cpp ('k') | src/images/SkImageDecoder_libwebp.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 "GrBatchFontCache.h" 8 #include "GrBatchFontCache.h"
9 #include "GrContext.h" 9 #include "GrContext.h"
10 #include "GrGpu.h" 10 #include "GrGpu.h"
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 , fPool(9/*start allocations at 512 bytes*/) 158 , fPool(9/*start allocations at 512 bytes*/)
159 , fAtlasedGlyphs(0) 159 , fAtlasedGlyphs(0)
160 , fIsAbandoned(false) { 160 , fIsAbandoned(false) {
161 161
162 fBatchFontCache = cache; // no need to ref, it won't go away before we d o 162 fBatchFontCache = cache; // no need to ref, it won't go away before we d o
163 } 163 }
164 164
165 GrBatchTextStrike::~GrBatchTextStrike() { 165 GrBatchTextStrike::~GrBatchTextStrike() {
166 SkTDynamicHash<GrGlyph, GrGlyph::PackedID>::Iter iter(&fCache); 166 SkTDynamicHash<GrGlyph, GrGlyph::PackedID>::Iter iter(&fCache);
167 while (!iter.done()) { 167 while (!iter.done()) {
168 (*iter).free(); 168 (*iter).reset();
169 ++iter; 169 ++iter;
170 } 170 }
171 } 171 }
172 172
173 GrGlyph* GrBatchTextStrike::generateGlyph(const SkGlyph& skGlyph, GrGlyph::Packe dID packed, 173 GrGlyph* GrBatchTextStrike::generateGlyph(const SkGlyph& skGlyph, GrGlyph::Packe dID packed,
174 GrFontScaler* scaler) { 174 GrFontScaler* scaler) {
175 SkIRect bounds; 175 SkIRect bounds;
176 if (GrGlyph::kDistance_MaskStyle == GrGlyph::UnpackMaskStyle(packed)) { 176 if (GrGlyph::kDistance_MaskStyle == GrGlyph::UnpackMaskStyle(packed)) {
177 if (!scaler->getPackedGlyphDFBounds(skGlyph, &bounds)) { 177 if (!scaler->getPackedGlyphDFBounds(skGlyph, &bounds)) {
178 return nullptr; 178 return nullptr;
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 233
234 bool success = fBatchFontCache->addToAtlas(this, &glyph->fID, target, expect edMaskFormat, 234 bool success = fBatchFontCache->addToAtlas(this, &glyph->fID, target, expect edMaskFormat,
235 glyph->width(), glyph->height(), 235 glyph->width(), glyph->height(),
236 storage.get(), &glyph->fAtlasLoca tion); 236 storage.get(), &glyph->fAtlasLoca tion);
237 if (success) { 237 if (success) {
238 SkASSERT(GrBatchAtlas::kInvalidAtlasID != glyph->fID); 238 SkASSERT(GrBatchAtlas::kInvalidAtlasID != glyph->fID);
239 fAtlasedGlyphs++; 239 fAtlasedGlyphs++;
240 } 240 }
241 return success; 241 return success;
242 } 242 }
OLDNEW
« no previous file with comments | « src/gpu/GrLayerCache.cpp ('k') | src/images/SkImageDecoder_libwebp.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698