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

Unified Diff: src/effects/SkTableColorFilter.cpp

Issue 789163006: Add toString methods to SkImageFilter-derived classes (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Make sure leading 0's aren't stripped off colors Created 6 years 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/effects/SkRectShaderImageFilter.cpp ('k') | src/effects/SkTestImageFilters.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « src/effects/SkRectShaderImageFilter.cpp ('k') | src/effects/SkTestImageFilters.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698