aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core/SkRect.h
diff options
context:
space:
mode:
authorGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-11-07 16:17:24 +0000
committerGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-11-07 16:17:24 +0000
commit7b7cdd147f5528865238e5ed98c79e6d319fde9b (patch)
tree8d42e48f75699dbeb53f7ed7a6a4f3f820abe988 /include/core/SkRect.h
parent8f0a7b8e7334187a5d7d5ab7fde5a3c3009555f5 (diff)
Some improvements to reduce the number of pixels touched in generating alpha clip masks
Review URL: https://codereview.appspot.com/6828043 git-svn-id: http://skia.googlecode.com/svn/trunk@6329 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/core/SkRect.h')
-rw-r--r--include/core/SkRect.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/core/SkRect.h b/include/core/SkRect.h
index 7210bf9cd6..f5e8c3cc3a 100644
--- a/include/core/SkRect.h
+++ b/include/core/SkRect.h
@@ -366,6 +366,15 @@ struct SK_API SkRect {
return r;
}
+ static SkRect SK_WARN_UNUSED_RESULT MakeFromIRect(const SkIRect& irect) {
+ SkRect r;
+ r.set(SkIntToScalar(irect.fLeft),
+ SkIntToScalar(irect.fTop),
+ SkIntToScalar(irect.fRight),
+ SkIntToScalar(irect.fBottom));
+ return r;
+ }
+
/**
* Return true if the rectangle's width or height are <= 0
*/