aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/effects/Sk2DPathEffect.cpp
diff options
context:
space:
mode:
authorGravatar robertphillips <robertphillips@google.com>2015-01-26 06:08:52 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2015-01-26 06:08:52 -0800
commit42dbfa8651861f2f686879c996aab9f9f82277dd (patch)
tree6a0299231aff19870a0e8a5822ba1d86b816f624 /src/effects/Sk2DPathEffect.cpp
parentb644e9afde5c456a731ec44d8f72b2e1d93b863f (diff)
Add patheffects to debugger printout
TBR=bsalomon@google.com Review URL: https://codereview.chromium.org/872043002
Diffstat (limited to 'src/effects/Sk2DPathEffect.cpp')
-rw-r--r--src/effects/Sk2DPathEffect.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/effects/Sk2DPathEffect.cpp b/src/effects/Sk2DPathEffect.cpp
index 2ad202ae85..1df69a51fc 100644
--- a/src/effects/Sk2DPathEffect.cpp
+++ b/src/effects/Sk2DPathEffect.cpp
@@ -73,6 +73,15 @@ void Sk2DPathEffect::flatten(SkWriteBuffer& buffer) const {
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,
@@ -109,6 +118,16 @@ void SkLine2DPathEffect::flatten(SkWriteBuffer &buffer) const {
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)
@@ -132,3 +151,12 @@ void SkPath2DPathEffect::next(const SkPoint& loc, int u, int v,
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