blob: 16738f52434f9f4fa2dd05235025b244e040b5c8 [file] [log] [blame]
epoger@google.comec3ed6a2011-07-28 14:26:00 +00001
reed@google.comac10a2d2010-12-22 21:39:39 +00002/*
epoger@google.comec3ed6a2011-07-28 14:26:00 +00003 * Copyright 2010 Google Inc.
4 *
5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file.
reed@google.comac10a2d2010-12-22 21:39:39 +00007 */
8
9
epoger@google.comec3ed6a2011-07-28 14:26:00 +000010
reed@google.comac10a2d2010-12-22 21:39:39 +000011#ifndef GrPoint_DEFINED
12#define GrPoint_DEFINED
13
14#include "GrTypes.h"
bsalomon@google.com81712882012-11-01 17:12:34 +000015#include "SkScalar.h"
reed@google.com7744c202011-05-06 19:26:26 +000016#include "SkPoint.h"
reed@google.comac10a2d2010-12-22 21:39:39 +000017
reed@google.com7744c202011-05-06 19:26:26 +000018struct GrIPoint16 {
19 int16_t fX, fY;
rmistry@google.comfbfcd562012-08-23 18:09:54 +000020
robertphillips901e96d2014-06-02 07:15:18 -070021 static GrIPoint16 Make(intptr_t x, intptr_t y) {
22 GrIPoint16 pt;
23 pt.set(x, y);
24 return pt;
25 }
26
27 int16_t x() const { return fX; }
28 int16_t y() const { return fY; }
29
reed@google.com7744c202011-05-06 19:26:26 +000030 void set(intptr_t x, intptr_t y) {
commit-bot@chromium.org972f9cd2014-03-28 17:58:28 +000031 fX = SkToS16(x);
32 fY = SkToS16(y);
reed@google.com7744c202011-05-06 19:26:26 +000033 }
34};
35
reed@google.comac10a2d2010-12-22 21:39:39 +000036#endif