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

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

Issue 1161993003: Removing GrAutoMalloc (Closed) Base URL: https://skia.googlesource.com/skia.git@morecleanup
Patch Set: Created 5 years, 6 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 | « include/gpu/GrTypes.h ('k') | src/gpu/gl/GrGLGpu.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 "GrFontAtlasSizes.h" 9 #include "GrFontAtlasSizes.h"
10 #include "GrGpu.h" 10 #include "GrGpu.h"
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 SkASSERT(glyph); 210 SkASSERT(glyph);
211 SkASSERT(scaler); 211 SkASSERT(scaler);
212 SkASSERT(fCache.find(glyph->fPackedID)); 212 SkASSERT(fCache.find(glyph->fPackedID));
213 SkASSERT(NULL == glyph->fPlot); 213 SkASSERT(NULL == glyph->fPlot);
214 214
215 SkAutoUnref ar(SkSafeRef(scaler)); 215 SkAutoUnref ar(SkSafeRef(scaler));
216 216
217 int bytesPerPixel = GrMaskFormatBytesPerPixel(glyph->fMaskFormat); 217 int bytesPerPixel = GrMaskFormatBytesPerPixel(glyph->fMaskFormat);
218 218
219 size_t size = glyph->fBounds.area() * bytesPerPixel; 219 size_t size = glyph->fBounds.area() * bytesPerPixel;
220 GrAutoMalloc<1024> storage(size); 220 SkAutoSMalloc<1024> storage(size);
221 221
222 if (GrGlyph::kDistance_MaskStyle == GrGlyph::UnpackMaskStyle(glyph->fPackedI D)) { 222 if (GrGlyph::kDistance_MaskStyle == GrGlyph::UnpackMaskStyle(glyph->fPackedI D)) {
223 if (!scaler->getPackedGlyphDFImage(glyph->fPackedID, glyph->width(), 223 if (!scaler->getPackedGlyphDFImage(glyph->fPackedID, glyph->width(),
224 glyph->height(), 224 glyph->height(),
225 storage.get())) { 225 storage.get())) {
226 return false; 226 return false;
227 } 227 }
228 } else { 228 } else {
229 if (!scaler->getPackedGlyphImage(glyph->fPackedID, glyph->width(), 229 if (!scaler->getPackedGlyphImage(glyph->fPackedID, glyph->width(),
230 glyph->height(), 230 glyph->height(),
231 glyph->width() * bytesPerPixel, 231 glyph->width() * bytesPerPixel,
232 storage.get())) { 232 storage.get())) {
233 return false; 233 return false;
234 } 234 }
235 } 235 }
236 236
237 bool success = fBatchFontCache->addToAtlas(this, &glyph->fID, batchTarget, g lyph->fMaskFormat, 237 bool success = fBatchFontCache->addToAtlas(this, &glyph->fID, batchTarget, g lyph->fMaskFormat,
238 glyph->width(), glyph->height(), 238 glyph->width(), glyph->height(),
239 storage.get(), &glyph->fAtlasLoca tion); 239 storage.get(), &glyph->fAtlasLoca tion);
240 if (success) { 240 if (success) {
241 fAtlasedGlyphs++; 241 fAtlasedGlyphs++;
242 } 242 }
243 return success; 243 return success;
244 } 244 }
OLDNEW
« no previous file with comments | « include/gpu/GrTypes.h ('k') | src/gpu/gl/GrGLGpu.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698