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

Side by Side Diff: client/deps/glbench/src.orig/bench.cc

Issue 870005: Move gl_Bench into a dep so that it can be re-used among tests (Closed)
Patch Set: Created 10 years, 9 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 | « client/deps/glbench/src.orig/Makefile ('k') | client/deps/glbench/src.orig/egl_stuff.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "main.h" 5 #include "main.h"
6 6
7 uint64_t TimeBench(BenchFunc func, int iter) { 7 uint64_t TimeBench(BenchFunc func, int iter) {
8 SwapBuffers(); 8 SwapBuffers();
9 glFinish(); 9 glFinish();
10 uint64_t time1 = GetUTime(); 10 uint64_t time1 = GetUTime();
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 } 47 }
48 if (count < 2) { 48 if (count < 2) {
49 *slope = 0.f; 49 *slope = 0.f;
50 *bias = 0; 50 *bias = 0;
51 } 51 }
52 *slope = static_cast<float>(sum_x * sum_y - count * sum_xy) / 52 *slope = static_cast<float>(sum_x * sum_y - count * sum_xy) /
53 (sum_x * sum_x - count * sum_x2); 53 (sum_x * sum_x - count * sum_x2);
54 *bias = (sum_x * sum_xy - sum_x2 * sum_y) / (sum_x * sum_x - count * sum_x2); 54 *bias = (sum_x * sum_xy - sum_x2 * sum_y) / (sum_x * sum_x - count * sum_x2);
55 return true; 55 return true;
56 } 56 }
OLDNEW
« no previous file with comments | « client/deps/glbench/src.orig/Makefile ('k') | client/deps/glbench/src.orig/egl_stuff.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698