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

Unified Diff: client/deps/glbench/src/cleartest.cc

Issue 2123013: Split tests into individual files. Got rid of globals by converting them to classes. (Closed) Base URL: ssh://git@chromiumos-git//autotest.git
Patch Set: addressed comments Created 10 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « client/deps/glbench/src/bench.cc ('k') | client/deps/glbench/src/fillratetest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/deps/glbench/src/cleartest.cc
diff --git a/client/deps/glbench/src/cleartest.cc b/client/deps/glbench/src/cleartest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..8ef0491eca58399bf9d51624e99dd6accecd5700
--- /dev/null
+++ b/client/deps/glbench/src/cleartest.cc
@@ -0,0 +1,62 @@
+// 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 ClearTest : public TestBase {
+ public:
+ ClearTest() : mask_(0) {}
+ virtual ~ClearTest() {}
+ virtual bool TestFunc(int iter);
+ virtual bool Run();
+
+ private:
+ GLbitfield mask_;
+ DISALLOW_COPY_AND_ASSIGN(ClearTest);
+};
+
+
+bool ClearTest::TestFunc(int iter) {
+ GLbitfield mask = mask_;
+ glClear(mask);
+ glFlush(); // Kick GPU as soon as possible
+ for (int i = 0 ; i < iter-1; ++i) {
+ glClear(mask);
+ }
+ return true;
+}
+
+
+bool ClearTest::Run() {
+ mask_ = GL_COLOR_BUFFER_BIT;
+ RunTest(this, "mpixels_sec_clear_color", g_width * g_height, true);
+
+ mask_ = GL_DEPTH_BUFFER_BIT;
+ RunTest(this, "mpixels_sec_clear_depth", g_width * g_height, true);
+
+ mask_ = GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT;
+ RunTest(this, "mpixels_sec_clear_colordepth",
+ g_width * g_height, true);
+
+ mask_ = GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT;
+ RunTest(this, "mpixels_sec_clear_depthstencil",
+ g_width * g_height, true);
+
+ mask_ = GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT;
+ RunTest(this, "mpixels_sec_clear_colordepthstencil",
+ g_width * g_height, true);
+ return true;
+}
+
+
+TestBase* GetClearTest() {
+ return new ClearTest;
+}
+
+} // namespace glbench
« no previous file with comments | « client/deps/glbench/src/bench.cc ('k') | client/deps/glbench/src/fillratetest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698