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

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

Issue 25736002: Add support to dump font cache texture for debug purposes (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Add stencil flag Created 7 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 | Annotate | Revision Log
« no previous file with comments | « src/gpu/GrTextStrike.h ('k') | tools/render_pictures_main.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"
11 #include "GrTextStrike.h" 11 #include "GrTextStrike.h"
12 #include "GrTextStrike_impl.h" 12 #include "GrTextStrike_impl.h"
13 #include "SkString.h"
13 14
14 SK_DEFINE_INST_COUNT(GrFontScaler) 15 SK_DEFINE_INST_COUNT(GrFontScaler)
15 SK_DEFINE_INST_COUNT(GrKey) 16 SK_DEFINE_INST_COUNT(GrKey)
16 17
17 /////////////////////////////////////////////////////////////////////////////// 18 ///////////////////////////////////////////////////////////////////////////////
18 19
19 #define FONT_CACHE_STATS 0 20 #define FONT_CACHE_STATS 0
20 #if FONT_CACHE_STATS 21 #if FONT_CACHE_STATS
21 static int g_PurgeCount = 0; 22 static int g_PurgeCount = 0;
22 #endif 23 #endif
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 count2 = 0; 164 count2 = 0;
164 strike = fTail; 165 strike = fTail;
165 while (strike) { 166 while (strike) {
166 count2 += 1; 167 count2 += 1;
167 strike = strike->fPrev; 168 strike = strike->fPrev;
168 } 169 }
169 SkASSERT(count == count2); 170 SkASSERT(count == count2);
170 } 171 }
171 #endif 172 #endif
172 173
174 #ifdef SK_DEVELOPER
175 void GrFontCache::dump() const {
176 static int gDumpCount = 0;
177 for (int i = 0; i < kMaskFormatCount; ++i) {
178 if (NULL != fAtlasMgr[i]) {
179 GrTexture* texture = fAtlasMgr[i]->getTexture();
180 if (NULL != texture) {
181 SkString filename;
182 filename.printf("fontcache_%d%d.png", gDumpCount, i);
183 texture->savePixels(filename.c_str());
184 }
185 }
186 }
187 ++gDumpCount;
188 }
189 #endif
190
173 /////////////////////////////////////////////////////////////////////////////// 191 ///////////////////////////////////////////////////////////////////////////////
174 192
175 #ifdef SK_DEBUG 193 #ifdef SK_DEBUG
176 static int gCounter; 194 static int gCounter;
177 #endif 195 #endif
178 196
179 /* 197 /*
180 The text strike is specific to a given font/style/matrix setup, which is 198 The text strike is specific to a given font/style/matrix setup, which is
181 represented by the GrHostFontScaler object we are given in getGlyph(). 199 represented by the GrHostFontScaler object we are given in getGlyph().
182 200
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 glyph->height(), storage.get(), 288 glyph->height(), storage.get(),
271 &glyph->fAtlasLocation); 289 &glyph->fAtlasLocation);
272 if (NULL == plot) { 290 if (NULL == plot) {
273 return false; 291 return false;
274 } 292 }
275 293
276 glyph->fPlot = plot; 294 glyph->fPlot = plot;
277 plot->setDrawToken(currentDrawToken); 295 plot->setDrawToken(currentDrawToken);
278 return true; 296 return true;
279 } 297 }
OLDNEW
« no previous file with comments | « src/gpu/GrTextStrike.h ('k') | tools/render_pictures_main.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698