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

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

Issue 1339093002: Have SkVarAlloc::alloc() use sk_malloc_throw. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: no, always throw Created 5 years, 3 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/core/SkVarAlloc.cpp ('k') | tests/VarAllocTest.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 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 if (!scaler->getPackedGlyphDFBounds(skGlyph, &bounds)) { 171 if (!scaler->getPackedGlyphDFBounds(skGlyph, &bounds)) {
172 return nullptr; 172 return nullptr;
173 } 173 }
174 } else { 174 } else {
175 if (!scaler->getPackedGlyphBounds(skGlyph, &bounds)) { 175 if (!scaler->getPackedGlyphBounds(skGlyph, &bounds)) {
176 return nullptr; 176 return nullptr;
177 } 177 }
178 } 178 }
179 GrMaskFormat format = scaler->getPackedGlyphMaskFormat(skGlyph); 179 GrMaskFormat format = scaler->getPackedGlyphMaskFormat(skGlyph);
180 180
181 GrGlyph* glyph = (GrGlyph*)fPool.alloc(sizeof(GrGlyph), SK_MALLOC_THROW); 181 GrGlyph* glyph = (GrGlyph*)fPool.alloc(sizeof(GrGlyph));
182 glyph->init(packed, bounds, format); 182 glyph->init(packed, bounds, format);
183 fCache.add(glyph); 183 fCache.add(glyph);
184 return glyph; 184 return glyph;
185 } 185 }
186 186
187 void GrBatchTextStrike::removeID(GrBatchAtlas::AtlasID id) { 187 void GrBatchTextStrike::removeID(GrBatchAtlas::AtlasID id) {
188 SkTDynamicHash<GrGlyph, GrGlyph::PackedID>::Iter iter(&fCache); 188 SkTDynamicHash<GrGlyph, GrGlyph::PackedID>::Iter iter(&fCache);
189 while (!iter.done()) { 189 while (!iter.done()) {
190 if (id == (*iter).fID) { 190 if (id == (*iter).fID) {
191 (*iter).fID = GrBatchAtlas::kInvalidAtlasID; 191 (*iter).fID = GrBatchAtlas::kInvalidAtlasID;
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 225
226 bool success = fBatchFontCache->addToAtlas(this, &glyph->fID, target, expect edMaskFormat, 226 bool success = fBatchFontCache->addToAtlas(this, &glyph->fID, target, expect edMaskFormat,
227 glyph->width(), glyph->height(), 227 glyph->width(), glyph->height(),
228 storage.get(), &glyph->fAtlasLoca tion); 228 storage.get(), &glyph->fAtlasLoca tion);
229 if (success) { 229 if (success) {
230 SkASSERT(GrBatchAtlas::kInvalidAtlasID != glyph->fID); 230 SkASSERT(GrBatchAtlas::kInvalidAtlasID != glyph->fID);
231 fAtlasedGlyphs++; 231 fAtlasedGlyphs++;
232 } 232 }
233 return success; 233 return success;
234 } 234 }
OLDNEW
« no previous file with comments | « src/core/SkVarAlloc.cpp ('k') | tests/VarAllocTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698