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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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 "main.h"
6 #include "testbase.h"
7
8
9 namespace glbench {
10
11
12 class ClearTest : public TestBase {
13 public:
14 ClearTest() : mask_(0) {}
15 virtual ~ClearTest() {}
16 virtual bool TestFunc(int iter);
17 virtual bool Run();
18
19 private:
20 GLbitfield mask_;
21 DISALLOW_COPY_AND_ASSIGN(ClearTest);
22 };
23
24
25 bool ClearTest::TestFunc(int iter) {
26 GLbitfield mask = mask_;
27 glClear(mask);
28 glFlush(); // Kick GPU as soon as possible
29 for (int i = 0 ; i < iter-1; ++i) {
30 glClear(mask);
31 }
32 return true;
33 }
34
35
36 bool ClearTest::Run() {
37 mask_ = GL_COLOR_BUFFER_BIT;
38 RunTest(this, "mpixels_sec_clear_color", g_width * g_height, true);
39
40 mask_ = GL_DEPTH_BUFFER_BIT;
41 RunTest(this, "mpixels_sec_clear_depth", g_width * g_height, true);
42
43 mask_ = GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT;
44 RunTest(this, "mpixels_sec_clear_colordepth",
45 g_width * g_height, true);
46
47 mask_ = GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT;
48 RunTest(this, "mpixels_sec_clear_depthstencil",
49 g_width * g_height, true);
50
51 mask_ = GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT;
52 RunTest(this, "mpixels_sec_clear_colordepthstencil",
53 g_width * g_height, true);
54 return true;
55 }
56
57
58 TestBase* GetClearTest() {
59 return new ClearTest;
60 }
61
62 } // namespace glbench
OLDNEW
« 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