epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame] | 1 | |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 2 | /* |
epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame] | 3 | * 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.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 7 | */ |
8 | |||||
9 | |||||
epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame] | 10 | |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 11 | #ifndef GrPoint_DEFINED |
12 | #define GrPoint_DEFINED | ||||
13 | |||||
14 | #include "GrTypes.h" | ||||
bsalomon@google.com | 8171288 | 2012-11-01 17:12:34 +0000 | [diff] [blame] | 15 | #include "SkScalar.h" |
reed@google.com | 7744c20 | 2011-05-06 19:26:26 +0000 | [diff] [blame] | 16 | #include "SkPoint.h" |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 17 | |
reed@google.com | 7744c20 | 2011-05-06 19:26:26 +0000 | [diff] [blame] | 18 | struct GrIPoint16 { |
19 | int16_t fX, fY; | ||||
rmistry@google.com | fbfcd56 | 2012-08-23 18:09:54 +0000 | [diff] [blame] | 20 | |
robertphillips | 901e96d | 2014-06-02 07:15:18 -0700 | [diff] [blame^] | 21 | 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.com | 7744c20 | 2011-05-06 19:26:26 +0000 | [diff] [blame] | 30 | void set(intptr_t x, intptr_t y) { |
commit-bot@chromium.org | 972f9cd | 2014-03-28 17:58:28 +0000 | [diff] [blame] | 31 | fX = SkToS16(x); |
32 | fY = SkToS16(y); | ||||
reed@google.com | 7744c20 | 2011-05-06 19:26:26 +0000 | [diff] [blame] | 33 | } |
34 | }; | ||||
35 | |||||
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 36 | #endif |