Chromium Code Reviews| Index: include/core/SkPoint.h |
| diff --git a/include/core/SkPoint.h b/include/core/SkPoint.h |
| index 5dd331a14ca9b65ecef9d1fec10594ff01d565c0..16b9224136705a380bdfff9c0e86b1491fc2601a 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(intptr_t x, intptr_t y) { |
| + SkIPoint16 pt; |
| + pt.set(x, y); |
| + return pt; |
| + } |
| + |
| + int16_t x() const { return fX; } |
| + int16_t y() const { return fY; } |
| + |
| + void set(intptr_t x, intptr_t y) { |
|
reed1
2014/05/30 17:41:21
I like the idea of using intptr_t here. Perhaps (a
|
| + fX = SkToS16(x); |
| + fY = SkToS16(y); |
| + } |
| +}; |
| + |
| /** \struct SkIPoint |
| SkIPoint holds two 32 bit integer coordinates |