From 7b7cdd147f5528865238e5ed98c79e6d319fde9b Mon Sep 17 00:00:00 2001 From: "bsalomon@google.com" Date: Wed, 7 Nov 2012 16:17:24 +0000 Subject: 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 --- include/core/SkRect.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include/core/SkRect.h') 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 */ -- cgit v1.2.3