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

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

Issue 1167153002: Remove overly-promiscuous SkNx syntax sugar. (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: update test Created 5 years, 6 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/SkScan_Hairline.cpp ('k') | tests/SkNxTest.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 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 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 const Sk4f dy4(sdy * 4); 313 const Sk4f dy4(sdy * 4);
314 314
315 Sk4f tmpxy = fx4 * dx4 + fy4 * dy4; 315 Sk4f tmpxy = fx4 * dx4 + fy4 * dy4;
316 Sk4f tmpdxdy = sum_squares(dx4, dy4); 316 Sk4f tmpdxdy = sum_squares(dx4, dy4);
317 Sk4f R = sum_squares(fx4, fy4); 317 Sk4f R = sum_squares(fx4, fy4);
318 Sk4f dR = tmpxy + tmpxy + tmpdxdy; 318 Sk4f dR = tmpxy + tmpxy + tmpdxdy;
319 const Sk4f ddR = tmpdxdy + tmpdxdy; 319 const Sk4f ddR = tmpdxdy + tmpdxdy;
320 320
321 for (int i = 0; i < (count >> 2); ++i) { 321 for (int i = 0; i < (count >> 2); ++i) {
322 Sk4f dist = Sk4f::Min(fast_sqrt(R), max); 322 Sk4f dist = Sk4f::Min(fast_sqrt(R), max);
323 R += dR; 323 R = R + dR;
324 dR += ddR; 324 dR = dR + ddR;
325 325
326 int fi[4]; 326 int fi[4];
327 dist.castTrunc().store(fi); 327 dist.castTrunc().store(fi);
328 328
329 for (int i = 0; i < 4; i++) { 329 for (int i = 0; i < 4; i++) {
330 *dstC++ = cache[toggle + fi[i]]; 330 *dstC++ = cache[toggle + fi[i]];
331 toggle = next_dither_toggle(toggle); 331 toggle = next_dither_toggle(toggle);
332 } 332 }
333 } 333 }
334 count &= 3; 334 count &= 3;
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
587 str->appendScalar(fCenter.fY); 587 str->appendScalar(fCenter.fY);
588 str->append(") radius: "); 588 str->append(") radius: ");
589 str->appendScalar(fRadius); 589 str->appendScalar(fRadius);
590 str->append(" "); 590 str->append(" ");
591 591
592 this->INHERITED::toString(str); 592 this->INHERITED::toString(str);
593 593
594 str->append(")"); 594 str->append(")");
595 } 595 }
596 #endif 596 #endif
OLDNEW
« no previous file with comments | « src/core/SkScan_Hairline.cpp ('k') | tests/SkNxTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698