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

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

Issue 23904003: Remove GrRefCnt.h in favor of SkRefCnt.h (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: rm GrRefCnt.h Created 7 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 | Annotate | Revision Log
« no previous file with comments | « src/gpu/GrTextContext.cpp ('k') | src/gpu/SkGrFontScaler.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 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 "GrAtlas.h" 8 #include "GrAtlas.h"
9 #include "GrGpu.h" 9 #include "GrGpu.h"
10 #include "GrRectanizer.h" 10 #include "GrRectanizer.h"
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 #endif 224 #endif
225 225
226 SkASSERT(glyph); 226 SkASSERT(glyph);
227 SkASSERT(scaler); 227 SkASSERT(scaler);
228 SkASSERT(fCache.contains(glyph)); 228 SkASSERT(fCache.contains(glyph));
229 if (glyph->fAtlas) { 229 if (glyph->fAtlas) {
230 glyph->fAtlas->setDrawToken(currentDrawToken); 230 glyph->fAtlas->setDrawToken(currentDrawToken);
231 return true; 231 return true;
232 } 232 }
233 233
234 GrAutoRef ar(scaler); 234 SkAutoRef ar(scaler);
235 235
236 int bytesPerPixel = GrMaskFormatBytesPerPixel(fMaskFormat); 236 int bytesPerPixel = GrMaskFormatBytesPerPixel(fMaskFormat);
237 size_t size = glyph->fBounds.area() * bytesPerPixel; 237 size_t size = glyph->fBounds.area() * bytesPerPixel;
238 SkAutoSMalloc<1024> storage(size); 238 SkAutoSMalloc<1024> storage(size);
239 if (!scaler->getPackedGlyphImage(glyph->fPackedID, glyph->width(), 239 if (!scaler->getPackedGlyphImage(glyph->fPackedID, glyph->width(),
240 glyph->height(), 240 glyph->height(),
241 glyph->width() * bytesPerPixel, 241 glyph->width() * bytesPerPixel,
242 storage.get())) { 242 storage.get())) {
243 return false; 243 return false;
244 } 244 }
245 245
246 GrAtlas* atlas = fAtlasMgr->addToAtlas(&fAtlas, glyph->width(), 246 GrAtlas* atlas = fAtlasMgr->addToAtlas(&fAtlas, glyph->width(),
247 glyph->height(), storage.get(), 247 glyph->height(), storage.get(),
248 fMaskFormat, 248 fMaskFormat,
249 &glyph->fAtlasLocation); 249 &glyph->fAtlasLocation);
250 if (NULL == atlas) { 250 if (NULL == atlas) {
251 return false; 251 return false;
252 } 252 }
253 253
254 glyph->fAtlas = atlas; 254 glyph->fAtlas = atlas;
255 atlas->setDrawToken(currentDrawToken); 255 atlas->setDrawToken(currentDrawToken);
256 return true; 256 return true;
257 } 257 }
OLDNEW
« no previous file with comments | « src/gpu/GrTextContext.cpp ('k') | src/gpu/SkGrFontScaler.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698