add isClipEmpty() -- encourage clients to call this rather than checking clipFoo() results
BUG=skia: R=robertphillips@google.com Review URL: https://codereview.chromium.org/177073006 git-svn-id: http://skia.googlecode.com/svn/trunk@13568 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
parent
5cc25359c6
commit
754de5f65b
@ -972,6 +972,15 @@ public:
|
|||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return true if the current clip is empty (i.e. nothing will draw).
|
||||||
|
* Note: this is not always a free call, so it should not be used
|
||||||
|
* more often than necessary. However, once the canvas has computed this
|
||||||
|
* result, subsequent calls will be cheap (until the clip state changes,
|
||||||
|
* which can happen on any clip..() or restore() call.
|
||||||
|
*/
|
||||||
|
bool isClipEmpty() const;
|
||||||
|
|
||||||
/** Return the current matrix on the canvas.
|
/** Return the current matrix on the canvas.
|
||||||
This does not account for the translate in any of the devices.
|
This does not account for the translate in any of the devices.
|
||||||
@return The current matrix on the canvas.
|
@return The current matrix on the canvas.
|
||||||
|
@ -1484,6 +1484,10 @@ void SkCanvas::replayClips(ClipVisitor* visitor) const {
|
|||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
bool SkCanvas::isClipEmpty() const {
|
||||||
|
return fMCRec->fRasterClip->isEmpty();
|
||||||
|
}
|
||||||
|
|
||||||
bool SkCanvas::quickReject(const SkRect& rect) const {
|
bool SkCanvas::quickReject(const SkRect& rect) const {
|
||||||
|
|
||||||
if (!rect.isFinite())
|
if (!rect.isFinite())
|
||||||
|
Loading…
Reference in New Issue
Block a user