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

Side by Side Diff: src/core/SkRect.cpp

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/SkNx.h ('k') | src/core/SkScan_Hairline.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 /* 2 /*
3 * Copyright 2006 The Android Open Source Project 3 * Copyright 2006 The Android Open Source Project
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #include "SkRect.h" 9 #include "SkRect.h"
10 10
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 if (count <= 0) { 60 if (count <= 0) {
61 sk_bzero(this, sizeof(SkRect)); 61 sk_bzero(this, sizeof(SkRect));
62 } else { 62 } else {
63 Sk4s min, max, accum; 63 Sk4s min, max, accum;
64 64
65 if (count & 1) { 65 if (count & 1) {
66 min = Sk4s(pts[0].fX, pts[0].fY, pts[0].fX, pts[0].fY); 66 min = Sk4s(pts[0].fX, pts[0].fY, pts[0].fX, pts[0].fY);
67 pts += 1; 67 pts += 1;
68 count -= 1; 68 count -= 1;
69 } else { 69 } else {
70 min = Sk4s::Load(&pts[0].fX); 70 min = Sk4s::Load(pts);
71 pts += 2; 71 pts += 2;
72 count -= 2; 72 count -= 2;
73 } 73 }
74 accum = max = min; 74 accum = max = min;
75 accum = accum * Sk4s(0); 75 accum = accum * Sk4s(0);
76 76
77 count >>= 1; 77 count >>= 1;
78 for (int i = 0; i < count; ++i) { 78 for (int i = 0; i < count; ++i) {
79 Sk4s xy = Sk4s::Load(&pts->fX); 79 Sk4s xy = Sk4s::Load(pts);
80 accum = accum * xy; 80 accum = accum * xy;
81 min = Sk4s::Min(min, xy); 81 min = Sk4s::Min(min, xy);
82 max = Sk4s::Max(max, xy); 82 max = Sk4s::Max(max, xy);
83 pts += 2; 83 pts += 2;
84 } 84 }
85 85
86 /** 86 /**
87 * With some trickery, we may be able to use Min/Max to also propogate non-finites, 87 * With some trickery, we may be able to use Min/Max to also propogate non-finites,
88 * in which case we could eliminate accum entirely, and just check min and max for 88 * in which case we could eliminate accum entirely, and just check min and max for
89 * "is_finite". 89 * "is_finite".
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 SkString strL, strT, strR, strB; 168 SkString strL, strT, strR, strB;
169 SkAppendScalarDec(&strL, fLeft); 169 SkAppendScalarDec(&strL, fLeft);
170 SkAppendScalarDec(&strT, fTop); 170 SkAppendScalarDec(&strT, fTop);
171 SkAppendScalarDec(&strR, fRight); 171 SkAppendScalarDec(&strR, fRight);
172 SkAppendScalarDec(&strB, fBottom); 172 SkAppendScalarDec(&strB, fBottom);
173 line.printf("SkRect::MakeLTRB(%s, %s, %s, %s);", 173 line.printf("SkRect::MakeLTRB(%s, %s, %s, %s);",
174 strL.c_str(), strT.c_str(), strR.c_str(), strB.c_str()); 174 strL.c_str(), strT.c_str(), strR.c_str(), strB.c_str());
175 } 175 }
176 SkDebugf("%s\n", line.c_str()); 176 SkDebugf("%s\n", line.c_str());
177 } 177 }
OLDNEW
« no previous file with comments | « src/core/SkNx.h ('k') | src/core/SkScan_Hairline.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698