| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 | 7 |
| 8 #include "gpu/command_buffer/service/feature_info.h" | 8 #include "gpu/command_buffer/service/feature_info.h" |
| 9 #include "gpu/command_buffer/tests/gl_manager.h" | 9 #include "gpu/command_buffer/tests/gl_manager.h" |
| 10 #include "gpu/command_buffer/tests/gl_test_utils.h" | 10 #include "gpu/command_buffer/tests/gl_test_utils.h" |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 glClearColor(0.5f, 0.0f, 1.0f, 0.0f); | 84 glClearColor(0.5f, 0.0f, 1.0f, 0.0f); |
| 85 glClear(GL_COLOR_BUFFER_BIT); | 85 glClear(GL_COLOR_BUFFER_BIT); |
| 86 EXPECT_TRUE(GLTestHelper::CheckPixels(0, 0, 1, 1, 1, expected_clear)); | 86 EXPECT_TRUE(GLTestHelper::CheckPixels(0, 0, 1, 1, 1, expected_clear)); |
| 87 uint8 expected_draw[] = { 0, 255, 0, 255, }; | 87 uint8 expected_draw[] = { 0, 255, 0, 255, }; |
| 88 glDrawArrays(GL_TRIANGLES, 0, 6); | 88 glDrawArrays(GL_TRIANGLES, 0, 6); |
| 89 EXPECT_TRUE(GLTestHelper::CheckPixels(0, 0, 1, 1, 0, expected_draw)); | 89 EXPECT_TRUE(GLTestHelper::CheckPixels(0, 0, 1, 1, 0, expected_draw)); |
| 90 } | 90 } |
| 91 | 91 |
| 92 TEST_F(GLTest, FeatureFlagsMatchCapabilities) { | 92 TEST_F(GLTest, FeatureFlagsMatchCapabilities) { |
| 93 scoped_refptr<gles2::FeatureInfo> features = new gles2::FeatureInfo; | 93 scoped_refptr<gles2::FeatureInfo> features = new gles2::FeatureInfo; |
| 94 EXPECT_TRUE(features->Initialize()); | 94 EXPECT_TRUE(features->InitializeForTesting()); |
| 95 const auto& caps = gl_.GetCapabilities(); | 95 const auto& caps = gl_.GetCapabilities(); |
| 96 const auto& flags = features->feature_flags(); | 96 const auto& flags = features->feature_flags(); |
| 97 EXPECT_EQ(caps.egl_image_external, flags.oes_egl_image_external); | 97 EXPECT_EQ(caps.egl_image_external, flags.oes_egl_image_external); |
| 98 EXPECT_EQ(caps.texture_format_bgra8888, flags.ext_texture_format_bgra8888); | 98 EXPECT_EQ(caps.texture_format_bgra8888, flags.ext_texture_format_bgra8888); |
| 99 EXPECT_EQ(caps.texture_format_etc1, flags.oes_compressed_etc1_rgb8_texture); | 99 EXPECT_EQ(caps.texture_format_etc1, flags.oes_compressed_etc1_rgb8_texture); |
| 100 EXPECT_EQ(caps.texture_rectangle, flags.arb_texture_rectangle); | 100 EXPECT_EQ(caps.texture_rectangle, flags.arb_texture_rectangle); |
| 101 EXPECT_EQ(caps.texture_usage, flags.angle_texture_usage); | 101 EXPECT_EQ(caps.texture_usage, flags.angle_texture_usage); |
| 102 EXPECT_EQ(caps.texture_storage, flags.ext_texture_storage); | 102 EXPECT_EQ(caps.texture_storage, flags.ext_texture_storage); |
| 103 EXPECT_EQ(caps.discard_framebuffer, flags.ext_discard_framebuffer); | 103 EXPECT_EQ(caps.discard_framebuffer, flags.ext_discard_framebuffer); |
| 104 EXPECT_EQ(caps.sync_query, flags.chromium_sync_query); | 104 EXPECT_EQ(caps.sync_query, flags.chromium_sync_query); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 122 EXPECT_STREQ( | 122 EXPECT_STREQ( |
| 123 "Chromium", | 123 "Chromium", |
| 124 reinterpret_cast<const char*>(glGetString(GL_RENDERER))); | 124 reinterpret_cast<const char*>(glGetString(GL_RENDERER))); |
| 125 EXPECT_STREQ( | 125 EXPECT_STREQ( |
| 126 "Chromium", | 126 "Chromium", |
| 127 reinterpret_cast<const char*>(glGetString(GL_VENDOR))); | 127 reinterpret_cast<const char*>(glGetString(GL_VENDOR))); |
| 128 } | 128 } |
| 129 | 129 |
| 130 } // namespace gpu | 130 } // namespace gpu |
| 131 | 131 |
| OLD | NEW |