Index: client/deps/glbench/src/swaptest.cc |
diff --git a/client/deps/glbench/src/swaptest.cc b/client/deps/glbench/src/swaptest.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..f02acbe19ec0864d77ef9154c89958e558691f63 |
--- /dev/null |
+++ b/client/deps/glbench/src/swaptest.cc |
@@ -0,0 +1,42 @@ |
+// Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "main.h" |
+#include "testbase.h" |
+ |
+ |
+namespace glbench { |
+ |
+ |
+class SwapTest : public TestBase { |
+ public: |
+ SwapTest() {} |
+ virtual ~SwapTest() {} |
+ virtual bool TestFunc(int iter); |
+ virtual bool Run(); |
+ |
+ private: |
+ DISALLOW_COPY_AND_ASSIGN(SwapTest); |
+}; |
+ |
+ |
+bool SwapTest::TestFunc(int iter) { |
+ for (int i = 0 ; i < iter; ++i) { |
+ SwapBuffers(); |
+ } |
+ return true; |
+} |
+ |
+ |
+bool SwapTest::Run() { |
+ RunTest(this, "us_swap_swap", 1.f, false); |
+ return true; |
+} |
+ |
+ |
+TestBase* GetSwapTest() { |
+ return new SwapTest; |
+} |
+ |
+} // namespace glbench |