devirtualize SkCanvas getClipBounds methods
We no longer have any subclasses overriding the virtual hooks, and we've seen subtle bugs come up back when they did. In all modes, SkCanvas can answer these queries itself. BUG=chromium:781238 Change-Id: I37c7511c7bd00c638faacbe4bee89f785691453f Reviewed-on: https://skia-review.googlesource.com/77202 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
This commit is contained in:
parent
5eaa297267
commit
83c8dd9b1a
@ -1025,7 +1025,7 @@ public:
|
||||
|
||||
@return bounds of clip in local coordinates
|
||||
*/
|
||||
SkRect getLocalClipBounds() const { return this->onGetLocalClipBounds(); }
|
||||
SkRect getLocalClipBounds() const;
|
||||
|
||||
/** Return bounds of clip, transformed by inverse of SkMatrix. If clip is empty,
|
||||
return false, and set bounds to SkRect::MakeEmpty, where all SkRect sides equal zero.
|
||||
@ -1037,7 +1037,7 @@ public:
|
||||
@return true if clip bounds is not empty
|
||||
*/
|
||||
bool getLocalClipBounds(SkRect* bounds) const {
|
||||
*bounds = this->onGetLocalClipBounds();
|
||||
*bounds = this->getLocalClipBounds();
|
||||
return !bounds->isEmpty();
|
||||
}
|
||||
|
||||
@ -1048,7 +1048,7 @@ public:
|
||||
|
||||
@return bounds of clip in SkBaseDevice coordinates
|
||||
*/
|
||||
SkIRect getDeviceClipBounds() const { return this->onGetDeviceClipBounds(); }
|
||||
SkIRect getDeviceClipBounds() const;
|
||||
|
||||
/** Return SkIRect bounds of clip, unaffected by SkMatrix. If clip is empty,
|
||||
return false, and set bounds to SkRect::MakeEmpty, where all SkRect sides equal zero.
|
||||
@ -1059,7 +1059,7 @@ public:
|
||||
@return true if clip bounds is not empty
|
||||
*/
|
||||
bool getDeviceClipBounds(SkIRect* bounds) const {
|
||||
*bounds = this->onGetDeviceClipBounds();
|
||||
*bounds = this->getDeviceClipBounds();
|
||||
return !bounds->isEmpty();
|
||||
}
|
||||
|
||||
@ -2471,10 +2471,6 @@ protected:
|
||||
this->didConcat(SkMatrix::MakeTrans(dx, dy));
|
||||
}
|
||||
|
||||
virtual SkRect onGetLocalClipBounds() const;
|
||||
virtual SkIRect onGetDeviceClipBounds() const;
|
||||
|
||||
|
||||
virtual void onDrawAnnotation(const SkRect& rect, const char key[], SkData* value);
|
||||
virtual void onDrawDRRect(const SkRRect& outer, const SkRRect& inner, const SkPaint& paint);
|
||||
|
||||
|
@ -1634,8 +1634,8 @@ bool SkCanvas::quickReject(const SkPath& path) const {
|
||||
return path.isEmpty() || this->quickReject(path.getBounds());
|
||||
}
|
||||
|
||||
SkRect SkCanvas::onGetLocalClipBounds() const {
|
||||
SkIRect ibounds = this->onGetDeviceClipBounds();
|
||||
SkRect SkCanvas::getLocalClipBounds() const {
|
||||
SkIRect ibounds = this->getDeviceClipBounds();
|
||||
if (ibounds.isEmpty()) {
|
||||
return SkRect::MakeEmpty();
|
||||
}
|
||||
@ -1657,7 +1657,7 @@ SkRect SkCanvas::onGetLocalClipBounds() const {
|
||||
return bounds;
|
||||
}
|
||||
|
||||
SkIRect SkCanvas::onGetDeviceClipBounds() const {
|
||||
SkIRect SkCanvas::getDeviceClipBounds() const {
|
||||
return fMCRec->fRasterClip.getBounds();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user