rename virtuals for clipbounds, and deprecate older bool/var-arg pattern
BUG=skia:
Change-Id: I08bcc2d0559e02838772538816b928e0716dd3aa
Reviewed-on: https://skia-review.googlesource.com/7412
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp
index 7596c3a..8fb83b4 100644
--- a/src/core/SkCanvas.cpp
+++ b/src/core/SkCanvas.cpp
@@ -1742,49 +1742,35 @@
return path.isEmpty() || this->quickReject(path.getBounds());
}
-bool SkCanvas::getClipBounds(SkRect* bounds) const {
- SkIRect ibounds = this->getDeviceClipBounds();
+SkRect SkCanvas::onGetLocalClipBounds() const {
+ SkIRect ibounds = this->onGetDeviceClipBounds();
if (ibounds.isEmpty()) {
- if (bounds) {
- bounds->setEmpty();
- }
- return false;
+ return SkRect::MakeEmpty();
}
SkMatrix inverse;
// if we can't invert the CTM, we can't return local clip bounds
if (!fMCRec->fMatrix.invert(&inverse)) {
- if (bounds) {
- bounds->setEmpty();
- }
- return false;
+ return SkRect::MakeEmpty();
}
- if (bounds) {
- SkRect r;
- // adjust it outwards in case we are antialiasing
- const int inset = 1;
+ SkRect bounds;
+ SkRect r;
+ // adjust it outwards in case we are antialiasing
+ const int inset = 1;
- r.iset(ibounds.fLeft - inset, ibounds.fTop - inset,
- ibounds.fRight + inset, ibounds.fBottom + inset);
- inverse.mapRect(bounds, r);
- }
- return true;
+ r.iset(ibounds.fLeft - inset, ibounds.fTop - inset,
+ ibounds.fRight + inset, ibounds.fBottom + inset);
+ inverse.mapRect(&bounds, r);
+ return bounds;
}
-bool SkCanvas::getClipDeviceBounds(SkIRect* bounds) const {
+SkIRect SkCanvas::onGetDeviceClipBounds() const {
const SkRasterClip& clip = fMCRec->fRasterClip;
if (clip.isEmpty()) {
- if (bounds) {
- bounds->setEmpty();
- }
- return false;
+ return SkIRect::MakeEmpty();
}
-
- if (bounds) {
- *bounds = clip.getBounds();
- }
- return true;
+ return clip.getBounds();
}
const SkMatrix& SkCanvas::getTotalMatrix() const {