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

Side by Side Diff: client/deps/glbench/src/textureupdatetest.cc

Issue 2809010: Initialize textures for reproducible test results. (Closed) Base URL: ssh://git@chromiumos-git//autotest.git
Patch Set: Created 10 years, 6 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "base/logging.h" 5 #include "base/logging.h"
6 #include "base/scoped_ptr.h" 6 #include "base/scoped_ptr.h"
7 #include "base/string_util.h" 7 #include "base/string_util.h"
8 8
9 #include "main.h" 9 #include "main.h"
10 #include "testbase.h" 10 #include "testbase.h"
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 const std::string flavor_names[] = { 126 const std::string flavor_names[] = {
127 "texture_update_teximage2d", "texture_update_texsubimage2d" 127 "texture_update_teximage2d", "texture_update_texsubimage2d"
128 }; 128 };
129 for (unsigned int f = 0; f < arraysize(flavors); f++) { 129 for (unsigned int f = 0; f < arraysize(flavors); f++) {
130 flavor_ = flavors[f]; 130 flavor_ = flavors[f];
131 int sizes[] = {32, 128, 256, 512, 768, 1024, 1536, 2048}; 131 int sizes[] = {32, 128, 256, 512, 768, 1024, 1536, 2048};
132 for (unsigned int i = 0; i < arraysize(sizes); i++) { 132 for (unsigned int i = 0; i < arraysize(sizes); i++) {
133 std::string name = "mtexel_sec_" + flavor_names[f] + "_" + 133 std::string name = "mtexel_sec_" + flavor_names[f] + "_" +
134 IntToString(sizes[i]); 134 IntToString(sizes[i]);
135 width_ = height_ = sizes[i]; 135 width_ = height_ = sizes[i];
136 for (int i = 0; i < kNumberOfTextures; ++i) 136 for (int i = 0; i < kNumberOfTextures; ++i) {
137 pixels_[i].reset(new char[width_ * height_]); 137 pixels_[i].reset(new char[width_ * height_]);
138 memset(pixels_[i].get(), 255, width_ * height_);
139 }
138 RunTest(this, name.c_str(), width_ * height_, true); 140 RunTest(this, name.c_str(), width_ * height_, true);
139 } 141 }
140 } 142 }
141 143
142 glDeleteTextures(1, &texname); 144 glDeleteTextures(1, &texname);
143 glDeleteProgram(program_); 145 glDeleteProgram(program_);
144 return true; 146 return true;
145 } 147 }
146 148
147 TestBase* GetTextureUpdateTest() { 149 TestBase* GetTextureUpdateTest() {
148 return new TextureUpdateTest; 150 return new TextureUpdateTest;
149 } 151 }
150 152
151 } // namespace glbench 153 } // namespace glbench
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698