aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core
diff options
context:
space:
mode:
authorGravatar robertphillips <robertphillips@google.com>2014-06-02 10:20:14 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-06-02 10:20:15 -0700
commitd537341e16524d1e22ac5e6c8b9c8f274ba1833c (patch)
treed33b25af48d42a4e9ef93e57ab37b5aca82bbe65 /include/core
parent78358bf624c7e7c09ffccf638c50870808d884d6 (diff)
Move GrIPoint16 to SkIPoint16 (and remove GrPoint.h)
R=bsalomon@google.com, reed@google.com Author: robertphillips@google.com Review URL: https://codereview.chromium.org/309683002
Diffstat (limited to 'include/core')
-rw-r--r--include/core/SkPoint.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/include/core/SkPoint.h b/include/core/SkPoint.h
index 5dd331a14c..6f32d98c75 100644
--- a/include/core/SkPoint.h
+++ b/include/core/SkPoint.h
@@ -11,6 +11,28 @@
#include "SkMath.h"
#include "SkScalar.h"
+/** \struct SkIPoint16
+
+ SkIPoint holds two 16 bit integer coordinates
+*/
+struct SkIPoint16 {
+ int16_t fX, fY;
+
+ static SkIPoint16 Make(int x, int y) {
+ SkIPoint16 pt;
+ pt.set(x, y);
+ return pt;
+ }
+
+ int16_t x() const { return fX; }
+ int16_t y() const { return fY; }
+
+ void set(int x, int y) {
+ fX = SkToS16(x);
+ fY = SkToS16(y);
+ }
+};
+
/** \struct SkIPoint
SkIPoint holds two 32 bit integer coordinates