*/
virtual void computeFastBounds(const SkRect& src, SkRect* dest) const;
+ SkDEVCODE(virtual void toString(SkString* str) const = 0;)
+
protected:
// empty for now, but lets get our subclass to remember to init us for the future
SkMaskFilter(SkFlattenableReadBuffer& buffer) : INHERITED(buffer) {}
virtual bool filterMask(SkMask* dst, const SkMask& src, const SkMatrix&,
SkIPoint* margin) const SK_OVERRIDE;
+ SkDEVCODE(virtual void toString(SkString* str) const SK_OVERRIDE;)
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkEmbossMaskFilter)
protected:
virtual bool filterMask(SkMask*, const SkMask&, const SkMatrix&,
SkIPoint*) const SK_OVERRIDE;
+ SkDEVCODE(virtual void toString(SkString* str) const SK_OVERRIDE;)
+
protected:
SkKernel33ProcMaskFilter(SkFlattenableReadBuffer& rb);
virtual void flatten(SkFlattenableWriteBuffer&) const SK_OVERRIDE;
// override from SkKernel33ProcMaskFilter
virtual uint8_t computeValue(uint8_t* const* srcRows) const SK_OVERRIDE;
+ SkDEVCODE(virtual void toString(SkString* str) const SK_OVERRIDE;)
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkKernel33MaskFilter)
private:
return SkMask::kA8_Format;
}
+ SkDEVCODE(virtual void toString(SkString* str) const SK_OVERRIDE;)
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkStippleMaskFilter);
protected:
virtual bool filterMask(SkMask*, const SkMask&, const SkMatrix&,
SkIPoint*) const SK_OVERRIDE;
+ SkDEVCODE(virtual void toString(SkString* str) const SK_OVERRIDE;)
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkTableMaskFilter)
protected:
// if (c < min) c = min;
return c;
}
+
+#ifdef SK_DEVELOPER
+ virtual void toString(SkString* str) const SK_OVERRIDE {
+ str->append("ReduceNoise: (");
+ this->INHERITED::toString(str);
+ str->append(")");
+ }
+#endif
+
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(ReduceNoise)
private:
ReduceNoise(SkFlattenableReadBuffer& rb) : SkKernel33ProcMaskFilter(rb) {}
+
+ typedef SkKernel33ProcMaskFilter INHERITED;
};
class Darken : public SkKernel33ProcMaskFilter {
SkASSERT(f >= 0 && f <= 1);
return (int)(f * 255);
}
+
+#ifdef SK_DEVELOPER
+ virtual void toString(SkString* str) const SK_OVERRIDE {
+ str->append("Darken: (");
+ this->INHERITED::toString(str);
+ str->append(")");
+ }
+#endif
+
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(Darken)
private:
Darken(SkFlattenableReadBuffer& rb) : SkKernel33ProcMaskFilter(rb) {}
+
+ typedef SkKernel33ProcMaskFilter INHERITED;
};
static SkMaskFilter* makemf() { return new Darken(0x30); }
SkMaskFilter* maskFilter = this->getMaskFilter();
if (NULL != maskFilter) {
str->append("<dt>MaskFilter:</dt><dd>");
+ SkDEVCODE(maskFilter->toString(str);)
str->append("</dd>");
}
#include "SkBounder.h"
#include "SkRasterClip.h"
#include "SkRTConf.h"
+#include "SkStringUtils.h"
class SkBlurMaskFilterImpl : public SkMaskFilter {
public:
virtual BlurType asABlur(BlurInfo*) const SK_OVERRIDE;
virtual void computeFastBounds(const SkRect&, SkRect*) const SK_OVERRIDE;
+ SkDEVCODE(virtual void toString(SkString* str) const SK_OVERRIDE;)
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkBlurMaskFilterImpl)
protected:
return gBlurStyle2BlurType[fBlurStyle];
}
+#ifdef SK_DEVELOPER
+void SkBlurMaskFilterImpl::toString(SkString* str) const {
+ str->append("SkBlurMaskFilterImpl: (");
+
+ str->append("radius: ");
+ str->appendScalar(fRadius);
+ str->append(" ");
+
+ static const char* gStyleName[SkBlurMaskFilter::kBlurStyleCount] = {
+ "normal", "solid", "outer", "inner"
+ };
+
+ str->appendf("style: %s ", gStyleName[fBlurStyle]);
+ str->append("flags: (");
+ if (fBlurFlags) {
+ bool needSeparator = false;
+ SkAddFlagToString(str,
+ SkToBool(fBlurFlags & SkBlurMaskFilter::kIgnoreTransform_BlurFlag),
+ "IgnoreXform", &needSeparator);
+ SkAddFlagToString(str,
+ SkToBool(fBlurFlags & SkBlurMaskFilter::kHighQuality_BlurFlag),
+ "HighQuality", &needSeparator);
+ } else {
+ str->append("None");
+ }
+ str->append("))");
+}
+#endif
+
SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkBlurMaskFilter)
SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBlurMaskFilterImpl)
SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END
#include "SkBlurMask.h"
#include "SkEmbossMask.h"
#include "SkFlattenableBuffers.h"
+#include "SkString.h"
static inline int pin2byte(int n) {
if (n < 0) {
buffer.writeByteArray(&tmpLight, sizeof(tmpLight));
buffer.writeScalar(fBlurRadius);
}
+
+#ifdef SK_DEVELOPER
+void SkEmbossMaskFilter::toString(SkString* str) const {
+ str->append("SkEmbossMaskFilter: (");
+
+ str->append("direction: (");
+ str->appendScalar(fLight.fDirection[0]);
+ str->append(", ");
+ str->appendScalar(fLight.fDirection[1]);
+ str->append(", ");
+ str->appendScalar(fLight.fDirection[2]);
+ str->append(") ");
+
+ str->appendf("ambient: %d specular: %d ",
+ fLight.fAmbient, fLight.fSpecular);
+
+ str->append("blurRadius: ");
+ str->appendScalar(fBlurRadius);
+ str->append(")");
+}
+#endif
#include "SkKernel33MaskFilter.h"
#include "SkColorPriv.h"
#include "SkFlattenableBuffers.h"
+#include "SkString.h"
SkMask::Format SkKernel33ProcMaskFilter::getFormat() const {
return SkMask::kA8_Format;
fPercent256 = rb.readInt();
}
+#ifdef SK_DEVELOPER
+void SkKernel33ProcMaskFilter::toString(SkString* str) const {
+ str->appendf("percent256: %d, ", fPercent256);
+}
+#endif
+
///////////////////////////////////////////////////////////////////////////////
uint8_t SkKernel33MaskFilter::computeValue(uint8_t* const* srcRows) const {
SkASSERT(9 == count);
fShift = rb.readInt();
}
+
+#ifdef SK_DEVELOPER
+void SkKernel33MaskFilter::toString(SkString* str) const {
+ str->append("SkKernel33MaskFilter: (");
+
+ str->appendf("kernel: (%d, %d, %d, %d, %d, %d, %d, %d, %d), ",
+ fKernel[0][0], fKernel[0][1], fKernel[0][2],
+ fKernel[1][0], fKernel[1][1], fKernel[1][2],
+ fKernel[2][0], fKernel[2][1], fKernel[2][2]);
+ str->appendf("shift: %d, ", fShift);
+
+ this->INHERITED::toString(str);
+
+ str->append(")");
+}
+#endif
*/
#include "SkStippleMaskFilter.h"
-
+#include "SkString.h"
bool SkStippleMaskFilter::filterMask(SkMask* dst,
const SkMask& src,
return true;
}
+
+#ifdef SK_DEVELOPER
+void SkStippleMaskFilter::toString(SkString* str) const {
+ str->append("SkStippleMaskFilter: ()");
+}
+#endif
#include "SkTableMaskFilter.h"
#include "SkFlattenableBuffers.h"
+#include "SkString.h"
SkTableMaskFilter::SkTableMaskFilter() {
for (int i = 0; i < 256; i++) {
SkDebugf("\n\n");
#endif
}
+
+#ifdef SK_DEVELOPER
+void SkTableMaskFilter::toString(SkString* str) const {
+ str->append("SkTableMaskFilter: (");
+
+ str->append("table: ");
+ for (int i = 0; i < 255; ++i) {
+ str->appendf("%d, ", fTable[i]);
+ }
+ str->appendf("%d", fTable[255]);
+
+ str->append(")");
+}
+#endif