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;
///////////////////////////////////////////////////////////////////////////////
-struct SkISize : public SkTSize<int32_t> {};
+typedef SkTSize<int32_t> SkISize;
#include "SkScalar.h"
struct SkSize : public SkTSize<SkScalar> {
+ SkSize(const SkTSize<SkScalar& src) : fWidth(src.fWidth), fHeight(src.fHeight) {}
+
SkSize& operator=(const SkISize& src) {
this->set(SkIntToScalar(src.fWidth), SkIntToScalar(src.fHeight));
return *this;
#include "Test.h"
#include "SkPath.h"
+#include "SkSize.h"
static void check_convex_bounds(skiatest::Reporter* reporter, const SkPath& p,
const SkRect& bounds) {
}
static void TestPath(skiatest::Reporter* reporter) {
+ {
+ SkSize size;
+ size.fWidth = 3.4f;
+ size.width();
+ size = SkSize::Make(3,4);
+ SkISize isize = SkISize::Make(3,4);
+ }
+
+ SkTSize<SkScalar>::Make(3,4);
+
SkPath p, p2;
SkRect bounds, bounds2;