| OLD | NEW |
| 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 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 <GLES2/gl2.h> | 5 #include <GLES2/gl2.h> |
| 6 #include <GLES2/gl2ext.h> | 6 #include <GLES2/gl2ext.h> |
| 7 #include <GLES2/gl2extchromium.h> | 7 #include <GLES2/gl2extchromium.h> |
| 8 #include <GLES3/gl3.h> | 8 #include <GLES3/gl3.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 public: | 92 public: |
| 93 static const GLsizei kWidth = 100; | 93 static const GLsizei kWidth = 100; |
| 94 static const GLsizei kHeight = 100; | 94 static const GLsizei kHeight = 100; |
| 95 EXTBlendFuncExtendedDrawTest() : program_(0) {} | 95 EXTBlendFuncExtendedDrawTest() : program_(0) {} |
| 96 | 96 |
| 97 protected: | 97 protected: |
| 98 void SetUp() override { | 98 void SetUp() override { |
| 99 GLManager::Options options; | 99 GLManager::Options options; |
| 100 options.size = gfx::Size(kWidth, kHeight); | 100 options.size = gfx::Size(kWidth, kHeight); |
| 101 options.force_shader_name_hashing = GetParam(); | 101 options.force_shader_name_hashing = GetParam(); |
| 102 base::CommandLine command_line(*base::CommandLine::ForCurrentProcess()); | 102 gl_.Initialize(options); |
| 103 gl_.InitializeWithCommandLine(options, &command_line); | |
| 104 } | 103 } |
| 105 | 104 |
| 106 bool IsApplicable() const { | 105 bool IsApplicable() const { |
| 107 return GLTestHelper::HasExtension("GL_EXT_blend_func_extended"); | 106 return GLTestHelper::HasExtension("GL_EXT_blend_func_extended"); |
| 108 } | 107 } |
| 109 | 108 |
| 110 virtual const char* GetVertexShader() { | 109 virtual const char* GetVertexShader() { |
| 111 // clang-format off | 110 // clang-format off |
| 112 static const char* kVertexShader = | 111 static const char* kVertexShader = |
| 113 SHADER( | 112 SHADER( |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 | 239 |
| 241 class EXTBlendFuncExtendedES3DrawTest : public EXTBlendFuncExtendedDrawTest { | 240 class EXTBlendFuncExtendedES3DrawTest : public EXTBlendFuncExtendedDrawTest { |
| 242 protected: | 241 protected: |
| 243 void SetUp() override { | 242 void SetUp() override { |
| 244 GLManager::Options options; | 243 GLManager::Options options; |
| 245 options.size = gfx::Size(kWidth, kHeight); | 244 options.size = gfx::Size(kWidth, kHeight); |
| 246 options.context_type = gles2::CONTEXT_TYPE_OPENGLES3; | 245 options.context_type = gles2::CONTEXT_TYPE_OPENGLES3; |
| 247 options.force_shader_name_hashing = GetParam(); | 246 options.force_shader_name_hashing = GetParam(); |
| 248 base::CommandLine command_line(*base::CommandLine::ForCurrentProcess()); | 247 base::CommandLine command_line(*base::CommandLine::ForCurrentProcess()); |
| 249 command_line.AppendSwitch(switches::kEnableUnsafeES3APIs); | 248 command_line.AppendSwitch(switches::kEnableUnsafeES3APIs); |
| 250 gl_.InitializeWithCommandLine(options, &command_line); | 249 gl_.InitializeWithCommandLine(options, command_line); |
| 251 } | 250 } |
| 252 bool IsApplicable() const { | 251 bool IsApplicable() const { |
| 253 return gl_.IsInitialized() && EXTBlendFuncExtendedDrawTest::IsApplicable(); | 252 return gl_.IsInitialized() && EXTBlendFuncExtendedDrawTest::IsApplicable(); |
| 254 } | 253 } |
| 255 const char* GetVertexShader() override { | 254 const char* GetVertexShader() override { |
| 256 // clang-format off | 255 // clang-format off |
| 257 static const char* kVertexShader = | 256 static const char* kVertexShader = |
| 258 "#version 300 es\n" | 257 "#version 300 es\n" |
| 259 SHADER( | 258 SHADER( |
| 260 in vec4 position; | 259 in vec4 position; |
| (...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 654 | 653 |
| 655 INSTANTIATE_TEST_CASE_P(TranslatorVariants, | 654 INSTANTIATE_TEST_CASE_P(TranslatorVariants, |
| 656 EXTBlendFuncExtendedDrawTest, | 655 EXTBlendFuncExtendedDrawTest, |
| 657 ::testing::Bool()); | 656 ::testing::Bool()); |
| 658 | 657 |
| 659 INSTANTIATE_TEST_CASE_P(TranslatorVariants, | 658 INSTANTIATE_TEST_CASE_P(TranslatorVariants, |
| 660 EXTBlendFuncExtendedES3DrawTest, | 659 EXTBlendFuncExtendedES3DrawTest, |
| 661 ::testing::Bool()); | 660 ::testing::Bool()); |
| 662 | 661 |
| 663 } // namespace gpu | 662 } // namespace gpu |
| OLD | NEW |