Index: src/core/SkAAClip.cpp |
diff --git a/src/core/SkAAClip.cpp b/src/core/SkAAClip.cpp |
index 5d21a47a49470e6f2d85845021cbbed3b76b26bb..58a16f3affd7dd628a5fe602fc9372e12fa61dcd 100644 |
--- a/src/core/SkAAClip.cpp |
+++ b/src/core/SkAAClip.cpp |
@@ -219,6 +219,46 @@ void SkAAClip::validate() const { |
--yoff; |
SkASSERT(yoff->fY == lastY); |
} |
+ |
+static void dump_one_row(const uint8_t* SK_RESTRICT row, |
+ int width, int leading_num) { |
+ if (leading_num) { |
+ SkDebugf( "%03d ", leading_num ); |
+ } |
+ while (width > 0) { |
+ int n = row[0]; |
+ int val = row[1]; |
+ char out = '.'; |
+ if (val == 0xff) { |
+ out = '*'; |
+ } else if (val > 0) { |
+ out = '+'; |
+ } |
+ for (int i = 0 ; i < n ; i++) { |
+ SkDebugf( "%c", out ); |
+ } |
+ row += 2; |
+ width -= n; |
+ } |
+ SkDebugf( "\n" ); |
+} |
+ |
+void SkAAClip::debug(bool compress_y) const { |
+ Iter iter(*this); |
+ const int width = fBounds.width(); |
+ |
+ int y = fBounds.fTop; |
+ while (!iter.done()) { |
+ if (compress_y) { |
+ dump_one_row(iter.data(), width, iter.bottom() - iter.top() + 1); |
+ } else { |
+ do { |
+ dump_one_row(iter.data(), width, 0); |
+ } while (++y < iter.bottom()); |
+ } |
+ iter.next(); |
+ } |
+} |
#endif |
/////////////////////////////////////////////////////////////////////////////// |