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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/GrTextStrike.h ('k') | tools/render_pictures_main.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrTextStrike.cpp
diff --git a/src/gpu/GrTextStrike.cpp b/src/gpu/GrTextStrike.cpp
index e399c91f6c5b9bdfc5416f0585628eb073894870..7cab335d725abcbd7f78d4a1b1c531344c9eba73 100644
--- a/src/gpu/GrTextStrike.cpp
+++ b/src/gpu/GrTextStrike.cpp
@@ -10,6 +10,7 @@
#include "GrRectanizer.h"
#include "GrTextStrike.h"
#include "GrTextStrike_impl.h"
+#include "SkString.h"
SK_DEFINE_INST_COUNT(GrFontScaler)
SK_DEFINE_INST_COUNT(GrKey)
@@ -170,6 +171,23 @@ void GrFontCache::validate() const {
}
#endif
+#ifdef SK_DEVELOPER
+void GrFontCache::dump() const {
+ static int gDumpCount = 0;
+ for (int i = 0; i < kMaskFormatCount; ++i) {
+ if (NULL != fAtlasMgr[i]) {
+ GrTexture* texture = fAtlasMgr[i]->getTexture();
+ if (NULL != texture) {
+ SkString filename;
+ filename.printf("fontcache_%d%d.png", gDumpCount, i);
+ texture->savePixels(filename.c_str());
+ }
+ }
+ }
+ ++gDumpCount;
+}
+#endif
+
///////////////////////////////////////////////////////////////////////////////
#ifdef SK_DEBUG
« 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