aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/SkPaint.cpp9
-rw-r--r--src/effects/SkColorFilters.cpp55
-rw-r--r--src/effects/SkColorMatrixFilter.cpp15
-rw-r--r--src/effects/SkTableColorFilter.cpp9
4 files changed, 84 insertions, 4 deletions
diff --git a/src/core/SkPaint.cpp b/src/core/SkPaint.cpp
index 193568effb..c7cbce18c7 100644
--- a/src/core/SkPaint.cpp
+++ b/src/core/SkPaint.cpp
@@ -2308,27 +2308,28 @@ void SkPaint::toString(SkString* str) const {
SkShader* shader = this->getShader();
if (NULL != shader) {
str->append("<dt>Shader:</dt><dd>");
- SkDEVCODE(shader->toString(str);)
+ shader->toString(str);
str->append("</dd>");
}
SkXfermode* xfer = this->getXfermode();
if (NULL != xfer) {
str->append("<dt>Xfermode:</dt><dd>");
- SkDEVCODE(xfer->toString(str);)
+ xfer->toString(str);
str->append("</dd>");
}
SkMaskFilter* maskFilter = this->getMaskFilter();
if (NULL != maskFilter) {
str->append("<dt>MaskFilter:</dt><dd>");
- SkDEVCODE(maskFilter->toString(str);)
+ maskFilter->toString(str);
str->append("</dd>");
}
SkColorFilter* colorFilter = this->getColorFilter();
if (NULL != colorFilter) {
str->append("<dt>ColorFilter:</dt><dd>");
+ colorFilter->toString(str);
str->append("</dd>");
}
@@ -2341,7 +2342,7 @@ void SkPaint::toString(SkString* str) const {
SkDrawLooper* looper = this->getLooper();
if (NULL != looper) {
str->append("<dt>DrawLooper:</dt><dd>");
- SkDEVCODE(looper->toString(str);)
+ looper->toString(str);
str->append("</dd>");
}
diff --git a/src/effects/SkColorFilters.cpp b/src/effects/SkColorFilters.cpp
index a14babc7cd..41a201ef39 100644
--- a/src/effects/SkColorFilters.cpp
+++ b/src/effects/SkColorFilters.cpp
@@ -12,6 +12,7 @@
#include "SkColorPriv.h"
#include "SkFlattenableBuffers.h"
#include "SkUtils.h"
+#include "SkString.h"
#define ILLEGAL_XFERMODE_MODE ((SkXfermode::Mode)-1)
@@ -75,6 +76,15 @@ public:
}
}
+#ifdef SK_DEVELOPER
+ virtual void toString(SkString* str) const SK_OVERRIDE {
+ str->append("SkModeColorFilter: color: 0x");
+ str->appendHex(fColor);
+ str->append(" mode: ");
+ str->append(SkXfermode::ModeName(fMode));
+ }
+#endif
+
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkModeColorFilter)
protected:
@@ -260,6 +270,15 @@ public:
}
}
+#ifdef SK_DEVELOPER
+ virtual void toString(SkString* str) const SK_OVERRIDE {
+ str->append("SkLightingColorFilter: mul: 0x");
+ str->appendHex(fMul);
+ str->append(" add: 0x");
+ str->appendHex(fAdd);
+ }
+#endif
+
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkLightingColorFilter)
protected:
@@ -305,6 +324,13 @@ public:
}
}
+#ifdef SK_DEVELOPER
+ virtual void toString(SkString* str) const SK_OVERRIDE {
+ str->append("SkLightingColorFilter_JustAdd: add: 0x");
+ str->appendHex(fAdd);
+ }
+#endif
+
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkLightingColorFilter_JustAdd)
protected:
@@ -339,6 +365,13 @@ public:
}
}
+#ifdef SK_DEVELOPER
+ virtual void toString(SkString* str) const SK_OVERRIDE {
+ str->append("SkLightingColorFilter_JustMul: mul: 0x");
+ str->appendHex(fMul);
+ }
+#endif
+
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkLightingColorFilter_JustMul)
protected:
@@ -376,6 +409,13 @@ public:
}
}
+#ifdef SK_DEVELOPER
+ virtual void toString(SkString* str) const SK_OVERRIDE {
+ str->append("SkLightingColorFilter_SingleMul: mul: 0x");
+ str->appendHex(fMul);
+ }
+#endif
+
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkLightingColorFilter_SingleMul)
protected:
@@ -415,6 +455,15 @@ public:
}
}
+#ifdef SK_DEVELOPER
+ virtual void toString(SkString* str) const SK_OVERRIDE {
+ str->append("SkLightingColorFilter_NoPin: mul: 0x");
+ str->appendHex(fMul);
+ str->append(" add: 0x");
+ str->appendHex(fAdd);
+ }
+#endif
+
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkLightingColorFilter_NoPin)
protected:
@@ -433,6 +482,12 @@ public:
return SkNEW(SkSimpleColorFilter);
}
+#ifdef SK_DEVELOPER
+ virtual void toString(SkString* str) const SK_OVERRIDE {
+ str->append("SkSimpleColorFilter");
+ }
+#endif
+
protected:
void filterSpan(const SkPMColor src[], int count, SkPMColor
result[]) const SK_OVERRIDE {
diff --git a/src/effects/SkColorMatrixFilter.cpp b/src/effects/SkColorMatrixFilter.cpp
index 661544bf29..638c3536d4 100644
--- a/src/effects/SkColorMatrixFilter.cpp
+++ b/src/effects/SkColorMatrixFilter.cpp
@@ -477,3 +477,18 @@ GrEffectRef* SkColorMatrixFilter::asNewEffect(GrContext*) const {
}
#endif
+
+#ifdef SK_DEVELOPER
+void SkColorMatrixFilter::toString(SkString* str) const {
+ str->append("SkColorMatrixFilter: ");
+
+ str->append("matrix: (");
+ for (int i = 0; i < 20; ++i) {
+ str->appendScalar(fMatrix.fMat[i]);
+ if (i < 19) {
+ str->append(", ");
+ }
+ }
+ str->append(")");
+}
+#endif
diff --git a/src/effects/SkTableColorFilter.cpp b/src/effects/SkTableColorFilter.cpp
index 9979fae27b..2c452ff9f7 100644
--- a/src/effects/SkTableColorFilter.cpp
+++ b/src/effects/SkTableColorFilter.cpp
@@ -4,6 +4,7 @@
#include "SkColorPriv.h"
#include "SkFlattenableBuffers.h"
#include "SkUnPreMultiply.h"
+#include "SkString.h"
class SkTable_ColorFilter : public SkColorFilter {
public:
@@ -47,6 +48,8 @@ public:
virtual void filterSpan(const SkPMColor src[], int count,
SkPMColor dst[]) const SK_OVERRIDE;
+ SkDEVCODE(virtual void toString(SkString* str) const SK_OVERRIDE;)
+
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkTable_ColorFilter)
enum {
@@ -148,6 +151,12 @@ void SkTable_ColorFilter::filterSpan(const SkPMColor src[], int count,
}
}
+#ifdef SK_DEVELOPER
+void SkTable_ColorFilter::toString(SkString* str) const {
+ str->append("SkTable_ColorFilter");
+}
+#endif
+
static const uint8_t gCountNibBits[] = {
0, 1, 1, 2,
1, 2, 2, 3,