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 <stdio.h> | 5 #include <stdio.h> |
6 | 6 |
7 #include "testbase.h" | 7 #include "testbase.h" |
8 | 8 |
9 namespace glbench { | 9 namespace glbench { |
10 | 10 |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 void DrawArraysTestFunc::FillRateTestNormalSubWindow(const char* name, | 100 void DrawArraysTestFunc::FillRateTestNormalSubWindow(const char* name, |
101 float width, float height) | 101 float width, float height) |
102 { | 102 { |
103 const int buffer_len = 64; | 103 const int buffer_len = 64; |
104 char buffer[buffer_len]; | 104 char buffer[buffer_len]; |
105 snprintf(buffer, buffer_len, "mpixels_sec_%s", name); | 105 snprintf(buffer, buffer_len, "mpixels_sec_%s", name); |
106 RunTest(this, buffer, width * height, true); | 106 RunTest(this, buffer, width * height, true); |
107 } | 107 } |
108 | 108 |
109 | 109 |
110 #ifndef USE_EGL | 110 #if defined(USE_OPENGL) |
111 void DrawArraysTestFunc::FillRateTestBlendDepth(const char *name) { | 111 void DrawArraysTestFunc::FillRateTestBlendDepth(const char *name) { |
112 const int buffer_len = 64; | 112 const int buffer_len = 64; |
113 char buffer[buffer_len]; | 113 char buffer[buffer_len]; |
114 | 114 |
115 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); | 115 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); |
116 glEnable(GL_BLEND); | 116 glEnable(GL_BLEND); |
117 snprintf(buffer, buffer_len, "mpixels_sec_%s_blended", name); | 117 snprintf(buffer, buffer_len, "mpixels_sec_%s_blended", name); |
118 RunTest(this, buffer, g_width * g_height, true); | 118 RunTest(this, buffer, g_width * g_height, true); |
119 glDisable(GL_BLEND); | 119 glDisable(GL_BLEND); |
120 | 120 |
(...skipping 12 matching lines...) Expand all Loading... |
133 bool DrawElementsTestFunc::TestFunc(int iter) { | 133 bool DrawElementsTestFunc::TestFunc(int iter) { |
134 glDrawElements(GL_TRIANGLES, count_, GL_UNSIGNED_INT, 0); | 134 glDrawElements(GL_TRIANGLES, count_, GL_UNSIGNED_INT, 0); |
135 glFlush(); | 135 glFlush(); |
136 for (int i = 0 ; i < iter-1; ++i) { | 136 for (int i = 0 ; i < iter-1; ++i) { |
137 glDrawElements(GL_TRIANGLES, count_, GL_UNSIGNED_INT, 0); | 137 glDrawElements(GL_TRIANGLES, count_, GL_UNSIGNED_INT, 0); |
138 } | 138 } |
139 return true; | 139 return true; |
140 } | 140 } |
141 | 141 |
142 } // namespace glbench | 142 } // namespace glbench |
OLD | NEW |