OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 The Android Open Source Project |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef SkPoint_DEFINED | 8 #ifndef SkPoint_DEFINED |
9 #define SkPoint_DEFINED | 9 #define SkPoint_DEFINED |
10 | 10 |
(...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
497 SkScalar tmp = vec.fX; | 497 SkScalar tmp = vec.fX; |
498 if (kRight_Side == side) { | 498 if (kRight_Side == side) { |
499 fX = -vec.fY; | 499 fX = -vec.fY; |
500 fY = tmp; | 500 fY = tmp; |
501 } else { | 501 } else { |
502 SkASSERT(kLeft_Side == side); | 502 SkASSERT(kLeft_Side == side); |
503 fX = vec.fY; | 503 fX = vec.fY; |
504 fY = -tmp; | 504 fY = -tmp; |
505 } | 505 } |
506 } | 506 } |
| 507 |
| 508 /** |
| 509 * cast-safe way to treat the point as an array of (2) SkScalars. |
| 510 */ |
| 511 const SkScalar* asScalars() const { return &fX; } |
507 }; | 512 }; |
508 | 513 |
509 typedef SkPoint SkVector; | 514 typedef SkPoint SkVector; |
510 | 515 |
511 #endif | 516 #endif |
OLD | NEW |