| 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" | |
| 11 #include "GrTextStrike.h" | 10 #include "GrTextStrike.h" |
| 12 #include "GrTextStrike_impl.h" | 11 #include "GrTextStrike_impl.h" |
| 13 #include "SkString.h" | 12 #include "SkString.h" |
| 14 | 13 |
| 15 #include "SkDistanceFieldGen.h" | 14 #include "SkDistanceFieldGen.h" |
| 16 | 15 |
| 17 /////////////////////////////////////////////////////////////////////////////// | 16 /////////////////////////////////////////////////////////////////////////////// |
| 18 | 17 |
| 19 #define GR_ATLAS_TEXTURE_WIDTH 1024 | 18 #define GR_ATLAS_TEXTURE_WIDTH 1024 |
| 20 #define GR_ATLAS_TEXTURE_HEIGHT 2048 | 19 #define GR_ATLAS_TEXTURE_HEIGHT 2048 |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 for (int i = 0; i < kAtlasCount; ++i) { | 199 for (int i = 0; i < kAtlasCount; ++i) { |
| 201 if (fAtlases[i]) { | 200 if (fAtlases[i]) { |
| 202 GrTexture* texture = fAtlases[i]->getTexture(); | 201 GrTexture* texture = fAtlases[i]->getTexture(); |
| 203 if (texture) { | 202 if (texture) { |
| 204 SkString filename; | 203 SkString filename; |
| 205 #ifdef SK_BUILD_FOR_ANDROID | 204 #ifdef SK_BUILD_FOR_ANDROID |
| 206 filename.printf("/sdcard/fontcache_%d%d.png", gDumpCount, i); | 205 filename.printf("/sdcard/fontcache_%d%d.png", gDumpCount, i); |
| 207 #else | 206 #else |
| 208 filename.printf("fontcache_%d%d.png", gDumpCount, i); | 207 filename.printf("fontcache_%d%d.png", gDumpCount, i); |
| 209 #endif | 208 #endif |
| 210 texture->surfacePriv().savePixels(filename.c_str()); | 209 texture->savePixels(filename.c_str()); |
| 211 } | 210 } |
| 212 } | 211 } |
| 213 } | 212 } |
| 214 ++gDumpCount; | 213 ++gDumpCount; |
| 215 } | 214 } |
| 216 | 215 |
| 217 /////////////////////////////////////////////////////////////////////////////// | 216 /////////////////////////////////////////////////////////////////////////////// |
| 218 | 217 |
| 219 #ifdef SK_DEBUG | 218 #ifdef SK_DEBUG |
| 220 static int gCounter; | 219 static int gCounter; |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 341 glyph->height(), storage.get(), | 340 glyph->height(), storage.get(), |
| 342 &glyph->fAtlasLocation); | 341 &glyph->fAtlasLocation); |
| 343 | 342 |
| 344 if (NULL == plot) { | 343 if (NULL == plot) { |
| 345 return false; | 344 return false; |
| 346 } | 345 } |
| 347 | 346 |
| 348 glyph->fPlot = plot; | 347 glyph->fPlot = plot; |
| 349 return true; | 348 return true; |
| 350 } | 349 } |
| OLD | NEW |