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

Side by Side Diff: bench/PMFloatBench.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 | « no previous file | 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 2015 Google Inc. 2 * Copyright 2015 Google Inc.
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 #include "Benchmark.h" 8 #include "Benchmark.h"
9 #include "SkPMFloat.h" 9 #include "SkPMFloat.h"
10 10
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 for (int n = 0; n < loops; n++) { 114 for (int n = 0; n < loops; n++) {
115 Sk4f a = c0 + dc*fx + Sk4f(0.5f), // The +0.5f lets us call trunc() instead of get(). 115 Sk4f a = c0 + dc*fx + Sk4f(0.5f), // The +0.5f lets us call trunc() instead of get().
116 b = a + dcdx, 116 b = a + dcdx,
117 c = b + dcdx, 117 c = b + dcdx,
118 d = c + dcdx; 118 d = c + dcdx;
119 for (size_t i = 0; i < SK_ARRAY_COUNT(fDevice); i += 4) { 119 for (size_t i = 0; i < SK_ARRAY_COUNT(fDevice); i += 4) {
120 fDevice[i+0] = SkPMFloat(a).trunc(); 120 fDevice[i+0] = SkPMFloat(a).trunc();
121 fDevice[i+1] = SkPMFloat(b).trunc(); 121 fDevice[i+1] = SkPMFloat(b).trunc();
122 fDevice[i+2] = SkPMFloat(c).trunc(); 122 fDevice[i+2] = SkPMFloat(c).trunc();
123 fDevice[i+3] = SkPMFloat(d).trunc(); 123 fDevice[i+3] = SkPMFloat(d).trunc();
124 a += dcdx4; 124 a = a + dcdx4;
125 b += dcdx4; 125 b = b + dcdx4;
126 c += dcdx4; 126 c = c + dcdx4;
127 d += dcdx4; 127 d = d + dcdx4;
128 } 128 }
129 } 129 }
130 } 130 }
131 }; 131 };
132 132
133 DEF_BENCH(return new PMFloatGradientBench;) 133 DEF_BENCH(return new PMFloatGradientBench;)
OLDNEW
« no previous file with comments | « no previous file | src/core/SkGeometry.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698