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

Side by Side Diff: tools/Stats.h

Issue 1610823002: Consolidate SK_CRASH and sk_throw into SK_ABORT (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: windows fix Created 4 years, 11 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 | « tests/PathOpsCubicLineIntersectionIdeas.cpp ('k') | tools/sk_tool_utils_font.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 #ifndef Stats_DEFINED 8 #ifndef Stats_DEFINED
9 #define Stats_DEFINED 9 #define Stats_DEFINED
10 10
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 // All samples are the same value. Don't divide by zero. 55 // All samples are the same value. Don't divide by zero.
56 plot.append(kBars[0]); 56 plot.append(kBars[0]);
57 continue; 57 continue;
58 } 58 }
59 59
60 double s = samples[i]; 60 double s = samples[i];
61 s -= min; 61 s -= min;
62 s /= (max - min); 62 s /= (max - min);
63 s *= (SK_ARRAY_COUNT(kBars) - 1); 63 s *= (SK_ARRAY_COUNT(kBars) - 1);
64 const size_t bar = (size_t)(s + 0.5); 64 const size_t bar = (size_t)(s + 0.5);
65 SK_ALWAYSBREAK(bar < SK_ARRAY_COUNT(kBars)); 65 SkASSERT_RELEASE(bar < SK_ARRAY_COUNT(kBars));
66 plot.append(kBars[bar]); 66 plot.append(kBars[bar]);
67 } 67 }
68 } 68 }
69 69
70 double min; 70 double min;
71 double max; 71 double max;
72 double mean; // Estimate of population mean. 72 double mean; // Estimate of population mean.
73 double var; // Estimate of population variance. 73 double var; // Estimate of population variance.
74 double median; 74 double median;
75 SkString plot; // A single-line bar chart (_not_ histogram) of the samples. 75 SkString plot; // A single-line bar chart (_not_ histogram) of the samples.
76 }; 76 };
77 77
78 #endif//Stats_DEFINED 78 #endif//Stats_DEFINED
OLDNEW
« no previous file with comments | « tests/PathOpsCubicLineIntersectionIdeas.cpp ('k') | tools/sk_tool_utils_font.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698