| 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 #include <gflags/gflags.h> | 5 #include <gflags/gflags.h> |
| 6 #include <stdio.h> | 6 #include <stdio.h> |
| 7 #include <stdlib.h> | 7 #include <stdlib.h> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 } | 57 } |
| 58 | 58 |
| 59 vector<string> enabled_tests; | 59 vector<string> enabled_tests; |
| 60 SplitString(FLAGS_tests, ':', &enabled_tests); | 60 SplitString(FLAGS_tests, ':', &enabled_tests); |
| 61 | 61 |
| 62 glbench::TestBase* tests[] = { | 62 glbench::TestBase* tests[] = { |
| 63 glbench::GetSwapTest(), | 63 glbench::GetSwapTest(), |
| 64 glbench::GetClearTest(), | 64 glbench::GetClearTest(), |
| 65 #if defined(USE_OPENGL) | 65 #if defined(USE_OPENGL) |
| 66 glbench::GetFillRateTest(), | 66 glbench::GetFillRateTest(), |
| 67 glbench::GetTriangleSetupTest(), | |
| 68 glbench::GetWindowManagerCompositingTest(false), | 67 glbench::GetWindowManagerCompositingTest(false), |
| 69 glbench::GetWindowManagerCompositingTest(true), | 68 glbench::GetWindowManagerCompositingTest(true), |
| 70 #endif | 69 #endif |
| 70 glbench::GetTriangleSetupTest(), |
| 71 glbench::GetYuvToRgbTest(), | 71 glbench::GetYuvToRgbTest(), |
| 72 glbench::GetReadPixelTest(), | 72 glbench::GetReadPixelTest(), |
| 73 glbench::GetAttributeFetchShaderTest(), | 73 glbench::GetAttributeFetchShaderTest(), |
| 74 glbench::GetVaryingsAndDdxyShaderTest(), | 74 glbench::GetVaryingsAndDdxyShaderTest(), |
| 75 glbench::GetTextureUpdateTest(), | 75 glbench::GetTextureUpdateTest(), |
| 76 }; | 76 }; |
| 77 | 77 |
| 78 uint64_t done = GetUTime() + 1000000ULL * FLAGS_duration; | 78 uint64_t done = GetUTime() + 1000000ULL * FLAGS_duration; |
| 79 do { | 79 do { |
| 80 for (unsigned int i = 0; i < arraysize(tests); i++) { | 80 for (unsigned int i = 0; i < arraysize(tests); i++) { |
| 81 if (!test_is_enabled(tests[i], enabled_tests)) | 81 if (!test_is_enabled(tests[i], enabled_tests)) |
| 82 continue; | 82 continue; |
| 83 InitContext(); | 83 InitContext(); |
| 84 tests[i]->Run(); | 84 tests[i]->Run(); |
| 85 DestroyContext(); | 85 DestroyContext(); |
| 86 } | 86 } |
| 87 } while (GetUTime() < done); | 87 } while (GetUTime() < done); |
| 88 | 88 |
| 89 for (unsigned int i = 0; i < arraysize(tests); i++) { | 89 for (unsigned int i = 0; i < arraysize(tests); i++) { |
| 90 delete tests[i]; | 90 delete tests[i]; |
| 91 tests[i] = NULL; | 91 tests[i] = NULL; |
| 92 } | 92 } |
| 93 | 93 |
| 94 return 0; | 94 return 0; |
| 95 } | 95 } |
| OLD | NEW |