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

Side by Side Diff: client/deps/glbench/src/testbase.h

Issue 2913008: Converted fill rate test to GLES2. (Closed) Base URL: ssh://git@chromiumos-git//autotest.git
Patch Set: Created 10 years, 5 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/main.cc ('k') | client/deps/glbench/src/testbase.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 #ifndef BENCH_GL_TESTBASE_H_ 5 #ifndef BENCH_GL_TESTBASE_H_
6 #define BENCH_GL_TESTBASE_H_ 6 #define BENCH_GL_TESTBASE_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 9
10 #include "main.h" 10 #include "main.h"
11 11
12 12
13 namespace glbench { 13 namespace glbench {
14 14
15 class TestBase; 15 class TestBase;
16 16
17 // Runs test->TestFunc() passing it sequential powers of two (8, 16, 32,...) 17 // Runs test->TestFunc() passing it sequential powers of two (8, 16, 32,...)
18 // recording time it took. The data is then fitted linearly, obtaining slope 18 // recording time it took. The data is then fitted linearly, obtaining slope
19 // and bias such that: 19 // and bias such that:
20 // time it took to run x iterations = slope * x + bias 20 // time it took to run x iterations = slope * x + bias
21 // Returns false if one iteration of the test takes longer than 21 // Returns false if one iteration of the test takes longer than
22 // MAX_ITERATION_LENGTH_MS. The test is then assumed too slow to provide 22 // MAX_ITERATION_LENGTH_MS. The test is then assumed too slow to provide
23 // meaningful results. 23 // meaningful results.
24 bool Bench(TestBase* test, float *slope, int64_t *bias); 24 bool Bench(TestBase* test, float *slope, int64_t *bias);
25 25
26 // Runs Bench on an instance of TestBase and prints out results. 26 // Runs Bench on an instance of TestBase and prints out results.
27 // 27 //
28 // coefficient is multiplied (if inverse is false) or divided (if inverse is 28 // coefficient is multiplied (if inverse is false) or divided (if inverse is
29 // true) by the slope and the result is printed. 29 // true) by the slope and the result is printed.
30 // 30 //
31 // Examples: 31 // Examples:
32 // coefficient = width * height (measured in pixels), inverse = true 32 // coefficient = width * height (measured in pixels), inverse = true
33 // returns the throughput in megapixels per second; 33 // returns the throughput in megapixels per second;
34 // 34 //
35 // coefficient = 1, inverse = false 35 // coefficient = 1, inverse = false
36 // returns number of operations per second. 36 // returns number of operations per second.
37 void RunTest(TestBase* test, const char *name, float coefficient, bool inverse); 37 void RunTest(TestBase* test, const char *name, float coefficient, bool inverse);
(...skipping 14 matching lines...) Expand all
52 public: 52 public:
53 virtual ~DrawArraysTestFunc() {} 53 virtual ~DrawArraysTestFunc() {}
54 virtual bool TestFunc(int); 54 virtual bool TestFunc(int);
55 55
56 // Runs the test and reports results in mpixels per second, assuming each 56 // Runs the test and reports results in mpixels per second, assuming each
57 // iteration updates the whole window (its size is g_width by g_height). 57 // iteration updates the whole window (its size is g_width by g_height).
58 void FillRateTestNormal(const char* name); 58 void FillRateTestNormal(const char* name);
59 // Runs the test and reports results in mpixels per second, assuming each 59 // Runs the test and reports results in mpixels per second, assuming each
60 // iteration updates a window of width by height pixels. 60 // iteration updates a window of width by height pixels.
61 void FillRateTestNormalSubWindow(const char* name, float width, float height); 61 void FillRateTestNormalSubWindow(const char* name, float width, float height);
62 #if defined(USE_OPENGL)
63 // Runs the test three times: with blending on; with depth test enabled and 62 // Runs the test three times: with blending on; with depth test enabled and
64 // depth function of GL_NOTEQUAL; with depth function GL_NEVER. Results are 63 // depth function of GL_NOTEQUAL; with depth function GL_NEVER. Results are
65 // reported as in FillRateTestNormal. 64 // reported as in FillRateTestNormal.
66 void FillRateTestBlendDepth(const char *name); 65 void FillRateTestBlendDepth(const char *name);
67 #endif
68 }; 66 };
69 67
70 // Helper class to time glDrawElements. 68 // Helper class to time glDrawElements.
71 class DrawElementsTestFunc : public TestBase { 69 class DrawElementsTestFunc : public TestBase {
72 public: 70 public:
73 DrawElementsTestFunc() : count_(0) {} 71 DrawElementsTestFunc() : count_(0) {}
74 virtual ~DrawElementsTestFunc() {} 72 virtual ~DrawElementsTestFunc() {}
75 virtual bool TestFunc(int); 73 virtual bool TestFunc(int);
76 74
77 protected: 75 protected:
78 // Passed to glDrawElements. 76 // Passed to glDrawElements.
79 GLsizei count_; 77 GLsizei count_;
80 }; 78 };
81 79
82 } // namespace glbench 80 } // namespace glbench
83 81
84 #endif // BENCH_GL_TESTBASE_H_ 82 #endif // BENCH_GL_TESTBASE_H_
OLDNEW
« no previous file with comments | « client/deps/glbench/src/main.cc ('k') | client/deps/glbench/src/testbase.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698