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 3 // found in the LICENSE file. 4 5 #include "glinterface.h" 6 #include "glinterfacetest.h" 7 #include "main.h" 8 9 namespace glbench { 10 11 class SwapTest : public GLInterfaceTest { 12 public: SwapTest()13 SwapTest() {} ~SwapTest()14 virtual ~SwapTest() {} 15 virtual bool TestFunc(uint64_t iterations); Name() const16 virtual const char* Name() const { return "swap"; } 17 18 private: 19 DISALLOW_COPY_AND_ASSIGN(SwapTest); 20 }; 21 TestFunc(uint64_t iterations)22bool SwapTest::TestFunc(uint64_t iterations) { 23 for (uint64_t i = 0; i < iterations; ++i) { 24 if (!render_func_.is_null()) 25 render_func_.Run(); 26 g_main_gl_interface->SwapBuffers(); 27 } 28 return true; 29 } 30 GetSwapTest()31TestBase* GetSwapTest() { 32 return new SwapTest; 33 } 34 35 } // namespace glbench 36