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

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: 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
Index: src/gpu/GrTextStrike.cpp
diff --git a/src/gpu/GrTextStrike.cpp b/src/gpu/GrTextStrike.cpp
index e399c91f6c5b9bdfc5416f0585628eb073894870..c55d8ab4b5f3b2a85bc6d449fc9c436c6fcfdf1c 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,21 @@ void GrFontCache::validate() const {
}
#endif
robertphillips 2013/10/02 15:07:28 SK_DEBUG? DEV?
+void GrFontCache::dump() const {
robertphillips 2013/10/02 15:07:28 I feel this needs some fancy naming: gDumpCount, s
+ static int dumpCount = 0;
+ for (int i = 0; i < kMaskFormatCount; ++i) {
robertphillips 2013/10/02 15:07:28 NULL !=
+ if (fAtlasMgr[i]) {
+ GrTexture* texture = fAtlasMgr[i]->getTexture();
robertphillips 2013/10/02 15:07:28 NULL !=
+ if (texture) {
+ SkString filename;
robertphillips 2013/10/02 15:07:28 Would it be more helpful to convert the mask forma
+ filename.printf("fontcache_%d%d.png", dumpCount, i);
+ texture->savePixels(filename.c_str());
+ }
+ }
+ }
+ ++dumpCount;
+}
+
///////////////////////////////////////////////////////////////////////////////
#ifdef SK_DEBUG

Powered by Google App Engine
This is Rietveld 408576698