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

Side by Side Diff: src/effects/gradients/SkRadialGradient.cpp

Issue 1411563008: prune unused SkNx features (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 0.001f Created 5 years, 1 month 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/opts/SkNx_neon.h » ('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 2012 Google Inc. 3 * Copyright 2012 Google Inc.
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 "SkRadialGradient.h" 9 #include "SkRadialGradient.h"
10 #include "SkRadialGradient_Table.h" 10 #include "SkRadialGradient_Table.h"
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 Sk4f tmpdxdy = sum_squares(dx4, dy4); 299 Sk4f tmpdxdy = sum_squares(dx4, dy4);
300 Sk4f R = sum_squares(fx4, fy4); 300 Sk4f R = sum_squares(fx4, fy4);
301 Sk4f dR = tmpxy + tmpxy + tmpdxdy; 301 Sk4f dR = tmpxy + tmpxy + tmpdxdy;
302 const Sk4f ddR = tmpdxdy + tmpdxdy; 302 const Sk4f ddR = tmpdxdy + tmpdxdy;
303 303
304 for (int i = 0; i < (count >> 2); ++i) { 304 for (int i = 0; i < (count >> 2); ++i) {
305 Sk4f dist = Sk4f::Min(fast_sqrt(R), max); 305 Sk4f dist = Sk4f::Min(fast_sqrt(R), max);
306 R = R + dR; 306 R = R + dR;
307 dR = dR + ddR; 307 dR = dR + ddR;
308 308
309 int fi[4]; 309 uint8_t fi[4];
310 dist.castTrunc().store(fi); 310 dist.toBytes(fi);
311 311
312 for (int i = 0; i < 4; i++) { 312 for (int i = 0; i < 4; i++) {
313 *dstC++ = cache[toggle + fi[i]]; 313 *dstC++ = cache[toggle + fi[i]];
314 toggle = next_dither_toggle(toggle); 314 toggle = next_dither_toggle(toggle);
315 } 315 }
316 } 316 }
317 count &= 3; 317 count &= 3;
318 if (count) { 318 if (count) {
319 Sk4f dist = Sk4f::Min(fast_sqrt(R), max); 319 Sk4f dist = Sk4f::Min(fast_sqrt(R), max);
320 320
321 int fi[4]; 321 uint8_t fi[4];
322 dist.castTrunc().store(fi); 322 dist.toBytes(fi);
323 for (int i = 0; i < count; i++) { 323 for (int i = 0; i < count; i++) {
324 *dstC++ = cache[toggle + fi[i]]; 324 *dstC++ = cache[toggle + fi[i]];
325 toggle = next_dither_toggle(toggle); 325 toggle = next_dither_toggle(toggle);
326 } 326 }
327 } 327 }
328 } 328 }
329 } 329 }
330 330
331 // Unrolling this loop doesn't seem to help (when float); we're stalling to 331 // Unrolling this loop doesn't seem to help (when float); we're stalling to
332 // get the results of the sqrt (?), and don't have enough extra registers to 332 // get the results of the sqrt (?), and don't have enough extra registers to
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
545 str->appendScalar(fCenter.fY); 545 str->appendScalar(fCenter.fY);
546 str->append(") radius: "); 546 str->append(") radius: ");
547 str->appendScalar(fRadius); 547 str->appendScalar(fRadius);
548 str->append(" "); 548 str->append(" ");
549 549
550 this->INHERITED::toString(str); 550 this->INHERITED::toString(str);
551 551
552 str->append(")"); 552 str->append(")");
553 } 553 }
554 #endif 554 #endif
OLDNEW
« no previous file with comments | « src/core/SkNx.h ('k') | src/opts/SkNx_neon.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698