| 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 <stdint.h> | 8 #include <stdint.h> |
| 9 #include <string.h> | 9 #include <string.h> |
| 10 | 10 |
| 11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
| 12 #include "gpu/command_buffer/service/gpu_switches.h" | 12 #include "gpu/command_buffer/service/gpu_switches.h" |
| 13 #include "gpu/command_buffer/tests/gl_manager.h" | 13 #include "gpu/command_buffer/tests/gl_manager.h" |
| 14 #include "gpu/command_buffer/tests/gl_test_utils.h" | 14 #include "gpu/command_buffer/tests/gl_test_utils.h" |
| 15 #include "testing/gmock/include/gmock/gmock.h" | 15 #include "testing/gmock/include/gmock/gmock.h" |
| 16 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
| 17 | 17 |
| 18 #define SHADER(Src) #Src | 18 #define SHADER(Src) #Src |
| 19 | 19 |
| 20 namespace gpu { | 20 namespace gpu { |
| 21 | 21 |
| 22 class CHROMIUMFramebufferMixedSamplesTest : public testing::Test { | 22 class CHROMIUMFramebufferMixedSamplesTest : public testing::Test { |
| 23 protected: | 23 protected: |
| 24 const GLuint kWidth = 100; | 24 const GLuint kWidth = 100; |
| 25 const GLuint kHeight = 100; | 25 const GLuint kHeight = 100; |
| 26 | 26 |
| 27 void SetUp() override { | 27 void SetUp() override { |
| 28 base::CommandLine command_line(*base::CommandLine::ForCurrentProcess()); | 28 gl_.Initialize(GLManager::Options()); |
| 29 command_line.AppendSwitch(switches::kEnableGLPathRendering); | |
| 30 gl_.InitializeWithCommandLine(GLManager::Options(), &command_line); | |
| 31 } | 29 } |
| 32 | 30 |
| 33 void TearDown() override { gl_.Destroy(); } | 31 void TearDown() override { gl_.Destroy(); } |
| 34 | 32 |
| 35 bool IsApplicable() const { | 33 bool IsApplicable() const { |
| 36 return GLTestHelper::HasExtension( | 34 return GLTestHelper::HasExtension( |
| 37 "GL_CHROMIUM_framebuffer_mixed_samples") && | 35 "GL_CHROMIUM_framebuffer_mixed_samples") && |
| 38 GLTestHelper::HasExtension("GL_OES_rgb8_rgba8"); | 36 GLTestHelper::HasExtension("GL_OES_rgb8_rgba8"); |
| 39 } | 37 } |
| 40 | 38 |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 results[pass].get()); | 234 results[pass].get()); |
| 237 } | 235 } |
| 238 | 236 |
| 239 EXPECT_NE(0, memcmp(results[0].get(), results[1].get(), kResultSize)); | 237 EXPECT_NE(0, memcmp(results[0].get(), results[1].get(), kResultSize)); |
| 240 // Verify that rendering is deterministic, so that the pass above does not | 238 // Verify that rendering is deterministic, so that the pass above does not |
| 241 // come from non-deterministic rendering. | 239 // come from non-deterministic rendering. |
| 242 EXPECT_EQ(0, memcmp(results[0].get(), results[2].get(), kResultSize)); | 240 EXPECT_EQ(0, memcmp(results[0].get(), results[2].get(), kResultSize)); |
| 243 } | 241 } |
| 244 | 242 |
| 245 } // namespace gpu | 243 } // namespace gpu |
| OLD | NEW |