bool asFragmentProcessor(GrContext*, const SkPaint& paint, const SkMatrix& viewM,
const SkMatrix* localMatrix, GrColor* color,
GrFragmentProcessor** fp) const SK_OVERRIDE;
+
+#ifndef SK_IGNORE_TO_STRING
+ void toString(SkString* str) const SK_OVERRIDE {
+ str->appendf("DCShader: ()");
+ }
+#endif
+
private:
const SkMatrix fDeviceMatrix;
};
virtual DashType asADash(DashInfo* info) const;
+ SK_TO_STRING_PUREVIRT()
SK_DEFINE_FLATTENABLE_TYPE(SkPathEffect)
protected:
// these are visible to our subclasses
SkPathEffect* fPE0, *fPE1;
+ SK_TO_STRING_OVERRIDE()
+
private:
typedef SkPathEffect INHERITED;
};
virtual bool filterPath(SkPath* dst, const SkPath& src,
SkStrokeRec*, const SkRect*) const SK_OVERRIDE;
+ SK_TO_STRING_OVERRIDE()
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkComposePathEffect)
protected:
- SkComposePathEffect(SkPathEffect* outer, SkPathEffect* inner)
- : INHERITED(outer, inner) {}
+ SkComposePathEffect(SkPathEffect* outer, SkPathEffect* inner) : INHERITED(outer, inner) {}
private:
// illegal
virtual bool filterPath(SkPath* dst, const SkPath& src,
SkStrokeRec*, const SkRect*) const SK_OVERRIDE;
+ SK_TO_STRING_OVERRIDE()
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkSumPathEffect)
protected:
- SkSumPathEffect(SkPathEffect* first, SkPathEffect* second)
- : INHERITED(first, second) {}
+ SkSumPathEffect(SkPathEffect* first, SkPathEffect* second) : INHERITED(first, second) {}
private:
// illegal
void preroll() const { this->onPreroll(); }
- SK_TO_STRING_VIRT()
+ SK_TO_STRING_PUREVIRT()
SK_DEFINE_FLATTENABLE_TYPE(SkShader)
protected:
virtual bool filterPath(SkPath*, const SkPath&,
SkStrokeRec*, const SkRect*) const SK_OVERRIDE;
+ SK_TO_STRING_OVERRIDE()
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkPath1DPathEffect)
protected:
explicit Sk2DPathEffect(const SkMatrix& mat);
void flatten(SkWriteBuffer&) const SK_OVERRIDE;
+ SK_TO_STRING_OVERRIDE()
+
private:
SkMatrix fMatrix, fInverse;
bool fMatrixIsInvertible;
virtual bool filterPath(SkPath* dst, const SkPath& src,
SkStrokeRec*, const SkRect*) const SK_OVERRIDE;
+ SK_TO_STRING_OVERRIDE()
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkLine2DPathEffect)
protected:
return SkNEW_ARGS(SkPath2DPathEffect, (matrix, path));
}
+ SK_TO_STRING_OVERRIDE()
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkPath2DPathEffect)
protected:
bool filterPath(SkPath* dst, const SkPath& src, SkStrokeRec*, const SkRect*) const SK_OVERRIDE;
+ SK_TO_STRING_OVERRIDE()
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkArcToPathEffect)
protected:
virtual bool filterPath(SkPath* dst, const SkPath& src,
SkStrokeRec*, const SkRect*) const SK_OVERRIDE;
+ SK_TO_STRING_OVERRIDE()
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkCornerPathEffect)
protected:
DashType asADash(DashInfo* info) const SK_OVERRIDE;
+ SK_TO_STRING_OVERRIDE()
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkDashPathEffect)
protected:
virtual bool filterPath(SkPath* dst, const SkPath& src,
SkStrokeRec*, const SkRect*) const SK_OVERRIDE;
+ SK_TO_STRING_OVERRIDE()
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkDiscretePathEffect)
protected:
dst->setFillType(SkPath::kInverseWinding_FillType);
return true;
}
+
+#ifndef SK_IGNORE_TO_STRING
+ void toString(SkString* str) const SK_OVERRIDE {
+ str->appendf("InverseFillPE: ()");
+ }
+#endif
+
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(InverseFillPE)
private:
return result;
}
+#ifndef SK_IGNORE_TO_STRING
+ void toString(SkString* str) const SK_OVERRIDE {
+ str->appendf("SkShape1DPathEffect: (");
+ // TODO: fill in
+ str->appendf(")");
+ }
+#endif
+
private:
static bool GetContourLength(const char* token, size_t len, void* clen, SkScriptValue* value) {
if (SK_LITERAL_STR_EQUAL("contourLength", token, len)) {
SkPathEffect* pathEffect = this->getPathEffect();
if (pathEffect) {
str->append("<dt>PathEffect:</dt><dd>");
+ pathEffect->toString(str);
str->append("</dd>");
}
buffer.writeFlattenable(fPE1);
}
+#ifndef SK_IGNORE_TO_STRING
+void SkPairPathEffect::toString(SkString* str) const {
+ str->appendf("first: ");
+ if (fPE0) {
+ fPE0->toString(str);
+ }
+ str->appendf(" second: ");
+ if (fPE1) {
+ fPE1->toString(str);
+ }
+}
+#endif
+
///////////////////////////////////////////////////////////////////////////////
SkFlattenable* SkComposePathEffect::CreateProc(SkReadBuffer& buffer) {
return fPE0->filterPath(dst, *ptr, rec, cullRect);
}
+
+#ifndef SK_IGNORE_TO_STRING
+void SkComposePathEffect::toString(SkString* str) const {
+ str->appendf("SkComposePathEffect: (");
+ this->INHERITED::toString(str);
+ str->appendf(")");
+}
+#endif
+
///////////////////////////////////////////////////////////////////////////////
SkFlattenable* SkSumPathEffect::CreateProc(SkReadBuffer& buffer) {
return fPE0->filterPath(dst, src, rec, cullRect) |
fPE1->filterPath(dst, src, rec, cullRect);
}
+
+
+#ifndef SK_IGNORE_TO_STRING
+void SkSumPathEffect::toString(SkString* str) const {
+ str->appendf("SkSumPathEffect: (");
+ this->INHERITED::toString(str);
+ str->appendf(")");
+}
+#endif
}
return fAdvance;
}
+
+
+#ifndef SK_IGNORE_TO_STRING
+void SkPath1DPathEffect::toString(SkString* str) const {
+ str->appendf("SkPath1DPathEffect: (");
+ // TODO: add path and style
+ str->appendf("advance: %.2f phase %.2f", fAdvance, fInitialOffset);
+ str->appendf(")");
+}
+#endif
buffer.writeMatrix(fMatrix);
}
+#ifndef SK_IGNORE_TO_STRING
+void Sk2DPathEffect::toString(SkString* str) const {
+ str->appendf("(matrix: %.2f %.2f %.2f %.2f %.2f %.2f %.2f %.2f %.2f)",
+ fMatrix[SkMatrix::kMScaleX], fMatrix[SkMatrix::kMSkewX], fMatrix[SkMatrix::kMTransX],
+ fMatrix[SkMatrix::kMSkewY], fMatrix[SkMatrix::kMScaleY], fMatrix[SkMatrix::kMTransY],
+ fMatrix[SkMatrix::kMPersp0], fMatrix[SkMatrix::kMPersp1], fMatrix[SkMatrix::kMPersp2]);
+}
+#endif
+
///////////////////////////////////////////////////////////////////////////////
bool SkLine2DPathEffect::filterPath(SkPath* dst, const SkPath& src,
buffer.writeScalar(fWidth);
}
+
+#ifndef SK_IGNORE_TO_STRING
+void SkLine2DPathEffect::toString(SkString* str) const {
+ str->appendf("SkLine2DPathEffect: (");
+ this->INHERITED::toString(str);
+ str->appendf("width: %f", fWidth);
+ str->appendf(")");
+}
+#endif
+
///////////////////////////////////////////////////////////////////////////////
SkPath2DPathEffect::SkPath2DPathEffect(const SkMatrix& m, const SkPath& p)
SkPath* dst) const {
dst->addPath(fPath, loc.fX, loc.fY);
}
+
+#ifndef SK_IGNORE_TO_STRING
+void SkPath2DPathEffect::toString(SkString* str) const {
+ str->appendf("SkPath2DPathEffect: (");
+ this->INHERITED::toString(str);
+ // TODO: print out path information
+ str->appendf(")");
+}
+#endif
void SkArcToPathEffect::flatten(SkWriteBuffer& buffer) const {
buffer.writeScalar(fRadius);
}
+
+#ifndef SK_IGNORE_TO_STRING
+void SkArcToPathEffect::toString(SkString* str) const {
+ str->appendf("SkArcToPathEffect: (");
+ str->appendf("radius: %f", fRadius);
+ str->appendf(")");
+}
+#endif
void SkCornerPathEffect::flatten(SkWriteBuffer& buffer) const {
buffer.writeScalar(fRadius);
}
+
+#ifndef SK_IGNORE_TO_STRING
+void SkCornerPathEffect::toString(SkString* str) const {
+ str->appendf("SkCornerPathEffect: (");
+ str->appendf("radius: %.2f", fRadius);
+ str->appendf(")");
+}
+#endif
}
return NULL;
}
+
+#ifndef SK_IGNORE_TO_STRING
+void SkDashPathEffect::toString(SkString* str) const {
+ str->appendf("SkDashPathEffect: (");
+ str->appendf("count: %d phase %.2f intervals: (", fCount, fPhase);
+ for (int i = 0; i < fCount; ++i) {
+ str->appendf("%.2f", fIntervals[i]);
+ if (i < fCount-1) {
+ str->appendf(", ");
+ }
+ }
+ str->appendf("))");
+}
+#endif
buffer.writeScalar(fPerterb);
buffer.writeUInt(fSeedAssist);
}
+
+#ifndef SK_IGNORE_TO_STRING
+void SkDiscretePathEffect::toString(SkString* str) const {
+ str->appendf("SkDiscretePathEffect: (");
+ str->appendf("segLength: %.2f deviation: %.2f seed %d", fSegLength, fPerterb, fSeedAssist);
+ str->append(")");
+}
+#endif