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

Side by Side Diff: bench/PMFloatBench.cpp

Issue 1055123002: New names for SkPMFloat methods. (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: one more Created 5 years, 8 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/SkPMFloat.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 "SkPMFloat.h" 9 #include "SkPMFloat.h"
10 10
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 } else { 62 } else {
63 fa = SkPMFloat::FromPMColor(colors[0]); 63 fa = SkPMFloat::FromPMColor(colors[0]);
64 fb = SkPMFloat::FromPMColor(colors[1]); 64 fb = SkPMFloat::FromPMColor(colors[1]);
65 fc = SkPMFloat::FromPMColor(colors[2]); 65 fc = SkPMFloat::FromPMColor(colors[2]);
66 fd = SkPMFloat::FromPMColor(colors[3]); 66 fd = SkPMFloat::FromPMColor(colors[3]);
67 } 67 }
68 68
69 SkPMColor back[4]; 69 SkPMColor back[4];
70 switch (kClamp << 1 | kWide) { 70 switch (kClamp << 1 | kWide) {
71 case 0: { 71 case 0: {
72 back[0] = fa.get(); 72 back[0] = fa.round();
73 back[1] = fb.get(); 73 back[1] = fb.round();
74 back[2] = fc.get(); 74 back[2] = fc.round();
75 back[3] = fd.get(); 75 back[3] = fd.round();
76 } break; 76 } break;
77 case 1: SkPMFloat::To4PMColors(fa, fb, fc, fd, back); break; 77 case 1: SkPMFloat::RoundTo4PMColors(fa, fb, fc, fd, back); break ;
78 case 2: { 78 case 2: {
79 back[0] = fa.clamped(); 79 back[0] = fa.roundClamp();
80 back[1] = fb.clamped(); 80 back[1] = fb.roundClamp();
81 back[2] = fc.clamped(); 81 back[2] = fc.roundClamp();
82 back[3] = fd.clamped(); 82 back[3] = fd.roundClamp();
83 } break; 83 } break;
84 case 3: SkPMFloat::ClampTo4PMColors(fa, fb, fc, fd, back); break ; 84 case 3: SkPMFloat::RoundClampTo4PMColors(fa, fb, fc, fd, back); break;
85 } 85 }
86 for (int i = 0; i < 4; i++) { 86 for (int i = 0; i < 4; i++) {
87 junk ^= back[i]; 87 junk ^= back[i];
88 } 88 }
89 } 89 }
90 blackhole ^= junk; 90 blackhole ^= junk;
91 } 91 }
92 }; 92 };
93 93
94 // Extra () help DEF_BENCH not get confused by the comma inside the <>. 94 // Extra () help DEF_BENCH not get confused by the comma inside the <>.
(...skipping 29 matching lines...) Expand all
124 a += dcdx4; 124 a += dcdx4;
125 b += dcdx4; 125 b += dcdx4;
126 c += dcdx4; 126 c += dcdx4;
127 d += dcdx4; 127 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/SkPMFloat.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698