From 60bc6d5cb0af7cef0e49cc35f28f36f89b10853e Mon Sep 17 00:00:00 2001 From: "reed@android.com" Date: Thu, 11 Feb 2010 11:09:39 +0000 Subject: add Make to SkTSize git-svn-id: http://skia.googlecode.com/svn/trunk@497 2bbb7eff-a529-9590-31e7-b0007b416f81 --- include/core/SkSize.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/core/SkSize.h b/include/core/SkSize.h index d432102c3b..dae6fe91c2 100644 --- a/include/core/SkSize.h +++ b/include/core/SkSize.h @@ -7,6 +7,13 @@ template struct SkTSize { T fWidth; T fHeight; + static SkTSize Make(T w, T h) { + SkTSize s; + s.fWidth = w; + s.fHeight = h; + return s; + } + void set(T w, T h) { fWidth = w; fHeight = h; @@ -58,11 +65,13 @@ static inline bool operator!=(const SkTSize& a, const SkTSize& b) { /////////////////////////////////////////////////////////////////////////////// -struct SkISize : public SkTSize {}; +typedef SkTSize SkISize; #include "SkScalar.h" struct SkSize : public SkTSize { + SkSize(const SkTSizeset(SkIntToScalar(src.fWidth), SkIntToScalar(src.fHeight)); return *this; -- cgit v1.2.3