Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(927)

Side by Side Diff: src/core/SkGeometry.h

Issue 1650653002: SkNx Load/store: take any pointer. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: simplify call sites Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/core/SkColor.cpp ('k') | src/core/SkGeometry.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 SkGeometry_DEFINED 8 #ifndef SkGeometry_DEFINED
9 #define SkGeometry_DEFINED 9 #define SkGeometry_DEFINED
10 10
11 #include "SkMatrix.h" 11 #include "SkMatrix.h"
12 #include "SkNx.h" 12 #include "SkNx.h"
13 13
14 static inline Sk2s from_point(const SkPoint& point) { 14 static inline Sk2s from_point(const SkPoint& point) {
15 return Sk2s::Load(&point.fX); 15 return Sk2s::Load(&point);
16 } 16 }
17 17
18 static inline SkPoint to_point(const Sk2s& x) { 18 static inline SkPoint to_point(const Sk2s& x) {
19 SkPoint point; 19 SkPoint point;
20 x.store(&point.fX); 20 x.store(&point);
21 return point; 21 return point;
22 } 22 }
23 23
24 static Sk2s times_2(const Sk2s& value) { 24 static Sk2s times_2(const Sk2s& value) {
25 return value + value; 25 return value + value;
26 } 26 }
27 27
28 /** Given a quadratic equation Ax^2 + Bx + C = 0, return 0, 1, 2 roots for the 28 /** Given a quadratic equation Ax^2 + Bx + C = 0, return 0, 1, 2 roots for the
29 equation. 29 equation.
30 */ 30 */
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after
400 private: 400 private:
401 enum { 401 enum {
402 kQuadCount = 8, // should handle most conics 402 kQuadCount = 8, // should handle most conics
403 kPointCount = 1 + 2 * kQuadCount, 403 kPointCount = 1 + 2 * kQuadCount,
404 }; 404 };
405 SkAutoSTMalloc<kPointCount, SkPoint> fStorage; 405 SkAutoSTMalloc<kPointCount, SkPoint> fStorage;
406 int fQuadCount; // #quads for current usage 406 int fQuadCount; // #quads for current usage
407 }; 407 };
408 408
409 #endif 409 #endif
OLDNEW
« no previous file with comments | « src/core/SkColor.cpp ('k') | src/core/SkGeometry.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698