diff options
author | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-02-24 19:38:20 +0000 |
---|---|---|
committer | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-02-24 19:38:20 +0000 |
commit | 754de5f65b466f721d952a379194cc94de376f42 (patch) | |
tree | 957283b1b7ebd32bab0b8c5a943942aa39a5360f /include | |
parent | 5cc25359c62c83c356c3a30572a05ac9647daa55 (diff) |
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
Diffstat (limited to 'include')
-rw-r--r-- | include/core/SkCanvas.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/core/SkCanvas.h b/include/core/SkCanvas.h index 754fd167a3..e639212e38 100644 --- a/include/core/SkCanvas.h +++ b/include/core/SkCanvas.h @@ -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. This does not account for the translate in any of the devices. @return The current matrix on the canvas. |