OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium 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 "gpu/command_buffer/service/test_helper.h" | 5 #include "gpu/command_buffer/service/test_helper.h" |
6 | 6 |
| 7 #include <algorithm> |
7 #include <string> | 8 #include <string> |
8 #include <algorithm> | |
9 | 9 |
10 #include "base/string_number_conversions.h" | 10 #include "base/string_number_conversions.h" |
11 #include "base/string_tokenizer.h" | 11 #include "base/strings/string_tokenizer.h" |
12 #include "gpu/command_buffer/common/types.h" | 12 #include "gpu/command_buffer/common/types.h" |
13 #include "gpu/command_buffer/service/gl_utils.h" | 13 #include "gpu/command_buffer/service/gl_utils.h" |
14 #include "gpu/command_buffer/service/program_manager.h" | 14 #include "gpu/command_buffer/service/program_manager.h" |
15 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
16 #include "ui/gl/gl_mock.h" | 16 #include "ui/gl/gl_mock.h" |
17 | 17 |
18 using ::testing::_; | 18 using ::testing::_; |
19 using ::testing::DoAll; | 19 using ::testing::DoAll; |
20 using ::testing::InSequence; | 20 using ::testing::InSequence; |
21 using ::testing::MatcherCast; | 21 using ::testing::MatcherCast; |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 void TestHelper::SetupTextureManagerInitExpectations( | 136 void TestHelper::SetupTextureManagerInitExpectations( |
137 ::gfx::MockGLInterface* gl, | 137 ::gfx::MockGLInterface* gl, |
138 const char* extensions) { | 138 const char* extensions) { |
139 InSequence sequence; | 139 InSequence sequence; |
140 | 140 |
141 SetupTextureInitializationExpectations(gl, GL_TEXTURE_2D); | 141 SetupTextureInitializationExpectations(gl, GL_TEXTURE_2D); |
142 SetupTextureInitializationExpectations(gl, GL_TEXTURE_CUBE_MAP); | 142 SetupTextureInitializationExpectations(gl, GL_TEXTURE_CUBE_MAP); |
143 | 143 |
144 bool ext_image_external = false; | 144 bool ext_image_external = false; |
145 bool arb_texture_rectangle = false; | 145 bool arb_texture_rectangle = false; |
146 CStringTokenizer t(extensions, extensions + strlen(extensions), " "); | 146 base::CStringTokenizer t(extensions, extensions + strlen(extensions), " "); |
147 while (t.GetNext()) { | 147 while (t.GetNext()) { |
148 if (t.token() == "GL_OES_EGL_image_external") { | 148 if (t.token() == "GL_OES_EGL_image_external") { |
149 ext_image_external = true; | 149 ext_image_external = true; |
150 break; | 150 break; |
151 } | 151 } |
152 if (t.token() == "GL_ARB_texture_rectangle") { | 152 if (t.token() == "GL_ARB_texture_rectangle") { |
153 arb_texture_rectangle = true; | 153 arb_texture_rectangle = true; |
154 break; | 154 break; |
155 } | 155 } |
156 } | 156 } |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 } | 189 } |
190 | 190 |
191 void TestHelper::SetupTextureManagerDestructionExpectations( | 191 void TestHelper::SetupTextureManagerDestructionExpectations( |
192 ::gfx::MockGLInterface* gl, | 192 ::gfx::MockGLInterface* gl, |
193 const char* extensions) { | 193 const char* extensions) { |
194 SetupTextureDestructionExpectations(gl, GL_TEXTURE_2D); | 194 SetupTextureDestructionExpectations(gl, GL_TEXTURE_2D); |
195 SetupTextureDestructionExpectations(gl, GL_TEXTURE_CUBE_MAP); | 195 SetupTextureDestructionExpectations(gl, GL_TEXTURE_CUBE_MAP); |
196 | 196 |
197 bool ext_image_external = false; | 197 bool ext_image_external = false; |
198 bool arb_texture_rectangle = false; | 198 bool arb_texture_rectangle = false; |
199 CStringTokenizer t(extensions, extensions + strlen(extensions), " "); | 199 base::CStringTokenizer t(extensions, extensions + strlen(extensions), " "); |
200 while (t.GetNext()) { | 200 while (t.GetNext()) { |
201 if (t.token() == "GL_OES_EGL_image_external") { | 201 if (t.token() == "GL_OES_EGL_image_external") { |
202 ext_image_external = true; | 202 ext_image_external = true; |
203 break; | 203 break; |
204 } | 204 } |
205 if (t.token() == "GL_ARB_texture_rectangle") { | 205 if (t.token() == "GL_ARB_texture_rectangle") { |
206 arb_texture_rectangle = true; | 206 arb_texture_rectangle = true; |
207 break; | 207 break; |
208 } | 208 } |
209 } | 209 } |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
487 .Times(1) | 487 .Times(1) |
488 .RetiresOnSaturation(); | 488 .RetiresOnSaturation(); |
489 | 489 |
490 SetupProgramSuccessExpectations( | 490 SetupProgramSuccessExpectations( |
491 gl, attribs, num_attribs, uniforms, num_uniforms, service_id); | 491 gl, attribs, num_attribs, uniforms, num_uniforms, service_id); |
492 } | 492 } |
493 | 493 |
494 } // namespace gles2 | 494 } // namespace gles2 |
495 } // namespace gpu | 495 } // namespace gpu |
496 | 496 |
OLD | NEW |