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

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

Issue 286803002: Allow GrFontCache::dump() in all builds (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 7 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/GrTextStrike.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 "GrAtlas.h" 8 #include "GrAtlas.h"
9 #include "GrGpu.h" 9 #include "GrGpu.h"
10 #include "GrRectanizer.h" 10 #include "GrRectanizer.h"
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 count2 = 0; 180 count2 = 0;
181 strike = fTail; 181 strike = fTail;
182 while (strike) { 182 while (strike) {
183 count2 += 1; 183 count2 += 1;
184 strike = strike->fPrev; 184 strike = strike->fPrev;
185 } 185 }
186 SkASSERT(count == count2); 186 SkASSERT(count == count2);
187 } 187 }
188 #endif 188 #endif
189 189
190 #ifdef SK_DEVELOPER
191 void GrFontCache::dump() const { 190 void GrFontCache::dump() const {
192 static int gDumpCount = 0; 191 static int gDumpCount = 0;
193 for (int i = 0; i < kAtlasCount; ++i) { 192 for (int i = 0; i < kAtlasCount; ++i) {
194 if (NULL != fAtlasMgr[i]) { 193 if (NULL != fAtlasMgr[i]) {
195 GrTexture* texture = fAtlasMgr[i]->getTexture(); 194 GrTexture* texture = fAtlasMgr[i]->getTexture();
196 if (NULL != texture) { 195 if (NULL != texture) {
197 SkString filename; 196 SkString filename;
198 #ifdef SK_BUILD_FOR_ANDROID 197 #ifdef SK_BUILD_FOR_ANDROID
199 filename.printf("/sdcard/fontcache_%d%d.png", gDumpCount, i); 198 filename.printf("/sdcard/fontcache_%d%d.png", gDumpCount, i);
200 #else 199 #else
201 filename.printf("fontcache_%d%d.png", gDumpCount, i); 200 filename.printf("fontcache_%d%d.png", gDumpCount, i);
202 #endif 201 #endif
203 texture->savePixels(filename.c_str()); 202 texture->savePixels(filename.c_str());
204 } 203 }
205 } 204 }
206 } 205 }
207 ++gDumpCount; 206 ++gDumpCount;
208 } 207 }
209 #endif
210 208
211 /////////////////////////////////////////////////////////////////////////////// 209 ///////////////////////////////////////////////////////////////////////////////
212 210
213 #ifdef SK_DEBUG 211 #ifdef SK_DEBUG
214 static int gCounter; 212 static int gCounter;
215 #endif 213 #endif
216 214
217 /* 215 /*
218 The text strike is specific to a given font/style/matrix setup, which is 216 The text strike is specific to a given font/style/matrix setup, which is
219 represented by the GrHostFontScaler object we are given in getGlyph(). 217 represented by the GrHostFontScaler object we are given in getGlyph().
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 glyph->height(), storage.get(), 318 glyph->height(), storage.get(),
321 &glyph->fAtlasLocation); 319 &glyph->fAtlasLocation);
322 320
323 if (NULL == plot) { 321 if (NULL == plot) {
324 return false; 322 return false;
325 } 323 }
326 324
327 glyph->fPlot = plot; 325 glyph->fPlot = plot;
328 return true; 326 return true;
329 } 327 }
OLDNEW
« no previous file with comments | « src/gpu/GrTextStrike.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698