| 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 gl_.Initialize(GLManager::Options()); | 28 base::CommandLine command_line(*base::CommandLine::ForCurrentProcess()); |
| 29 command_line.AppendSwitch(switches::kEnableGLPathRendering); |
| 30 gl_.InitializeWithCommandLine(GLManager::Options(), &command_line); |
| 29 } | 31 } |
| 30 | 32 |
| 31 void TearDown() override { gl_.Destroy(); } | 33 void TearDown() override { gl_.Destroy(); } |
| 32 | 34 |
| 33 bool IsApplicable() const { | 35 bool IsApplicable() const { |
| 34 return GLTestHelper::HasExtension( | 36 return GLTestHelper::HasExtension( |
| 35 "GL_CHROMIUM_framebuffer_mixed_samples") && | 37 "GL_CHROMIUM_framebuffer_mixed_samples") && |
| 36 GLTestHelper::HasExtension("GL_OES_rgb8_rgba8"); | 38 GLTestHelper::HasExtension("GL_OES_rgb8_rgba8"); |
| 37 } | 39 } |
| 38 | 40 |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 results[pass].get()); | 236 results[pass].get()); |
| 235 } | 237 } |
| 236 | 238 |
| 237 EXPECT_NE(0, memcmp(results[0].get(), results[1].get(), kResultSize)); | 239 EXPECT_NE(0, memcmp(results[0].get(), results[1].get(), kResultSize)); |
| 238 // Verify that rendering is deterministic, so that the pass above does not | 240 // Verify that rendering is deterministic, so that the pass above does not |
| 239 // come from non-deterministic rendering. | 241 // come from non-deterministic rendering. |
| 240 EXPECT_EQ(0, memcmp(results[0].get(), results[2].get(), kResultSize)); | 242 EXPECT_EQ(0, memcmp(results[0].get(), results[2].get(), kResultSize)); |
| 241 } | 243 } |
| 242 | 244 |
| 243 } // namespace gpu | 245 } // namespace gpu |
| OLD | NEW |