From 759cf4846804be137229393e04925752423de2d0 Mon Sep 17 00:00:00 2001 From: "commit-bot@chromium.org" Date: Thu, 6 Mar 2014 13:18:07 +0000 Subject: [PATCH] Now that the matching changes have landed in Chromium we can clean up the API on our side. R=reed@google.com Author: robertphillips@google.com Review URL: https://codereview.chromium.org/187553003 git-svn-id: http://skia.googlecode.com/svn/trunk@13680 2bbb7eff-a529-9590-31e7-b0007b416f81 --- include/core/SkCanvas.h | 28 ++++++++++++---------------- src/core/SkCanvas.cpp | 17 +++++------------ 2 files changed, 17 insertions(+), 28 deletions(-) diff --git a/include/core/SkCanvas.h b/include/core/SkCanvas.h index 5bdf84d..b646ba4 100644 --- a/include/core/SkCanvas.h +++ b/include/core/SkCanvas.h @@ -423,33 +423,30 @@ public: * @param rect The rect to combine with the current clip * @param op The region op to apply to the current clip * @param doAntiAlias true if the clip should be antialiased - * @return true if the canvas' clip is non-empty */ - virtual bool clipRect(const SkRect& rect, - SkRegion::Op op = SkRegion::kIntersect_Op, - bool doAntiAlias = false); + void clipRect(const SkRect& rect, + SkRegion::Op op = SkRegion::kIntersect_Op, + bool doAntiAlias = false); /** * Modify the current clip with the specified SkRRect. * @param rrect The rrect to combine with the current clip * @param op The region op to apply to the current clip * @param doAntiAlias true if the clip should be antialiased - * @return true if the canvas' clip is non-empty */ - virtual bool clipRRect(const SkRRect& rrect, - SkRegion::Op op = SkRegion::kIntersect_Op, - bool doAntiAlias = false); + void clipRRect(const SkRRect& rrect, + SkRegion::Op op = SkRegion::kIntersect_Op, + bool doAntiAlias = false); /** * Modify the current clip with the specified path. * @param path The path to combine with the current clip * @param op The region op to apply to the current clip * @param doAntiAlias true if the clip should be antialiased - * @return true if the canvas' new clip is non-empty */ - virtual bool clipPath(const SkPath& path, - SkRegion::Op op = SkRegion::kIntersect_Op, - bool doAntiAlias = false); + void clipPath(const SkPath& path, + SkRegion::Op op = SkRegion::kIntersect_Op, + bool doAntiAlias = false); /** EXPERIMENTAL -- only used for testing Set to false to force clips to be hard, even if doAntiAlias=true is @@ -472,10 +469,9 @@ public: coordinates, and so no transformation is performed. @param deviceRgn The region to apply to the current clip @param op The region op to apply to the current clip - @return true if the canvas' new clip is non-empty */ - virtual bool clipRegion(const SkRegion& deviceRgn, - SkRegion::Op op = SkRegion::kIntersect_Op); + void clipRegion(const SkRegion& deviceRgn, + SkRegion::Op op = SkRegion::kIntersect_Op); /** Helper for clipRegion(rgn, kReplace_Op). Sets the current clip to the specified region. This does not intersect or in any other way account @@ -1155,7 +1151,7 @@ protected: // Called by child classes that override clipPath and clipRRect to only // track fast conservative clip bounds, rather than exact clips. - bool updateClipConservativelyUsingBounds(const SkRect&, SkRegion::Op, + void updateClipConservativelyUsingBounds(const SkRect&, SkRegion::Op, bool inverseFilled); // notify our surface (if we have one) that we are about to draw, so it diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp index dfc3f93..3d347e5 100644 --- a/src/core/SkCanvas.cpp +++ b/src/core/SkCanvas.cpp @@ -1165,10 +1165,9 @@ void SkCanvas::resetMatrix() { ////////////////////////////////////////////////////////////////////////////// -bool SkCanvas::clipRect(const SkRect& rect, SkRegion::Op op, bool doAA) { +void SkCanvas::clipRect(const SkRect& rect, SkRegion::Op op, bool doAA) { ClipEdgeStyle edgeStyle = doAA ? kSoft_ClipEdgeStyle : kHard_ClipEdgeStyle; this->onClipRect(rect, op, edgeStyle); - return !this->isClipEmpty(); } void SkCanvas::onClipRect(const SkRect& rect, SkRegion::Op op, ClipEdgeStyle edgeStyle) { @@ -1258,14 +1257,13 @@ static void clip_path_helper(const SkCanvas* canvas, SkRasterClip* currClip, } } -bool SkCanvas::clipRRect(const SkRRect& rrect, SkRegion::Op op, bool doAA) { +void SkCanvas::clipRRect(const SkRRect& rrect, SkRegion::Op op, bool doAA) { ClipEdgeStyle edgeStyle = doAA ? kSoft_ClipEdgeStyle : kHard_ClipEdgeStyle; if (rrect.isRect()) { this->onClipRect(rrect.getBounds(), op, edgeStyle); } else { this->onClipRRect(rrect, op, edgeStyle); } - return !this->isClipEmpty(); } void SkCanvas::onClipRRect(const SkRRect& rrect, SkRegion::Op op, ClipEdgeStyle edgeStyle) { @@ -1294,7 +1292,7 @@ void SkCanvas::onClipRRect(const SkRRect& rrect, SkRegion::Op op, ClipEdgeStyle this->SkCanvas::onClipPath(path, op, edgeStyle); } -bool SkCanvas::clipPath(const SkPath& path, SkRegion::Op op, bool doAA) { +void SkCanvas::clipPath(const SkPath& path, SkRegion::Op op, bool doAA) { ClipEdgeStyle edgeStyle = doAA ? kSoft_ClipEdgeStyle : kHard_ClipEdgeStyle; SkRect r; if (!path.isInverseFillType() && path.isRect(&r)) { @@ -1302,8 +1300,6 @@ bool SkCanvas::clipPath(const SkPath& path, SkRegion::Op op, bool doAA) { } else { this->onClipPath(path, op, edgeStyle); } - - return !this->isClipEmpty(); } void SkCanvas::onClipPath(const SkPath& path, SkRegion::Op op, ClipEdgeStyle edgeStyle) { @@ -1379,7 +1375,7 @@ void SkCanvas::onClipPath(const SkPath& path, SkRegion::Op op, ClipEdgeStyle edg clip_path_helper(this, fMCRec->fRasterClip, devPath, op, edgeStyle); } -bool SkCanvas::updateClipConservativelyUsingBounds(const SkRect& bounds, SkRegion::Op op, +void SkCanvas::updateClipConservativelyUsingBounds(const SkRect& bounds, SkRegion::Op op, bool inverseFilled) { // This is for updating the clip conservatively using only bounds // information. @@ -1452,13 +1448,10 @@ bool SkCanvas::updateClipConservativelyUsingBounds(const SkRect& bounds, SkRegio SkASSERT(0); // unhandled op? } } - - return !this->isClipEmpty(); } -bool SkCanvas::clipRegion(const SkRegion& rgn, SkRegion::Op op) { +void SkCanvas::clipRegion(const SkRegion& rgn, SkRegion::Op op) { this->onClipRegion(rgn, op); - return !this->isClipEmpty(); } void SkCanvas::onClipRegion(const SkRegion& rgn, SkRegion::Op op) { -- 2.7.4