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

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

Issue 393953004: SkAutoRef seems lonely. Might as well delete it. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: simpler Created 6 years, 5 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/core/SkRefCnt.h ('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 2010 Google Inc. 2 * Copyright 2010 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 "GrGpu.h" 8 #include "GrGpu.h"
9 #include "GrRectanizer.h" 9 #include "GrRectanizer.h"
10 #include "GrTextStrike.h" 10 #include "GrTextStrike.h"
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 #if 0 // testing hack to force us to flush our cache often 286 #if 0 // testing hack to force us to flush our cache often
287 static int gCounter; 287 static int gCounter;
288 if ((++gCounter % 10) == 0) return false; 288 if ((++gCounter % 10) == 0) return false;
289 #endif 289 #endif
290 290
291 SkASSERT(glyph); 291 SkASSERT(glyph);
292 SkASSERT(scaler); 292 SkASSERT(scaler);
293 SkASSERT(fCache.contains(glyph)); 293 SkASSERT(fCache.contains(glyph));
294 SkASSERT(NULL == glyph->fPlot); 294 SkASSERT(NULL == glyph->fPlot);
295 295
296 SkAutoRef ar(scaler); 296 SkAutoUnref ar(SkSafeRef(scaler));
297 297
298 int bytesPerPixel = GrMaskFormatBytesPerPixel(fMaskFormat); 298 int bytesPerPixel = GrMaskFormatBytesPerPixel(fMaskFormat);
299 299
300 size_t size = glyph->fBounds.area() * bytesPerPixel; 300 size_t size = glyph->fBounds.area() * bytesPerPixel;
301 SkAutoSMalloc<1024> storage(size); 301 SkAutoSMalloc<1024> storage(size);
302 if (fUseDistanceField) { 302 if (fUseDistanceField) {
303 if (!scaler->getPackedGlyphDFImage(glyph->fPackedID, glyph->width(), 303 if (!scaler->getPackedGlyphDFImage(glyph->fPackedID, glyph->width(),
304 glyph->height(), 304 glyph->height(),
305 storage.get())) { 305 storage.get())) {
306 return false; 306 return false;
(...skipping 11 matching lines...) Expand all
318 glyph->height(), storage.get(), 318 glyph->height(), storage.get(),
319 &glyph->fAtlasLocation); 319 &glyph->fAtlasLocation);
320 320
321 if (NULL == plot) { 321 if (NULL == plot) {
322 return false; 322 return false;
323 } 323 }
324 324
325 glyph->fPlot = plot; 325 glyph->fPlot = plot;
326 return true; 326 return true;
327 } 327 }
OLDNEW
« no previous file with comments | « include/core/SkRefCnt.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698