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 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include "gpu/command_buffer/service/feature_info.h" | 9 #include "gpu/command_buffer/service/feature_info.h" |
10 #include "gpu/command_buffer/tests/gl_manager.h" | 10 #include "gpu/command_buffer/tests/gl_manager.h" |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 glClear(GL_COLOR_BUFFER_BIT); | 92 glClear(GL_COLOR_BUFFER_BIT); |
93 EXPECT_TRUE(GLTestHelper::CheckPixels(0, 0, 1, 1, 1, expected_clear)); | 93 EXPECT_TRUE(GLTestHelper::CheckPixels(0, 0, 1, 1, 1, expected_clear)); |
94 uint8_t expected_draw[] = { | 94 uint8_t expected_draw[] = { |
95 0, 255, 0, 255, | 95 0, 255, 0, 255, |
96 }; | 96 }; |
97 glDrawArrays(GL_TRIANGLES, 0, 6); | 97 glDrawArrays(GL_TRIANGLES, 0, 6); |
98 EXPECT_TRUE(GLTestHelper::CheckPixels(0, 0, 1, 1, 0, expected_draw)); | 98 EXPECT_TRUE(GLTestHelper::CheckPixels(0, 0, 1, 1, 0, expected_draw)); |
99 } | 99 } |
100 | 100 |
101 TEST_F(GLTest, FeatureFlagsMatchCapabilities) { | 101 TEST_F(GLTest, FeatureFlagsMatchCapabilities) { |
102 scoped_refptr<gles2::FeatureInfo> features = | 102 scoped_refptr<gles2::FeatureInfo> features = new gles2::FeatureInfo; |
103 new gles2::FeatureInfo(gl_.workarounds()); | |
104 EXPECT_TRUE(features->InitializeForTesting()); | 103 EXPECT_TRUE(features->InitializeForTesting()); |
105 const auto& caps = gl_.GetCapabilities(); | 104 const auto& caps = gl_.GetCapabilities(); |
106 const auto& flags = features->feature_flags(); | 105 const auto& flags = features->feature_flags(); |
107 EXPECT_EQ(caps.egl_image_external, flags.oes_egl_image_external); | 106 EXPECT_EQ(caps.egl_image_external, flags.oes_egl_image_external); |
108 EXPECT_EQ(caps.texture_format_bgra8888, flags.ext_texture_format_bgra8888); | 107 EXPECT_EQ(caps.texture_format_bgra8888, flags.ext_texture_format_bgra8888); |
109 EXPECT_EQ(caps.texture_format_etc1, flags.oes_compressed_etc1_rgb8_texture); | 108 EXPECT_EQ(caps.texture_format_etc1, flags.oes_compressed_etc1_rgb8_texture); |
110 EXPECT_EQ(caps.texture_rectangle, flags.arb_texture_rectangle); | 109 EXPECT_EQ(caps.texture_rectangle, flags.arb_texture_rectangle); |
111 EXPECT_EQ(caps.texture_usage, flags.angle_texture_usage); | 110 EXPECT_EQ(caps.texture_usage, flags.angle_texture_usage); |
112 EXPECT_EQ(caps.texture_storage, flags.ext_texture_storage); | 111 EXPECT_EQ(caps.texture_storage, flags.ext_texture_storage); |
113 EXPECT_EQ(caps.discard_framebuffer, flags.ext_discard_framebuffer); | 112 EXPECT_EQ(caps.discard_framebuffer, flags.ext_discard_framebuffer); |
(...skipping 19 matching lines...) Expand all Loading... |
133 EXPECT_STREQ( | 132 EXPECT_STREQ( |
134 "Chromium", | 133 "Chromium", |
135 reinterpret_cast<const char*>(glGetString(GL_RENDERER))); | 134 reinterpret_cast<const char*>(glGetString(GL_RENDERER))); |
136 EXPECT_STREQ( | 135 EXPECT_STREQ( |
137 "Chromium", | 136 "Chromium", |
138 reinterpret_cast<const char*>(glGetString(GL_VENDOR))); | 137 reinterpret_cast<const char*>(glGetString(GL_VENDOR))); |
139 } | 138 } |
140 | 139 |
141 } // namespace gpu | 140 } // namespace gpu |
142 | 141 |
OLD | NEW |