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

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

Issue 665913002: Move code to dump GrSurface as a png to helper files (Closed) Base URL: https://skia.googlesource.com/skia.git@separate-image-encoder-01-skimage
Patch Set: address review comments Created 6 years, 2 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 | « src/gpu/GrSurfacePriv.h ('k') | src/ports/SkImagesSupport_default.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 "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
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
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 }
OLDNEW
« no previous file with comments | « src/gpu/GrSurfacePriv.h ('k') | src/ports/SkImagesSupport_default.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698