Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(284)

Unified Diff: include/core/SkCanvas.h

Issue 177073006: add isClipEmpty() -- encourage clients to call this rather than checking clipFoo() results (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/core/SkCanvas.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkCanvas.h
diff --git a/include/core/SkCanvas.h b/include/core/SkCanvas.h
index 754fd167a3aae77a9af02f72a3ef79530fe7bb63..e639212e384b0f58dda00b3e8086cbe03a059688 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.
« no previous file with comments | « no previous file | src/core/SkCanvas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698