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

Side by Side Diff: bench/Sk4fBench.cpp

Issue 1483953002: Add Sk4f::ToBytes(uint8_t[16], Sk4f, Sk4f, Sk4f, Sk4f) (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix neon Created 5 years 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/SkNx.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 * 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 "SkColor.h" 9 #include "SkColor.h"
10 #include "SkNx.h" 10 #include "SkNx.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 dx(0.002f), 55 dx(0.002f),
56 dcdx(dc*dx), 56 dcdx(dc*dx),
57 dcdx4(dcdx+dcdx+dcdx+dcdx); 57 dcdx4(dcdx+dcdx+dcdx+dcdx);
58 58
59 for (int n = 0; n < loops; n++) { 59 for (int n = 0; n < loops; n++) {
60 Sk4f a = c0 + dc*fx + Sk4f(0.5f), // add an extra 0.5f to get round ing for free. 60 Sk4f a = c0 + dc*fx + Sk4f(0.5f), // add an extra 0.5f to get round ing for free.
61 b = a + dcdx, 61 b = a + dcdx,
62 c = b + dcdx, 62 c = b + dcdx,
63 d = c + dcdx; 63 d = c + dcdx;
64 for (size_t i = 0; i < SK_ARRAY_COUNT(fDevice); i += 4) { 64 for (size_t i = 0; i < SK_ARRAY_COUNT(fDevice); i += 4) {
65 a.toBytes((uint8_t*)(fDevice+i+0)); 65 Sk4f::ToBytes((uint8_t*)(fDevice+i), a, b, c, d);
66 b.toBytes((uint8_t*)(fDevice+i+1));
67 c.toBytes((uint8_t*)(fDevice+i+2));
68 d.toBytes((uint8_t*)(fDevice+i+3));
69 a = a + dcdx4; 66 a = a + dcdx4;
70 b = b + dcdx4; 67 b = b + dcdx4;
71 c = c + dcdx4; 68 c = c + dcdx4;
72 d = d + dcdx4; 69 d = d + dcdx4;
73 } 70 }
74 } 71 }
75 } 72 }
76 }; 73 };
77 DEF_BENCH(return new Sk4fGradientBench;) 74 DEF_BENCH(return new Sk4fGradientBench;)
OLDNEW
« no previous file with comments | « no previous file | src/core/SkNx.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698