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 "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 Loading... |
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 |
OLD | NEW |