diff options
author | tomhudson@google.com <tomhudson@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-09-13 15:07:58 +0000 |
---|---|---|
committer | tomhudson@google.com <tomhudson@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-09-13 15:07:58 +0000 |
commit | bcb671c82a7341253864cda3a5c46d396402d7fb (patch) | |
tree | d6ae7e16ada305c421324fa0542d165e9625e5ff /include | |
parent | 8a0b0291ae4260ef2a46f4341c18a702c0ce3f8b (diff) |
Add SkCanvas::getClipDescription() and getClipDeviceBounds() so clients don't
need to explicitly get the exact clip & compute those values themselves. (We
may be able to provide description/bounds more cheaply than the exact clip.)
git-svn-id: http://skia.googlecode.com/svn/trunk@2255 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include')
-rw-r--r-- | include/core/SkCanvas.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/include/core/SkCanvas.h b/include/core/SkCanvas.h index a22f54fa81..a6c95285b6 100644 --- a/include/core/SkCanvas.h +++ b/include/core/SkCanvas.h @@ -336,6 +336,13 @@ public: */ bool getClipBounds(SkRect* bounds, EdgeType et = kAA_EdgeType) const; + /** Return the bounds of the current clip, in device coordinates; returns + true if non-empty. Maybe faster than getting the clip explicitly and + then taking its bounds. + */ + bool getClipDeviceBounds(SkIRect* bounds) const; + + /** Fill the entire canvas' bitmap (restricted to the current clip) with the specified ARGB color, using the specified mode. @param a the alpha component (0..255) of the color to fill the canvas @@ -743,6 +750,17 @@ public: */ const SkMatrix& getTotalMatrix() const; + enum ClipType { + kEmpty_ClipType = 0, + kRect_ClipType, + kComplex_ClipType + }; + + /** Returns a description of the total clip; may be cheaper than + getting the clip and querying it directly. + */ + ClipType getClipType() const; + /** Return the current device clip (concatenation of all clip calls). This does not account for the translate in any of the devices. @return the current device clip (concatenation of all clip calls). |