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_number_conversions.h" |
7 #include "base/string_util.h" | 8 #include "base/string_util.h" |
8 | 9 |
9 #include "main.h" | 10 #include "main.h" |
10 #include "testbase.h" | 11 #include "testbase.h" |
11 #include "utils.h" | 12 #include "utils.h" |
12 | 13 |
13 namespace glbench { | 14 namespace glbench { |
14 | 15 |
15 static const int kNumberOfTextures = 8; | 16 static const int kNumberOfTextures = 8; |
16 | 17 |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 | 125 |
125 UpdateFlavor flavors[] = {TEX_IMAGE, TEX_SUBIMAGE}; | 126 UpdateFlavor flavors[] = {TEX_IMAGE, TEX_SUBIMAGE}; |
126 const std::string flavor_names[] = { | 127 const std::string flavor_names[] = { |
127 "texture_update_teximage2d", "texture_update_texsubimage2d" | 128 "texture_update_teximage2d", "texture_update_texsubimage2d" |
128 }; | 129 }; |
129 for (unsigned int f = 0; f < arraysize(flavors); f++) { | 130 for (unsigned int f = 0; f < arraysize(flavors); f++) { |
130 flavor_ = flavors[f]; | 131 flavor_ = flavors[f]; |
131 int sizes[] = {32, 128, 256, 512, 768, 1024, 1536, 2048}; | 132 int sizes[] = {32, 128, 256, 512, 768, 1024, 1536, 2048}; |
132 for (unsigned int i = 0; i < arraysize(sizes); i++) { | 133 for (unsigned int i = 0; i < arraysize(sizes); i++) { |
133 std::string name = "mtexel_sec_" + flavor_names[f] + "_" + | 134 std::string name = "mtexel_sec_" + flavor_names[f] + "_" + |
134 IntToString(sizes[i]); | 135 base::IntToString(sizes[i]); |
135 width_ = height_ = sizes[i]; | 136 width_ = height_ = sizes[i]; |
136 for (int i = 0; i < kNumberOfTextures; ++i) { | 137 for (int i = 0; i < kNumberOfTextures; ++i) { |
137 pixels_[i].reset(new char[width_ * height_]); | 138 pixels_[i].reset(new char[width_ * height_]); |
138 memset(pixels_[i].get(), 255, width_ * height_); | 139 memset(pixels_[i].get(), 255, width_ * height_); |
139 } | 140 } |
140 RunTest(this, name.c_str(), width_ * height_, true); | 141 RunTest(this, name.c_str(), width_ * height_, true); |
141 } | 142 } |
142 } | 143 } |
143 | 144 |
144 glDeleteTextures(1, &texname); | 145 glDeleteTextures(1, &texname); |
145 glDeleteProgram(program_); | 146 glDeleteProgram(program_); |
146 return true; | 147 return true; |
147 } | 148 } |
148 | 149 |
149 TestBase* GetTextureUpdateTest() { | 150 TestBase* GetTextureUpdateTest() { |
150 return new TextureUpdateTest; | 151 return new TextureUpdateTest; |
151 } | 152 } |
152 | 153 |
153 } // namespace glbench | 154 } // namespace glbench |
OLD | NEW |