Chromium Code Reviews| 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/gles2_cmd_decoder_unittest_base.h" | 5 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/command_line.h" | |
| 11 #include "base/strings/string_number_conversions.h" | 12 #include "base/strings/string_number_conversions.h" |
| 12 #include "base/strings/string_split.h" | 13 #include "base/strings/string_split.h" |
| 13 #include "gpu/command_buffer/common/gles2_cmd_format.h" | 14 #include "gpu/command_buffer/common/gles2_cmd_format.h" |
| 14 #include "gpu/command_buffer/common/gles2_cmd_utils.h" | 15 #include "gpu/command_buffer/common/gles2_cmd_utils.h" |
| 15 #include "gpu/command_buffer/common/value_state.h" | 16 #include "gpu/command_buffer/common/value_state.h" |
| 16 #include "gpu/command_buffer/service/cmd_buffer_engine.h" | 17 #include "gpu/command_buffer/service/cmd_buffer_engine.h" |
| 17 #include "gpu/command_buffer/service/context_group.h" | 18 #include "gpu/command_buffer/service/context_group.h" |
| 18 #include "gpu/command_buffer/service/logger.h" | 19 #include "gpu/command_buffer/service/logger.h" |
| 19 #include "gpu/command_buffer/service/mailbox_manager.h" | 20 #include "gpu/command_buffer/service/mailbox_manager.h" |
| 20 #include "gpu/command_buffer/service/program_manager.h" | 21 #include "gpu/command_buffer/service/program_manager.h" |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 156 request_alpha(false), | 157 request_alpha(false), |
| 157 request_depth(false), | 158 request_depth(false), |
| 158 request_stencil(false), | 159 request_stencil(false), |
| 159 bind_generates_resource(false), | 160 bind_generates_resource(false), |
| 160 lose_context_when_out_of_memory(false), | 161 lose_context_when_out_of_memory(false), |
| 161 use_native_vao(true), | 162 use_native_vao(true), |
| 162 webgl_version(0) { | 163 webgl_version(0) { |
| 163 } | 164 } |
| 164 | 165 |
| 165 void GLES2DecoderTestBase::InitDecoder(const InitState& init) { | 166 void GLES2DecoderTestBase::InitDecoder(const InitState& init) { |
| 166 InitDecoderWithCommandLine(init, NULL); | 167 base::CommandLine command_line(0, NULL); |
| 168 gfx::GLVersionInfo gl_info(init.gl_version.c_str(), "", ""); | |
| 169 if (gl_info.is_es3) | |
| 170 command_line.AppendSwitch(switches::kEnableUnsafeES3APIs); | |
| 171 InitDecoderWithCommandLine(init, &command_line); | |
|
Zhenyao Mo
2015/09/14 21:12:06
No, we definitely don't want to test all decoder t
qiankun
2015/09/15 09:14:58
Done.
| |
| 167 } | 172 } |
| 168 | 173 |
| 169 void GLES2DecoderTestBase::InitDecoderWithCommandLine( | 174 void GLES2DecoderTestBase::InitDecoderWithCommandLine( |
| 170 const InitState& init, | 175 const InitState& init, |
| 171 const base::CommandLine* command_line) { | 176 const base::CommandLine* command_line) { |
| 172 InitState normalized_init = init; | 177 InitState normalized_init = init; |
| 173 NormalizeInitState(&normalized_init); | 178 NormalizeInitState(&normalized_init); |
| 174 // For easier substring/extension matching | 179 // For easier substring/extension matching |
| 175 DCHECK(normalized_init.extensions.empty() || | 180 DCHECK(normalized_init.extensions.empty() || |
| 176 *normalized_init.extensions.rbegin() == ' '); | 181 *normalized_init.extensions.rbegin() == ' '); |
| (...skipping 1655 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1832 SetupDefaultProgram(); | 1837 SetupDefaultProgram(); |
| 1833 } | 1838 } |
| 1834 | 1839 |
| 1835 // Include the auto-generated part of this file. We split this because it means | 1840 // Include the auto-generated part of this file. We split this because it means |
| 1836 // we can easily edit the non-auto generated parts right here in this file | 1841 // we can easily edit the non-auto generated parts right here in this file |
| 1837 // instead of having to edit some template or the code generator. | 1842 // instead of having to edit some template or the code generator. |
| 1838 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_0_autogen.h" | 1843 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_0_autogen.h" |
| 1839 | 1844 |
| 1840 } // namespace gles2 | 1845 } // namespace gles2 |
| 1841 } // namespace gpu | 1846 } // namespace gpu |
| OLD | NEW |