Index: src/effects/SkTableColorFilter.cpp |
diff --git a/src/effects/SkTableColorFilter.cpp b/src/effects/SkTableColorFilter.cpp |
index 942bae7d06361d2b136cda1bcff482eab71dcc22..e12b3d78ec2d0ed0e2f6d0ea90da9ebd322a78bc 100644 |
--- a/src/effects/SkTableColorFilter.cpp |
+++ b/src/effects/SkTableColorFilter.cpp |
@@ -155,7 +155,32 @@ void SkTable_ColorFilter::filterSpan(const SkPMColor src[], int count, |
#ifndef SK_IGNORE_TO_STRING |
void SkTable_ColorFilter::toString(SkString* str) const { |
- str->append("SkTable_ColorFilter"); |
+ const uint8_t* table = fStorage; |
+ const uint8_t* tableA = gIdentityTable; |
+ const uint8_t* tableR = gIdentityTable; |
+ const uint8_t* tableG = gIdentityTable; |
+ const uint8_t* tableB = gIdentityTable; |
+ if (fFlags & kA_Flag) { |
+ tableA = table; table += 256; |
+ } |
+ if (fFlags & kR_Flag) { |
+ tableR = table; table += 256; |
+ } |
+ if (fFlags & kG_Flag) { |
+ tableG = table; table += 256; |
+ } |
+ if (fFlags & kB_Flag) { |
+ tableB = table; |
+ } |
+ |
+ str->append("SkTable_ColorFilter ("); |
+ |
+ for (int i = 0; i < 256; ++i) { |
+ str->appendf("%d: %d,%d,%d,%d\n", |
+ i, tableR[i], tableG[i], tableB[i], tableA[i]); |
+ } |
+ |
+ str->append(")"); |
} |
#endif |