| OLD | NEW |
| 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" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 void RunTest(TestBase* test, const char *name, float coefficient, bool inverse); | 37 void RunTest(TestBase* test, const char *name, float coefficient, bool inverse); |
| 38 | 38 |
| 39 | 39 |
| 40 class TestBase { | 40 class TestBase { |
| 41 public: | 41 public: |
| 42 virtual ~TestBase() {} | 42 virtual ~TestBase() {} |
| 43 // Runs the test case n times. | 43 // Runs the test case n times. |
| 44 virtual bool TestFunc(int n) = 0; | 44 virtual bool TestFunc(int n) = 0; |
| 45 // Main entry point into the test. | 45 // Main entry point into the test. |
| 46 virtual bool Run() = 0; | 46 virtual bool Run() = 0; |
| 47 virtual const char* Name() const = 0; |
| 47 }; | 48 }; |
| 48 | 49 |
| 49 // Helper class to time glDrawArrays. | 50 // Helper class to time glDrawArrays. |
| 50 class DrawArraysTestFunc : public TestBase { | 51 class DrawArraysTestFunc : public TestBase { |
| 51 public: | 52 public: |
| 52 virtual ~DrawArraysTestFunc() {} | 53 virtual ~DrawArraysTestFunc() {} |
| 53 virtual bool TestFunc(int); | 54 virtual bool TestFunc(int); |
| 54 | 55 |
| 55 // 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 |
| 56 // 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). |
| (...skipping 17 matching lines...) Expand all Loading... |
| 74 virtual bool TestFunc(int); | 75 virtual bool TestFunc(int); |
| 75 | 76 |
| 76 protected: | 77 protected: |
| 77 // Passed to glDrawElements. | 78 // Passed to glDrawElements. |
| 78 GLsizei count_; | 79 GLsizei count_; |
| 79 }; | 80 }; |
| 80 | 81 |
| 81 } // namespace glbench | 82 } // namespace glbench |
| 82 | 83 |
| 83 #endif // BENCH_GL_TESTBASE_H_ | 84 #endif // BENCH_GL_TESTBASE_H_ |
| OLD | NEW |