From 8f90a892c5130d4d26b5588e1ff151d01a40688a Mon Sep 17 00:00:00 2001 From: "robertphillips@google.com" Date: Fri, 28 Feb 2014 18:19:39 +0000 Subject: add new onClip* methods to SkCanvas https://codereview.chromium.org/183453002/ git-svn-id: http://skia.googlecode.com/svn/trunk@13627 2bbb7eff-a529-9590-31e7-b0007b416f81 --- src/utils/SkDumpCanvas.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'src/utils/SkDumpCanvas.cpp') diff --git a/src/utils/SkDumpCanvas.cpp b/src/utils/SkDumpCanvas.cpp index d768137578..4805d6287c 100644 --- a/src/utils/SkDumpCanvas.cpp +++ b/src/utils/SkDumpCanvas.cpp @@ -261,40 +261,40 @@ void SkDumpCanvas::setMatrix(const SkMatrix& matrix) { /////////////////////////////////////////////////////////////////////////////// -static const char* bool_to_aastring(bool doAA) { - return doAA ? "AA" : "BW"; +const char* SkDumpCanvas::EdgeStyleToAAString(ClipEdgeStyle edgeStyle) { + return kSoft_ClipEdgeStyle == edgeStyle ? "AA" : "BW"; } -bool SkDumpCanvas::clipRect(const SkRect& rect, SkRegion::Op op, bool doAA) { +void SkDumpCanvas::onClipRect(const SkRect& rect, SkRegion::Op op, ClipEdgeStyle edgeStyle) { SkString str; toString(rect, &str); this->dump(kClip_Verb, NULL, "clipRect(%s %s %s)", str.c_str(), toString(op), - bool_to_aastring(doAA)); - return this->INHERITED::clipRect(rect, op, doAA); + EdgeStyleToAAString(edgeStyle)); + this->INHERITED::onClipRect(rect, op, edgeStyle); } -bool SkDumpCanvas::clipRRect(const SkRRect& rrect, SkRegion::Op op, bool doAA) { +void SkDumpCanvas::onClipRRect(const SkRRect& rrect, SkRegion::Op op, ClipEdgeStyle edgeStyle) { SkString str; toString(rrect, &str); this->dump(kClip_Verb, NULL, "clipRRect(%s %s %s)", str.c_str(), toString(op), - bool_to_aastring(doAA)); - return this->INHERITED::clipRRect(rrect, op, doAA); + EdgeStyleToAAString(edgeStyle)); + this->INHERITED::onClipRRect(rrect, op, edgeStyle); } -bool SkDumpCanvas::clipPath(const SkPath& path, SkRegion::Op op, bool doAA) { +void SkDumpCanvas::onClipPath(const SkPath& path, SkRegion::Op op, ClipEdgeStyle edgeStyle) { SkString str; toString(path, &str); this->dump(kClip_Verb, NULL, "clipPath(%s %s %s)", str.c_str(), toString(op), - bool_to_aastring(doAA)); - return this->INHERITED::clipPath(path, op, doAA); + EdgeStyleToAAString(edgeStyle)); + this->INHERITED::onClipPath(path, op, edgeStyle); } -bool SkDumpCanvas::clipRegion(const SkRegion& deviceRgn, SkRegion::Op op) { +void SkDumpCanvas::onClipRegion(const SkRegion& deviceRgn, SkRegion::Op op) { SkString str; toString(deviceRgn, &str); this->dump(kClip_Verb, NULL, "clipRegion(%s %s)", str.c_str(), toString(op)); - return this->INHERITED::clipRegion(deviceRgn, op); + this->INHERITED::onClipRegion(deviceRgn, op); } void SkDumpCanvas::onPushCull(const SkRect& cullRect) { -- cgit v1.2.3