| OLD | NEW |
| 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 "GrSurfacePriv.h" | 10 #include "GrSurfacePriv.h" |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 } | 194 } |
| 195 SkASSERT(count == count2); | 195 SkASSERT(count == count2); |
| 196 } | 196 } |
| 197 #endif | 197 #endif |
| 198 | 198 |
| 199 void GrFontCache::dump() const { | 199 void GrFontCache::dump() const { |
| 200 static int gDumpCount = 0; | 200 static int gDumpCount = 0; |
| 201 for (int i = 0; i < kAtlasCount; ++i) { | 201 for (int i = 0; i < kAtlasCount; ++i) { |
| 202 if (fAtlases[i]) { | 202 if (fAtlases[i]) { |
| 203 GrTexture* texture = fAtlases[i]->getTexture(); | 203 GrTexture* texture = fAtlases[i]->getTexture(); |
| 204 #if SK_DEVELOPER |
| 204 if (texture) { | 205 if (texture) { |
| 205 SkString filename; | 206 SkString filename; |
| 206 #ifdef SK_BUILD_FOR_ANDROID | 207 #ifdef SK_BUILD_FOR_ANDROID |
| 207 filename.printf("/sdcard/fontcache_%d%d.png", gDumpCount, i); | 208 filename.printf("/sdcard/fontcache_%d%d.png", gDumpCount, i); |
| 208 #else | 209 #else |
| 209 filename.printf("fontcache_%d%d.png", gDumpCount, i); | 210 filename.printf("fontcache_%d%d.png", gDumpCount, i); |
| 210 #endif | 211 #endif |
| 211 texture->surfacePriv().savePixels(filename.c_str()); | 212 SkSaveGrSurfacePixelsAsPNG(texture, filename.c_str()); |
| 212 } | 213 } |
| 214 #endif |
| 213 } | 215 } |
| 214 } | 216 } |
| 215 ++gDumpCount; | 217 ++gDumpCount; |
| 216 } | 218 } |
| 217 | 219 |
| 218 /////////////////////////////////////////////////////////////////////////////// | 220 /////////////////////////////////////////////////////////////////////////////// |
| 219 | 221 |
| 220 #ifdef SK_DEBUG | 222 #ifdef SK_DEBUG |
| 221 static int gCounter; | 223 static int gCounter; |
| 222 #endif | 224 #endif |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 338 glyph->width(), glyph->height(), | 340 glyph->width(), glyph->height(), |
| 339 storage.get(), &glyph->fAtlasLocation)
; | 341 storage.get(), &glyph->fAtlasLocation)
; |
| 340 | 342 |
| 341 if (NULL == plot) { | 343 if (NULL == plot) { |
| 342 return false; | 344 return false; |
| 343 } | 345 } |
| 344 | 346 |
| 345 glyph->fPlot = plot; | 347 glyph->fPlot = plot; |
| 346 return true; | 348 return true; |
| 347 } | 349 } |
| OLD | NEW |