aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core/SkRect.h
diff options
context:
space:
mode:
authorGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-11-04 20:10:33 +0000
committerGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-11-04 20:10:33 +0000
commitac9d306a92e569e85a7611e9db00943b5b551f1e (patch)
tree168e141c406948aad89ec41bb88b0c3260de2a5c /include/core/SkRect.h
parent8d8bcf9f88be927f6d7e5167bb9220d62bf8afe3 (diff)
speed up A8 by creating a new entry-point in SkDraw that blits the path's coverage directly into an A8 target, regardless of the previous pixel values.
R=bsalomon@google.com, mtklein@google.com Review URL: https://codereview.chromium.org/56453002 git-svn-id: http://skia.googlecode.com/svn/trunk@12118 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/core/SkRect.h')
-rw-r--r--include/core/SkRect.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/include/core/SkRect.h b/include/core/SkRect.h
index 98acb1cda3..8bfa57a8f9 100644
--- a/include/core/SkRect.h
+++ b/include/core/SkRect.h
@@ -730,7 +730,7 @@ struct SK_API SkRect {
/**
* Set the dst rectangle by rounding this rectangle's coordinates to their
- * nearest integer values using SkScalarRound.
+ * nearest integer values using SkScalarRoundToInt.
*/
void round(SkIRect* dst) const {
SkASSERT(dst);
@@ -772,6 +772,15 @@ struct SK_API SkRect {
SkScalarFloorToInt(fRight), SkScalarFloorToInt(fBottom));
}
+ /**
+ * Return a new SkIRect which is contains the rounded coordinates of this
+ * rect using SkScalarRoundToInt.
+ */
+ SkIRect round() const {
+ SkIRect ir;
+ this->round(&ir);
+ return ir;
+ }
/**
* Swap top/bottom or left/right if there are flipped (i.e. if width()