{
"args": [
"./disable",
"8802535381044585761",
".*FeatureInfoTest.Basic/Service.0.*"
],
"requests": "{\"QueryTestResults/{\\\"invocations\\\": [\\\"invocations/build-8802535381044585761\\\"], \\\"readMask\\\": {\\\"paths\\\": [\\\"test_id\\\", \\\"test_metadata\\\"]}, \\\"pageSize\\\": 1000, \\\"predicate\\\": {\\\"testIdRegexp\\\": \\\".*FeatureInfoTest.Basic/Service.0.*\\\"}}\": \"{\\\"testResults\\\":[{\\\"name\\\":\\\"invocations/task-chromium-swarm.appspot.com-5d71ca14dfd3f911/tests/ninja:%2F%2Fgpu:gpu_unittests%2FFeatureInfoTest.Basic%2FService.0/results/c222fb02-01615\\\",\\\"testId\\\":\\\"ninja://gpu:gpu_unittests/FeatureInfoTest.Basic/Service.0\\\",\\\"testMetadata\\\":{\\\"name\\\":\\\"Service/FeatureInfoTest.Basic/0\\\",\\\"location\\\":{\\\"repo\\\":\\\"https://chromium.googlesource.com/chromium/src\\\",\\\"fileName\\\":\\\"//gpu/command_buffer/service/feature_info_unittest.cc\\\",\\\"line\\\":180}}}]}\\n\"}",
"read_data": {
"gpu/command_buffer/service/feature_info_unittest.cc": "// Copyright 2012 The Chromium Authors\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\n#include \"gpu/command_buffer/service/feature_info.h\"\n\n#include <stddef.h>\n\n#include <memory>\n\n#include \"gpu/command_buffer/service/gpu_service_test.h\"\n#include \"gpu/command_buffer/service/gpu_switches.h\"\n#include \"gpu/command_buffer/service/test_helper.h\"\n#include \"gpu/command_buffer/service/texture_manager.h\"\n#include \"gpu/config/gpu_driver_bug_workarounds.h\"\n#include \"gpu/config/gpu_switches.h\"\n#include \"testing/gtest/include/gtest/gtest.h\"\n#include \"ui/gl/gl_fence.h\"\n#include \"ui/gl/gl_implementation.h\"\n#include \"ui/gl/gl_mock.h\"\n#include \"ui/gl/gl_version_info.h\"\n\nusing ::testing::_;\nusing ::testing::DoAll;\nusing ::testing::HasSubstr;\nusing ::testing::InSequence;\nusing ::testing::MatcherCast;\nusing ::testing::Not;\nusing ::testing::Pointee;\nusing ::testing::Return;\nusing ::testing::SetArrayArgument;\nusing ::testing::SetArgPointee;\nusing ::testing::StrEq;\n\nnamespace gpu {\nnamespace gles2 {\n\nnamespace {\nconst char kGLRendererStringANGLE[] = \"ANGLE (some renderer)\";\n} // anonymous namespace\n\nenum MockedGLVersionKind {\n ES2_on_Version3_0,\n ES2_on_Version3_2Compatibility,\n ES3_on_Version3_0,\n ES3_on_Version3_2Compatibility,\n\n // Currently, nothing cares about both ES version and passthrough, so just\n // create one representative passthrough case.\n ES2_on_Version3_0_Passthrough\n};\n\nclass FeatureInfoTest\n : public GpuServiceTest,\n public ::testing::WithParamInterface<MockedGLVersionKind> {\n public:\n FeatureInfoTest() = default;\n\n void SetupInitExpectations(const char* extensions) {\n std::string extensions_str = extensions;\n // Most of the tests' expectations currently assume the desktop\n // OpenGL compatibility profile.\n switch (GetParam()) {\n case ES2_on_Version3_0:\n case ES2_on_Version3_0_Passthrough:\n case ES3_on_Version3_0:\n SetupInitExpectationsWithGLVersion(extensions_str.c_str(), \"\", \"3.0\");\n break;\n case ES2_on_Version3_2Compatibility:\n case ES3_on_Version3_2Compatibility:\n if (extensions_str.find(\"GL_ARB_compatibility\") == std::string::npos) {\n extensions_str += \" GL_ARB_compatibility\";\n }\n SetupInitExpectationsWithGLVersion(extensions_str.c_str(), \"\", \"3.2\");\n break;\n default:\n NOTREACHED_IN_MIGRATION();\n break;\n }\n }\n\n ContextType GetContextType() {\n switch (GetParam()) {\n case ES2_on_Version3_0:\n case ES2_on_Version3_0_Passthrough:\n case ES2_on_Version3_2Compatibility:\n return CONTEXT_TYPE_OPENGLES2;\n case ES3_on_Version3_0:\n case ES3_on_Version3_2Compatibility:\n return CONTEXT_TYPE_OPENGLES3;\n default:\n NOTREACHED_IN_MIGRATION();\n return CONTEXT_TYPE_OPENGLES2;\n }\n }\n\n bool IsPassthroughCmdDecoder() {\n switch (GetParam()) {\n case ES2_on_Version3_0_Passthrough:\n return true;\n case ES2_on_Version3_0:\n case ES2_on_Version3_2Compatibility:\n case ES3_on_Version3_0:\n case ES3_on_Version3_2Compatibility:\n return false;\n default:\n NOTREACHED_IN_MIGRATION();\n return false;\n }\n }\n\n void SetupInitExpectationsWithGLVersion(\n const char* extensions, const char* renderer, const char* version) {\n GpuServiceTest::SetUpWithGLVersion(version, extensions);\n TestHelper::SetupFeatureInfoInitExpectationsWithGLVersion(\n gl_.get(), extensions, renderer, version, GetContextType());\n info_ = new FeatureInfo();\n info_->Initialize(GetContextType(), IsPassthroughCmdDecoder(),\n DisallowedFeatures());\n }\n\n void SetupInitExpectationsWithGLVersionAndDisallowedFeatures(\n const char* extensions,\n const char* renderer,\n const char* version,\n const DisallowedFeatures& disallowed_features) {\n GpuServiceTest::SetUpWithGLVersion(version, extensions);\n TestHelper::SetupFeatureInfoInitExpectationsWithGLVersion(\n gl_.get(), extensions, renderer, version, GetContextType());\n info_ = new FeatureInfo();\n info_->Initialize(GetContextType(), IsPassthroughCmdDecoder(),\n disallowed_features);\n }\n\n void SetupWithWorkarounds(const gpu::GpuDriverBugWorkarounds& workarounds) {\n GpuServiceTest::SetUp();\n info_ = new FeatureInfo(workarounds, GpuFeatureInfo());\n }\n\n void SetupInitExpectationsWithWorkarounds(\n const char* extensions,\n const gpu::GpuDriverBugWorkarounds& workarounds) {\n GpuServiceTest::SetUpWithGLVersion(\"2.0\", extensions);\n TestHelper::SetupFeatureInfoInitExpectationsWithGLVersion(\n gl_.get(), extensions, \"\", \"\", GetContextType());\n info_ = new FeatureInfo(workarounds, GpuFeatureInfo());\n info_->Initialize(GetContextType(), IsPassthroughCmdDecoder(),\n DisallowedFeatures());\n }\n\n void SetupWithoutInit() {\n GpuServiceTest::SetUp();\n info_ = new FeatureInfo();\n }\n\n protected:\n void SetUp() override {\n // Do nothing here, since we are using the explicit Setup*() functions.\n }\n\n void TearDown() override {\n info_ = nullptr;\n GpuServiceTest::TearDown();\n }\n\n scoped_refptr<FeatureInfo> info_;\n};\n\nstatic const MockedGLVersionKind kGLVersionKinds[] = {\n ES2_on_Version3_0,\n ES2_on_Version3_2Compatibility,\n ES3_on_Version3_0,\n ES3_on_Version3_2Compatibility\n};\n\nINSTANTIATE_TEST_SUITE_P(Service,\n FeatureInfoTest,\n ::testing::ValuesIn(kGLVersionKinds));\n\nTEST_P(FeatureInfoTest, Basic) {\n SetupWithoutInit();\n // Test it starts off uninitialized.\n EXPECT_FALSE(info_->feature_flags().chromium_framebuffer_multisample);\n EXPECT_FALSE(info_->feature_flags().multisampled_render_to_texture);\n EXPECT_FALSE(info_->feature_flags(\n ).use_img_for_multisampled_render_to_texture);\n EXPECT_FALSE(info_->feature_flags().oes_standard_derivatives);\n EXPECT_FALSE(info_->feature_flags().npot_ok);\n EXPECT_FALSE(info_->feature_flags().enable_texture_float_linear);\n EXPECT_FALSE(info_->feature_flags().enable_texture_half_float_linear);\n EXPECT_FALSE(info_->feature_flags().oes_egl_image_external);\n EXPECT_FALSE(info_->feature_flags().nv_egl_stream_consumer_external);\n EXPECT_FALSE(info_->feature_flags().oes_depth24);\n EXPECT_FALSE(info_->feature_flags().packed_depth24_stencil8);\n EXPECT_FALSE(info_->feature_flags().angle_translated_shader_source);\n EXPECT_FALSE(info_->feature_flags().angle_pack_reverse_row_order);\n EXPECT_FALSE(info_->feature_flags().arb_texture_rectangle);\n EXPECT_FALSE(info_->feature_flags().angle_instanced_arrays);\n EXPECT_FALSE(info_->feature_flags().occlusion_query_boolean);\n EXPECT_FALSE(info_->feature_flags(\n ).use_arb_occlusion_query2_for_occlusion_query_boolean);\n EXPECT_FALSE(info_->feature_flags(\n ).use_arb_occlusion_query_for_occlusion_query_boolean);\n EXPECT_FALSE(info_->feature_flags().native_vertex_array_object);\n EXPECT_FALSE(info_->feature_flags().map_buffer_range);\n EXPECT_FALSE(info_->feature_flags().use_async_readpixels);\n EXPECT_FALSE(info_->feature_flags().ext_draw_buffers);\n EXPECT_FALSE(info_->feature_flags().nv_draw_buffers);\n EXPECT_FALSE(info_->feature_flags().ext_discard_framebuffer);\n EXPECT_FALSE(info_->feature_flags().angle_depth_texture);\n EXPECT_FALSE(info_->feature_flags().ext_read_format_bgra);\n\n#define GPU_OP(type, name) EXPECT_FALSE(info_->workarounds().name);\n GPU_DRIVER_BUG_WORKAROUNDS(GPU_OP)\n#undef GPU_OP\n EXPECT_EQ(0, info_->workarounds().webgl_or_caps_max_texture_size);\n EXPECT_FALSE(info_->workarounds().gl_clear_broken);\n}\n\nTEST_P(FeatureInfoTest, InitializeNoExtensions) {\n SetupInitExpectations(\"\");\n // Check default extensions are there\n EXPECT_TRUE(\n gfx::HasExtension(info_->extensions(), \"GL_CHROMIUM_resource_safe\"));\n EXPECT_TRUE(\n gfx::HasExtension(info_->extensions(), \"GL_CHROMIUM_strict_attribs\"));\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(),\n \"GL_ANGLE_translated_shader_source\"));\n EXPECT_TRUE(\n gfx::HasExtension(info_->extensions(), \"GL_CHROMIUM_trace_marker\"));\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(), \"GL_EXT_unpack_subimage\"));\n\n bool expect_ext_srgb = false;\n switch (GetParam()) {\n case ES2_on_Version3_0:\n case ES3_on_Version3_0:\n case ES3_on_Version3_2Compatibility:\n break;\n case ES2_on_Version3_2Compatibility:\n // sRGB features are available as core GL 3.2.\n expect_ext_srgb = true;\n break;\n default:\n NOTREACHED_IN_MIGRATION();\n break;\n }\n // Note that because GL_EXT_sRGB is a substring of GL_EXT_sRGB_write_control,\n // which is not part of the ES3 core, we have to be careful to search for\n // \"GL_EXT_sRGB \", and append a space to the end of the extension string.\n if (expect_ext_srgb) {\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(), \"GL_EXT_sRGB\"));\n EXPECT_TRUE(info_->validators()->texture_format.IsValid(GL_SRGB_EXT));\n EXPECT_TRUE(info_->validators()->texture_format.IsValid(GL_SRGB_ALPHA_EXT));\n EXPECT_TRUE(info_->validators()->texture_internal_format.IsValid(\n GL_SRGB_EXT));\n EXPECT_TRUE(info_->validators()->texture_internal_format.IsValid(\n GL_SRGB_ALPHA_EXT));\n EXPECT_TRUE(info_->validators()->render_buffer_format.IsValid(\n GL_SRGB8_ALPHA8_EXT));\n EXPECT_TRUE(info_->validators()->framebuffer_attachment_parameter.IsValid(\n GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT));\n } else {\n EXPECT_FALSE(gfx::HasExtension(info_->extensions(), \"GL_EXT_sRGB\"));\n EXPECT_FALSE(info_->validators()->texture_format.IsValid(GL_SRGB_EXT));\n EXPECT_FALSE(info_->validators()->texture_format.IsValid(\n GL_SRGB_ALPHA_EXT));\n EXPECT_FALSE(info_->validators()->texture_internal_format.IsValid(\n GL_SRGB_EXT));\n EXPECT_FALSE(info_->validators()->texture_internal_format.IsValid(\n GL_SRGB_ALPHA_EXT));\n EXPECT_FALSE(info_->validators()->render_buffer_format.IsValid(\n GL_SRGB8_ALPHA8_EXT));\n EXPECT_FALSE(info_->validators()->framebuffer_attachment_parameter.IsValid(\n GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT));\n }\n\n // Check a couple of random extensions that should not be there.\n EXPECT_FALSE(gfx::HasExtension(info_->extensions(), \"GL_OES_texture_npot\"));\n EXPECT_FALSE(gfx::HasExtension(info_->extensions(),\n \"GL_ANGLE_texture_compression_dxt1\"));\n EXPECT_FALSE(gfx::HasExtension(info_->extensions(),\n \"GL_ANGLE_texture_compression_dxt3\"));\n EXPECT_FALSE(gfx::HasExtension(info_->extensions(),\n \"GL_ANGLE_texture_compression_dxt5\"));\n EXPECT_FALSE(\n gfx::HasExtension(info_->extensions(), \"GL_ANGLE_texture_usage\"));\n EXPECT_FALSE(\n gfx::HasExtension(info_->extensions(), \"GL_EXT_texture_storage\"));\n EXPECT_FALSE(gfx::HasExtension(info_->extensions(),\n \"GL_OES_compressed_ETC1_RGB8_texture\"));\n EXPECT_FALSE(\n gfx::HasExtension(info_->extensions(), \"GL_AMD_compressed_ATC_texture\"));\n EXPECT_FALSE(gfx::HasExtension(info_->extensions(),\n \"GL_IMG_texture_compression_pvrtc\"));\n EXPECT_FALSE(gfx::HasExtension(info_->extensions(),\n \"GL_EXT_texture_compression_s3tc_srgb\"));\n EXPECT_FALSE(info_->feature_flags().npot_ok);\n EXPECT_FALSE(info_->validators()->compressed_texture_format.IsValid(\n GL_COMPRESSED_RGB_S3TC_DXT1_EXT));\n EXPECT_FALSE(info_->validators()->compressed_texture_format.IsValid(\n GL_COMPRESSED_RGBA_S3TC_DXT1_EXT));\n EXPECT_FALSE(info_->validators()->compressed_texture_format.IsValid(\n GL_COMPRESSED_RGBA_S3TC_DXT3_EXT));\n EXPECT_FALSE(info_->validators()->compressed_texture_format.IsValid(\n GL_COMPRESSED_RGBA_S3TC_DXT5_EXT));\n EXPECT_FALSE(info_->validators()->compressed_texture_format.IsValid(\n GL_COMPRESSED_SRGB_S3TC_DXT1_EXT));\n EXPECT_FALSE(info_->validators()->compressed_texture_format.IsValid(\n GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT));\n EXPECT_FALSE(info_->validators()->compressed_texture_format.IsValid(\n GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT));\n EXPECT_FALSE(info_->validators()->compressed_texture_format.IsValid(\n GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT));\n EXPECT_FALSE(info_->validators()->compressed_texture_format.IsValid(\n GL_ETC1_RGB8_OES));\n EXPECT_FALSE(info_->validators()->compressed_texture_format.IsValid(\n GL_ATC_RGB_AMD));\n EXPECT_FALSE(info_->validators()->compressed_texture_format.IsValid(\n GL_ATC_RGBA_EXPLICIT_ALPHA_AMD));\n EXPECT_FALSE(info_->validators()->compressed_texture_format.IsValid(\n GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD));\n EXPECT_FALSE(info_->validators()->compressed_texture_format.IsValid(\n GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG));\n EXPECT_FALSE(info_->validators()->compressed_texture_format.IsValid(\n GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG));\n EXPECT_FALSE(info_->validators()->compressed_texture_format.IsValid(\n GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG));\n EXPECT_FALSE(info_->validators()->compressed_texture_format.IsValid(\n GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG));\n EXPECT_FALSE(info_->validators()->texture_parameter.IsValid(\n GL_TEXTURE_MAX_ANISOTROPY_EXT));\n EXPECT_FALSE(info_->validators()->g_l_state.IsValid(\n GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT));\n EXPECT_FALSE(info_->validators()->framebuffer_target.IsValid(\n GL_READ_FRAMEBUFFER_EXT));\n EXPECT_FALSE(info_->validators()->framebuffer_target.IsValid(\n GL_DRAW_FRAMEBUFFER_EXT));\n EXPECT_FALSE(info_->validators()->g_l_state.IsValid(\n GL_READ_FRAMEBUFFER_BINDING_EXT));\n EXPECT_FALSE(info_->validators()->render_buffer_parameter.IsValid(\n GL_MAX_SAMPLES_EXT));\n EXPECT_FALSE(info_->validators()->texture_internal_format.IsValid(\n GL_DEPTH_COMPONENT));\n EXPECT_FALSE(info_->validators()->texture_format.IsValid(GL_DEPTH_COMPONENT));\n EXPECT_FALSE(info_->validators()->pixel_type.IsValid(GL_UNSIGNED_SHORT));\n EXPECT_FALSE(info_->validators()->pixel_type.IsValid(GL_UNSIGNED_INT));\n EXPECT_FALSE(info_->validators()->render_buffer_format.IsValid(\n GL_DEPTH24_STENCIL8));\n EXPECT_FALSE(info_->validators()->texture_internal_format.IsValid(\n GL_DEPTH_STENCIL));\n EXPECT_FALSE(info_->validators()->texture_internal_format.IsValid(\n GL_RGBA32F));\n EXPECT_FALSE(info_->validators()->texture_internal_format.IsValid(\n GL_RGB32F));\n EXPECT_FALSE(info_->validators()->texture_format.IsValid(\n GL_DEPTH_STENCIL));\n EXPECT_FALSE(info_->validators()->pixel_type.IsValid(\n GL_UNSIGNED_INT_24_8));\n EXPECT_FALSE(info_->validators()->render_buffer_format.IsValid(\n GL_DEPTH_COMPONENT24));\n EXPECT_FALSE(info_->validators()->texture_parameter.IsValid(\n GL_TEXTURE_USAGE_ANGLE));\n EXPECT_FALSE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_DEPTH_COMPONENT16));\n EXPECT_FALSE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_DEPTH_COMPONENT32_OES));\n EXPECT_FALSE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_DEPTH24_STENCIL8_OES));\n EXPECT_FALSE(info_->validators()->equation.IsValid(GL_MIN_EXT));\n EXPECT_FALSE(info_->validators()->equation.IsValid(GL_MAX_EXT));\n EXPECT_FALSE(info_->feature_flags().chromium_sync_query);\n EXPECT_FALSE(info_->feature_flags().chromium_image_ycbcr_422);\n}\n\nTEST_P(FeatureInfoTest, InitializeWithANGLE) {\n SetupInitExpectationsWithGLVersion(\"\", kGLRendererStringANGLE, \"\");\n EXPECT_TRUE(info_->gl_version_info().is_angle);\n}\n\nTEST_P(FeatureInfoTest, InitializeWithANGLED3D9Ex) {\n SetupInitExpectationsWithGLVersion(\"\", \"ANGLE (foo bar Direct3D9Ex baz)\", \"\");\n EXPECT_TRUE(info_->gl_version_info().is_angle);\n EXPECT_TRUE(info_->gl_version_info().is_d3d);\n}\n\nTEST_P(FeatureInfoTest, InitializeWithANGLED3D11) {\n SetupInitExpectationsWithGLVersion(\"\", \"ANGLE (foo bar Direct3D11 baz)\", \"\");\n EXPECT_TRUE(info_->gl_version_info().is_angle);\n EXPECT_TRUE(info_->gl_version_info().is_d3d);\n}\n\nTEST_P(FeatureInfoTest, InitializeWithANGLEOpenGL) {\n SetupInitExpectationsWithGLVersion(\"\", \"ANGLE (foo bar OpenGL baz)\", \"\");\n EXPECT_TRUE(info_->gl_version_info().is_angle);\n EXPECT_FALSE(info_->gl_version_info().is_d3d);\n}\n\nTEST_P(FeatureInfoTest, InitializeNPOTExtensionGLES) {\n SetupInitExpectations(\"GL_OES_texture_npot\");\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(), \"GL_OES_texture_npot\"));\n EXPECT_TRUE(info_->feature_flags().npot_ok);\n}\n\nTEST_P(FeatureInfoTest, InitializeNPOTExtensionGL) {\n SetupInitExpectations(\"GL_ARB_texture_non_power_of_two\");\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(), \"GL_OES_texture_npot\"));\n EXPECT_TRUE(info_->feature_flags().npot_ok);\n}\n\nTEST_P(FeatureInfoTest, InitializeDXTExtensionGLES2) {\n SetupInitExpectations(\"GL_ANGLE_texture_compression_dxt1\");\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(),\n \"GL_ANGLE_texture_compression_dxt1\"));\n EXPECT_TRUE(info_->validators()->compressed_texture_format.IsValid(\n GL_COMPRESSED_RGB_S3TC_DXT1_EXT));\n EXPECT_TRUE(info_->validators()->compressed_texture_format.IsValid(\n GL_COMPRESSED_RGBA_S3TC_DXT1_EXT));\n EXPECT_FALSE(info_->validators()->compressed_texture_format.IsValid(\n GL_COMPRESSED_RGBA_S3TC_DXT3_EXT));\n EXPECT_FALSE(info_->validators()->compressed_texture_format.IsValid(\n GL_COMPRESSED_RGBA_S3TC_DXT5_EXT));\n}\n\nTEST_P(FeatureInfoTest, InitializeDXTExtensionGL) {\n SetupInitExpectations(\"GL_EXT_texture_compression_s3tc\");\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(),\n \"GL_ANGLE_texture_compression_dxt1\"));\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(),\n \"GL_ANGLE_texture_compression_dxt3\"));\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(),\n \"GL_ANGLE_texture_compression_dxt5\"));\n EXPECT_TRUE(info_->validators()->compressed_texture_format.IsValid(\n GL_COMPRESSED_RGB_S3TC_DXT1_EXT));\n EXPECT_TRUE(info_->validators()->compressed_texture_format.IsValid(\n GL_COMPRESSED_RGBA_S3TC_DXT1_EXT));\n EXPECT_TRUE(info_->validators()->compressed_texture_format.IsValid(\n GL_COMPRESSED_RGBA_S3TC_DXT3_EXT));\n EXPECT_TRUE(info_->validators()->compressed_texture_format.IsValid(\n GL_COMPRESSED_RGBA_S3TC_DXT5_EXT));\n}\n\nTEST_P(FeatureInfoTest, InitializeEXT_texture_compression_s3tc_srgb) {\n SetupInitExpectationsWithGLVersion(\"GL_NV_sRGB_formats\", \"\",\n \"OpenGL ES 2.0\");\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(),\n \"GL_EXT_texture_compression_s3tc_srgb\"));\n EXPECT_TRUE(info_->validators()->compressed_texture_format.IsValid(\n GL_COMPRESSED_SRGB_S3TC_DXT1_EXT));\n EXPECT_TRUE(info_->validators()->compressed_texture_format.IsValid(\n GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT));\n EXPECT_TRUE(info_->validators()->compressed_texture_format.IsValid(\n GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT));\n EXPECT_TRUE(info_->validators()->compressed_texture_format.IsValid(\n GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT));\n}\n\nTEST_P(FeatureInfoTest, InitializeEXT_texture_compression_s3tc_srgbGL) {\n SetupInitExpectations(\"GL_EXT_texture_sRGB GL_EXT_texture_compression_s3tc\");\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(),\n \"GL_EXT_texture_compression_s3tc_srgb\"));\n EXPECT_TRUE(info_->validators()->compressed_texture_format.IsValid(\n GL_COMPRESSED_SRGB_S3TC_DXT1_EXT));\n EXPECT_TRUE(info_->validators()->compressed_texture_format.IsValid(\n GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT));\n EXPECT_TRUE(info_->validators()->compressed_texture_format.IsValid(\n GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT));\n EXPECT_TRUE(info_->validators()->compressed_texture_format.IsValid(\n GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT));\n}\n\nTEST_P(FeatureInfoTest, InitializeANGLE_compressed_texture_etc) {\n SetupInitExpectationsWithGLVersion(\"\", \"\",\n \"OpenGL ES 3.0\");\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(),\n \"GL_ANGLE_compressed_texture_etc\"));\n EXPECT_TRUE(info_->validators()->compressed_texture_format.IsValid(\n GL_COMPRESSED_R11_EAC));\n EXPECT_TRUE(info_->validators()->compressed_texture_format.IsValid(\n GL_COMPRESSED_SIGNED_R11_EAC));\n EXPECT_TRUE(info_->validators()->compressed_texture_format.IsValid(\n GL_COMPRESSED_RGB8_ETC2));\n EXPECT_TRUE(info_->validators()->compressed_texture_format.IsValid(\n GL_COMPRESSED_SRGB8_ETC2));\n EXPECT_TRUE(info_->validators()->compressed_texture_format.IsValid(\n GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2));\n EXPECT_TRUE(info_->validators()->compressed_texture_format.IsValid(\n GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2));\n EXPECT_TRUE(info_->validators()->compressed_texture_format.IsValid(\n GL_COMPRESSED_RG11_EAC));\n EXPECT_TRUE(info_->validators()->compressed_texture_format.IsValid(\n GL_COMPRESSED_SIGNED_RG11_EAC));\n EXPECT_TRUE(info_->validators()->compressed_texture_format.IsValid(\n GL_COMPRESSED_RGBA8_ETC2_EAC));\n EXPECT_TRUE(info_->validators()->compressed_texture_format.IsValid(\n GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC));\n\n EXPECT_TRUE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_COMPRESSED_R11_EAC));\n EXPECT_TRUE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_COMPRESSED_SIGNED_R11_EAC));\n EXPECT_TRUE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_COMPRESSED_RGB8_ETC2));\n EXPECT_TRUE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_COMPRESSED_SRGB8_ETC2));\n EXPECT_TRUE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2));\n EXPECT_TRUE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2));\n EXPECT_TRUE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_COMPRESSED_RG11_EAC));\n EXPECT_TRUE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_COMPRESSED_SIGNED_RG11_EAC));\n EXPECT_TRUE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_COMPRESSED_RGBA8_ETC2_EAC));\n EXPECT_TRUE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC));\n}\n\nTEST_P(FeatureInfoTest, InitializeEXT_texture_format_BGRA8888GLES2) {\n SetupInitExpectationsWithGLVersion(\"GL_EXT_texture_format_BGRA8888\", \"\",\n \"OpenGL ES 2.0\");\n EXPECT_TRUE(\n gfx::HasExtension(info_->extensions(), \"GL_EXT_texture_format_BGRA8888\"));\n EXPECT_TRUE(info_->validators()->texture_format.IsValid(\n GL_BGRA_EXT));\n EXPECT_TRUE(info_->validators()->texture_internal_format.IsValid(\n GL_BGRA_EXT));\n\n // On GL ES, render buffer and read pixels functionality is unrelated to\n // GL_EXT_texture_format_BGRA8888, make sure we don't enable it.\n EXPECT_FALSE(info_->validators()->render_buffer_format.IsValid(\n GL_BGRA8_EXT));\n EXPECT_FALSE(info_->feature_flags().ext_render_buffer_format_bgra8888);\n EXPECT_FALSE(info_->validators()->read_pixel_format.IsValid(GL_BGRA8_EXT));\n EXPECT_FALSE(info_->feature_flags().ext_read_format_bgra);\n}\n\nTEST_P(FeatureInfoTest, InitializeEXT_texture_format_BGRA8888GL) {\n SetupInitExpectationsWithGLVersion(\"\", \"\", \"OpenGL 2.0\");\n EXPECT_TRUE(\n gfx::HasExtension(info_->extensions(), \"GL_EXT_texture_format_BGRA8888\"));\n EXPECT_TRUE(info_->validators()->texture_format.IsValid(\n GL_BGRA_EXT));\n EXPECT_TRUE(info_->validators()->texture_internal_format.IsValid(\n GL_BGRA_EXT));\n}\n\nTEST_P(FeatureInfoTest, InitializeEXT_texture_format_BGRA8888Apple) {\n SetupInitExpectationsWithGLVersion(\"GL_APPLE_texture_format_BGRA8888\", \"\",\n \"OpenGL ES 2.0\");\n EXPECT_TRUE(\n gfx::HasExtension(info_->extensions(), \"GL_EXT_texture_format_BGRA8888\"));\n EXPECT_TRUE(info_->validators()->texture_format.IsValid(\n GL_BGRA_EXT));\n EXPECT_TRUE(info_->validators()->texture_internal_format.IsValid(\n GL_BGRA_EXT));\n\n // On GL ES, render buffer and read pixels functionality is unrelated to\n // GL_APPLE_texture_format_BGRA8888, make sure we don't enable it.\n EXPECT_FALSE(info_->validators()->render_buffer_format.IsValid(\n GL_BGRA8_EXT));\n EXPECT_FALSE(info_->feature_flags().ext_render_buffer_format_bgra8888);\n EXPECT_FALSE(info_->validators()->read_pixel_format.IsValid(GL_BGRA8_EXT));\n EXPECT_FALSE(info_->feature_flags().ext_read_format_bgra);\n}\n\nTEST_P(FeatureInfoTest, InitializeGLES_no_EXT_texture_format_BGRA8888GL) {\n SetupInitExpectationsWithGLVersion(\"\", \"\", \"OpenGL ES 2.0\");\n EXPECT_FALSE(\n gfx::HasExtension(info_->extensions(), \"GL_EXT_texture_format_BGRA8888\"));\n EXPECT_FALSE(info_->validators()->texture_format.IsValid(GL_BGRA_EXT));\n EXPECT_FALSE(\n info_->validators()->texture_internal_format.IsValid(GL_BGRA_EXT));\n}\n\nTEST_P(FeatureInfoTest, InitializeGLES2EXT_read_format_bgra) {\n SetupInitExpectationsWithGLVersion(\n \"GL_EXT_read_format_bgra\", \"\", \"OpenGL ES 2.0\");\n EXPECT_TRUE(\n gfx::HasExtension(info_->extensions(), \"GL_EXT_read_format_bgra\"));\n EXPECT_TRUE(info_->feature_flags().ext_read_format_bgra);\n EXPECT_TRUE(info_->validators()->read_pixel_format.IsValid(\n GL_BGRA_EXT));\n\n // On GL ES, texture and render buffer functionality is unrelated to\n // GL_EXT_read_format_bgra, make sure we don't enable it.\n EXPECT_FALSE(info_->validators()->render_buffer_format.IsValid(\n GL_BGRA8_EXT));\n EXPECT_FALSE(info_->feature_flags().ext_render_buffer_format_bgra8888);\n EXPECT_FALSE(info_->validators()->texture_format.IsValid(GL_BGRA_EXT));\n EXPECT_FALSE(\n info_->validators()->texture_internal_format.IsValid(GL_BGRA_EXT));\n}\n\nTEST_P(FeatureInfoTest, InitializeGLEXT_read_format_bgra) {\n SetupInitExpectationsWithGLVersion(\"\", \"\", \"OpenGL 2.0\");\n EXPECT_TRUE(\n gfx::HasExtension(info_->extensions(), \"GL_EXT_read_format_bgra\"));\n EXPECT_TRUE(info_->feature_flags().ext_read_format_bgra);\n EXPECT_TRUE(info_->validators()->read_pixel_format.IsValid(\n GL_BGRA_EXT));\n}\n\nTEST_P(FeatureInfoTest, InitializeGLES_no_EXT_read_format_bgra) {\n SetupInitExpectationsWithGLVersion(\"\", \"\", \"OpenGL ES 2.0\");\n EXPECT_FALSE(\n gfx::HasExtension(info_->extensions(), \"GL_EXT_read_format_bgra\"));\n EXPECT_FALSE(info_->feature_flags().ext_read_format_bgra);\n EXPECT_FALSE(info_->validators()->read_pixel_format.IsValid(GL_BGRA_EXT));\n}\n\nTEST_P(FeatureInfoTest, InitializeEXT_sRGB) {\n SetupInitExpectations(\"GL_EXT_sRGB GL_OES_rgb8_rgba8\");\n\n if (GetContextType() == CONTEXT_TYPE_OPENGLES3) {\n EXPECT_FALSE(gfx::HasExtension(info_->extensions(), \"GL_EXT_sRGB\"));\n EXPECT_FALSE(info_->validators()->texture_format.IsValid(GL_SRGB_EXT));\n EXPECT_FALSE(\n info_->validators()->texture_format.IsValid(GL_SRGB_ALPHA_EXT));\n EXPECT_FALSE(\n info_->validators()->texture_internal_format.IsValid(GL_SRGB_EXT));\n EXPECT_FALSE(info_->validators()->texture_internal_format.IsValid(\n GL_SRGB_ALPHA_EXT));\n EXPECT_FALSE(\n info_->validators()->render_buffer_format.IsValid(GL_SRGB8_ALPHA8_EXT));\n EXPECT_FALSE(info_->validators()->framebuffer_attachment_parameter.IsValid(\n GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT));\n } else {\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(), \"GL_EXT_sRGB\"));\n EXPECT_TRUE(info_->validators()->texture_format.IsValid(GL_SRGB_EXT));\n EXPECT_TRUE(info_->validators()->texture_format.IsValid(GL_SRGB_ALPHA_EXT));\n EXPECT_TRUE(\n info_->validators()->texture_internal_format.IsValid(GL_SRGB_EXT));\n EXPECT_TRUE(info_->validators()->texture_internal_format.IsValid(\n GL_SRGB_ALPHA_EXT));\n EXPECT_TRUE(\n info_->validators()->render_buffer_format.IsValid(GL_SRGB8_ALPHA8_EXT));\n EXPECT_TRUE(info_->validators()->framebuffer_attachment_parameter.IsValid(\n GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT));\n }\n}\n\nTEST_P(FeatureInfoTest, InitializeGLES2EXT_texture_storage) {\n SetupInitExpectationsWithGLVersion(\n \"GL_EXT_texture_storage\", \"\", \"OpenGL ES 2.0\");\n EXPECT_TRUE(info_->feature_flags().ext_texture_storage);\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(), \"GL_EXT_texture_storage\"));\n EXPECT_TRUE(info_->validators()->texture_parameter.IsValid(\n GL_TEXTURE_IMMUTABLE_FORMAT_EXT));\n EXPECT_FALSE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_BGRA8_EXT));\n EXPECT_FALSE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_RGBA32F_EXT));\n EXPECT_FALSE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_RGB32F_EXT));\n EXPECT_FALSE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_ALPHA32F_EXT));\n EXPECT_FALSE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_LUMINANCE32F_EXT));\n EXPECT_FALSE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_LUMINANCE_ALPHA32F_EXT));\n EXPECT_FALSE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_RGBA16F_EXT));\n EXPECT_FALSE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_RGB16F_EXT));\n EXPECT_FALSE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_ALPHA16F_EXT));\n EXPECT_FALSE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_LUMINANCE16F_EXT));\n EXPECT_FALSE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_LUMINANCE_ALPHA16F_EXT));\n}\n\nTEST_P(FeatureInfoTest, InitializeEXT_texture_storage) {\n SetupInitExpectations(\"GL_EXT_texture_storage\");\n EXPECT_TRUE(info_->feature_flags().ext_texture_storage);\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(), \"GL_EXT_texture_storage\"));\n EXPECT_TRUE(info_->validators()->texture_parameter.IsValid(\n GL_TEXTURE_IMMUTABLE_FORMAT_EXT));\n EXPECT_TRUE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_BGRA8_EXT));\n EXPECT_FALSE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_RGBA32F_EXT));\n EXPECT_FALSE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_RGB32F_EXT));\n EXPECT_FALSE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_ALPHA32F_EXT));\n EXPECT_FALSE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_LUMINANCE32F_EXT));\n EXPECT_FALSE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_LUMINANCE_ALPHA32F_EXT));\n EXPECT_FALSE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_RGBA16F_EXT));\n EXPECT_FALSE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_RGB16F_EXT));\n EXPECT_FALSE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_ALPHA16F_EXT));\n EXPECT_FALSE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_LUMINANCE16F_EXT));\n EXPECT_FALSE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_LUMINANCE_ALPHA16F_EXT));\n}\n\nTEST_P(FeatureInfoTest, InitializeARB_texture_storage) {\n SetupInitExpectations(\"GL_ARB_texture_storage\");\n EXPECT_TRUE(info_->feature_flags().ext_texture_storage);\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(), \"GL_EXT_texture_storage\"));\n EXPECT_TRUE(info_->validators()->texture_parameter.IsValid(\n GL_TEXTURE_IMMUTABLE_FORMAT_EXT));\n}\n\nTEST_P(FeatureInfoTest, InitializeEXT_texture_storage_BGRA) {\n SetupInitExpectationsWithGLVersion(\"GL_EXT_texture_storage\", \"\",\n \"OpenGL 2.0\");\n EXPECT_TRUE(info_->feature_flags().ext_texture_storage);\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(), \"GL_EXT_texture_storage\"));\n EXPECT_TRUE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_BGRA8_EXT));\n EXPECT_TRUE(\n gfx::HasExtension(info_->extensions(), \"GL_EXT_texture_format_BGRA8888\"));\n}\n\nTEST_P(FeatureInfoTest, InitializeARB_texture_storage_BGRA) {\n SetupInitExpectationsWithGLVersion(\"GL_ARB_texture_storage\", \"\",\n \"OpenGL 2.0\");\n EXPECT_TRUE(info_->feature_flags().ext_texture_storage);\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(), \"GL_EXT_texture_storage\"));\n EXPECT_TRUE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_BGRA8_EXT));\n EXPECT_TRUE(\n gfx::HasExtension(info_->extensions(), \"GL_EXT_texture_format_BGRA8888\"));\n}\n\nTEST_P(FeatureInfoTest, InitializeEXT_texture_storage_BGRA8888) {\n SetupInitExpectations(\n \"GL_EXT_texture_storage GL_EXT_texture_format_BGRA8888\");\n EXPECT_TRUE(info_->feature_flags().ext_texture_storage);\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(), \"GL_EXT_texture_storage\"));\n EXPECT_TRUE(\n gfx::HasExtension(info_->extensions(), \"GL_EXT_texture_format_BGRA8888\"));\n EXPECT_TRUE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_BGRA8_EXT));\n EXPECT_TRUE(\n gfx::HasExtension(info_->extensions(), \"GL_EXT_texture_format_BGRA8888\"));\n}\n\nTEST_P(FeatureInfoTest, InitializeEXT_texture_storage_float) {\n SetupInitExpectations(\"GL_EXT_texture_storage GL_OES_texture_float\");\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(), \"GL_EXT_texture_storage\"));\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(), \"GL_OES_texture_float\"));\n EXPECT_TRUE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_RGBA32F_EXT));\n EXPECT_TRUE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_RGB32F_EXT));\n EXPECT_TRUE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_ALPHA32F_EXT));\n EXPECT_TRUE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_LUMINANCE32F_EXT));\n EXPECT_TRUE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_LUMINANCE_ALPHA32F_EXT));\n}\n\nTEST_P(FeatureInfoTest, InitializeEXT_texture_storage_half_float) {\n SetupInitExpectations(\"GL_EXT_texture_storage GL_OES_texture_half_float\");\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(), \"GL_EXT_texture_storage\"));\n EXPECT_TRUE(\n gfx::HasExtension(info_->extensions(), \"GL_OES_texture_half_float\"));\n EXPECT_TRUE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_RGBA16F_EXT));\n EXPECT_TRUE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_RGB16F_EXT));\n EXPECT_TRUE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_ALPHA16F_EXT));\n EXPECT_TRUE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_LUMINANCE16F_EXT));\n EXPECT_TRUE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_LUMINANCE_ALPHA16F_EXT));\n}\n\n// Check that desktop (unlike ES, handled below) always supports BGRA render\n// buffers.\nTEST_P(FeatureInfoTest, InitializeGL_renderbuffer_format_BGRA8888) {\n SetupInitExpectationsWithGLVersion(\"\", \"\", \"OpenGL 2.0\");\n\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(),\n \"GL_CHROMIUM_renderbuffer_format_BGRA8888\"));\n EXPECT_TRUE(info_->feature_flags().ext_render_buffer_format_bgra8888);\n EXPECT_TRUE(info_->validators()->render_buffer_format.IsValid(GL_BGRA8_EXT));\n}\n\n// Check how to handle ES, texture_storage and BGRA combination; 10 tests.\n\n// 1- ES2 + GL_EXT_texture_storage -> GL_EXT_texture_storage (and no\n// GL_EXT_texture_format_BGRA8888 - we don't claim to handle GL_BGRA8 in\n// glTexStorage2DEXT)\nTEST_P(FeatureInfoTest, InitializeGLES2_texture_storage) {\n SetupInitExpectationsWithGLVersion(\n \"GL_EXT_texture_storage\", \"\", \"OpenGL ES 2.0\");\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(), \"GL_EXT_texture_storage\"));\n EXPECT_FALSE(\n gfx::HasExtension(info_->extensions(), \"GL_EXT_texture_format_BGRA8888\"));\n}\n\n// 2- ES2 + GL_EXT_texture_storage + (GL_EXT_texture_format_BGRA8888 or\n// GL_APPLE_texture_format_bgra8888)\nTEST_P(FeatureInfoTest, InitializeGLES2_texture_storage_BGRA) {\n SetupInitExpectationsWithGLVersion(\n \"GL_EXT_texture_storage GL_EXT_texture_format_BGRA8888\",\n \"\",\n \"OpenGL ES 2.0\");\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(), \"GL_EXT_texture_storage\"));\n EXPECT_TRUE(\n gfx::HasExtension(info_->extensions(), \"GL_EXT_texture_format_BGRA8888\"));\n}\n\n// 3- ES2 + GL_EXT_texture_format_BGRA8888 or GL_APPLE_texture_format_bgra8888\nTEST_P(FeatureInfoTest, InitializeGLES2_texture_format_BGRA) {\n SetupInitExpectationsWithGLVersion(\n \"GL_EXT_texture_format_BGRA8888\", \"\", \"OpenGL ES 2.0\");\n EXPECT_FALSE(\n gfx::HasExtension(info_->extensions(), \"GL_EXT_texture_storage\"));\n EXPECT_TRUE(\n gfx::HasExtension(info_->extensions(), \"GL_EXT_texture_format_BGRA8888\"));\n}\n\n// 4- ES2 (neither GL_EXT_texture_storage nor GL_EXT_texture_format_BGRA8888) ->\n// nothing\nTEST_P(FeatureInfoTest, InitializeGLES2_neither_texture_storage_nor_BGRA) {\n SetupInitExpectationsWithGLVersion(\"\", \"\", \"OpenGL ES 2.0\");\n EXPECT_FALSE(\n gfx::HasExtension(info_->extensions(), \"GL_EXT_texture_storage\"));\n EXPECT_FALSE(\n gfx::HasExtension(info_->extensions(), \"GL_EXT_texture_format_BGRA8888\"));\n}\n\n// 5- ES3 + GL_EXT_texture_format_BGRA8888\n// If creating a GLES2 context, expose GL_EXT_texture_format_BGRA8888\n// If creating a GLES3 context, expose GL_EXT_texture_storage\n// (we can't expose both at the same time because we fail the GL_BGRA8\n// requirement)\nTEST_P(FeatureInfoTest, InitializeGLES3_texture_storage_EXT_BGRA) {\n SetupInitExpectationsWithGLVersion(\n \"GL_EXT_texture_format_BGRA8888\", \"\", \"OpenGL ES 3.0\");\n if (GetContextType() == CONTEXT_TYPE_OPENGLES3) {\n EXPECT_TRUE(\n gfx::HasExtension(info_->extensions(), \"GL_EXT_texture_storage\"));\n EXPECT_FALSE(gfx::HasExtension(info_->extensions(),\n \"GL_EXT_texture_format_BGRA8888\"));\n } else {\n EXPECT_FALSE(\n gfx::HasExtension(info_->extensions(), \"GL_EXT_texture_storage\"));\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(),\n \"GL_EXT_texture_format_BGRA8888\"));\n }\n}\n\n// 6- ES3 + GL_APPLE_texture_format_bgra8888 -> GL_EXT_texture_storage +\n// GL_EXT_texture_format_BGRA8888 (driver promises to handle GL_BGRA8 by\n// exposing GL_APPLE_texture_format_bgra8888)\nTEST_P(FeatureInfoTest, InitializeGLES3_texture_storage_APPLE_BGRA) {\n SetupInitExpectationsWithGLVersion(\n \"GL_APPLE_texture_format_BGRA8888\", \"\", \"OpenGL ES 3.0\");\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(), \"GL_EXT_texture_storage\"));\n EXPECT_TRUE(\n gfx::HasExtension(info_->extensions(), \"GL_EXT_texture_format_BGRA8888\"));\n}\n\n// 7- ES3 + GL_EXT_texture_storage + GL_EXT_texture_format_BGRA8888 ->\n// GL_EXT_texture_storage + GL_EXT_texture_format_BGRA8888 (driver promises to\n// handle GL_BGRA8 by exposing GL_EXT_texture_storage)\nTEST_P(FeatureInfoTest, InitializeGLES3_EXT_texture_storage_EXT_BGRA) {\n SetupInitExpectationsWithGLVersion(\n \"GL_EXT_texture_storage GL_EXT_texture_format_BGRA8888\",\n \"\",\n \"OpenGL ES 3.0\");\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(), \"GL_EXT_texture_storage\"));\n EXPECT_TRUE(\n gfx::HasExtension(info_->extensions(), \"GL_EXT_texture_format_BGRA8888\"));\n}\n\n// 8- ES3 + none of the above -> GL_EXT_texture_storage (and no\n// GL_EXT_texture_format_BGRA8888 - we don't claim to handle GL_BGRA8)\nTEST_P(FeatureInfoTest, InitializeGLES3_texture_storage) {\n SetupInitExpectationsWithGLVersion(\"\", \"\", \"OpenGL ES 3.0\");\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(), \"GL_EXT_texture_storage\"));\n EXPECT_FALSE(\n gfx::HasExtension(info_->extensions(), \"GL_EXT_texture_format_BGRA8888\"));\n}\n\n// 9- ANGLE will add the GL_CHROMIUM_renderbuffer_format_BGRA8888 extension and\n// the GL_BGRA8_EXT render buffer format.\nTEST_P(FeatureInfoTest, InitializeWithANGLE_BGRA8) {\n SetupInitExpectationsWithGLVersion(\"\", kGLRendererStringANGLE, \"\");\n EXPECT_TRUE(info_->gl_version_info().is_angle);\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(),\n \"GL_CHROMIUM_renderbuffer_format_BGRA8888\"));\n EXPECT_TRUE(info_->feature_flags().ext_render_buffer_format_bgra8888);\n EXPECT_TRUE(info_->validators()->render_buffer_format.IsValid(GL_BGRA8_EXT));\n}\n\n// 10- vanilla opengl es means no GL_CHROMIUM_renderbuffer_format_BGRA8888\nTEST_P(FeatureInfoTest,\n InitializeGLES2_no_CHROMIUM_renderbuffer_format_BGRA8888) {\n SetupInitExpectationsWithGLVersion(\"\", \"\", \"OpenGL ES 2.0\");\n EXPECT_FALSE(info_->feature_flags().ext_render_buffer_format_bgra8888);\n EXPECT_FALSE(gfx::HasExtension(info_->extensions(),\n \"GL_CHROMIUM_renderbuffer_format_BGRA8888\"));\n}\n\nTEST_P(FeatureInfoTest, InitializeARB_texture_float) {\n DisallowedFeatures disallowed_features;\n disallowed_features.chromium_color_buffer_float_rgb = true;\n disallowed_features.chromium_color_buffer_float_rgba = true;\n SetupInitExpectationsWithGLVersionAndDisallowedFeatures(\n \"GL_ARB_texture_float\", \"\", \"3.0\", disallowed_features);\n EXPECT_FALSE(gfx::HasExtension(info_->extensions(),\n \"GL_CHROMIUM_color_buffer_float_rgb\"));\n EXPECT_FALSE(gfx::HasExtension(info_->extensions(),\n \"GL_CHROMIUM_color_buffer_float_rgba\"));\n EXPECT_FALSE(info_->validators()->texture_internal_format.IsValid(\n GL_RGBA32F));\n EXPECT_FALSE(info_->validators()->texture_internal_format.IsValid(\n GL_RGB32F));\n\n info_->EnableCHROMIUMColorBufferFloatRGBA();\n EXPECT_FALSE(gfx::HasExtension(info_->extensions(),\n \"GL_CHROMIUM_color_buffer_float_rgb\"));\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(),\n \"GL_CHROMIUM_color_buffer_float_rgba\"));\n EXPECT_TRUE(info_->validators()->texture_internal_format.IsValid(\n GL_RGBA32F));\n EXPECT_FALSE(info_->validators()->texture_internal_format.IsValid(\n GL_RGB32F));\n\n info_->EnableCHROMIUMColorBufferFloatRGB();\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(),\n \"GL_CHROMIUM_color_buffer_float_rgb\"));\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(),\n \"GL_CHROMIUM_color_buffer_float_rgba\"));\n EXPECT_TRUE(info_->validators()->texture_internal_format.IsValid(\n GL_RGBA32F));\n EXPECT_TRUE(info_->validators()->texture_internal_format.IsValid(\n GL_RGB32F));\n}\n\nTEST_P(FeatureInfoTest, Initialize_texture_floatGLES3) {\n SetupInitExpectationsWithGLVersion(\"\", \"\", \"OpenGL ES 3.0\");\n EXPECT_FALSE(gfx::HasExtension(info_->extensions(), \"GL_OES_texture_float\"));\n EXPECT_FALSE(\n gfx::HasExtension(info_->extensions(), \"GL_OES_texture_half_float\"));\n EXPECT_FALSE(\n gfx::HasExtension(info_->extensions(), \"GL_OES_texture_float_linear\"));\n EXPECT_FALSE(gfx::HasExtension(info_->extensions(),\n \"GL_OES_texture_half_float_linear\"));\n}\n\nTEST_P(FeatureInfoTest, Initialize_sRGBGLES3) {\n SetupInitExpectationsWithGLVersion(\"\", \"\", \"OpenGL ES 3.0\");\n EXPECT_FALSE(gfx::HasExtension(info_->extensions(), \"GL_EXT_sRGB\"));\n EXPECT_FALSE(info_->validators()->texture_format.IsValid(\n GL_SRGB_EXT));\n EXPECT_FALSE(info_->validators()->texture_format.IsValid(\n GL_SRGB_ALPHA_EXT));\n EXPECT_FALSE(info_->validators()->texture_internal_format.IsValid(\n GL_SRGB_EXT));\n EXPECT_FALSE(info_->validators()->texture_internal_format.IsValid(\n GL_SRGB_ALPHA_EXT));\n EXPECT_FALSE(info_->validators()->render_buffer_format.IsValid(\n GL_SRGB8_ALPHA8_EXT));\n EXPECT_FALSE(info_->validators()->framebuffer_attachment_parameter.IsValid(\n GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT));\n}\n\nTEST_P(FeatureInfoTest, InitializeOES_texture_floatGLES2) {\n SetupInitExpectations(\"GL_OES_texture_float\");\n EXPECT_FALSE(info_->feature_flags().enable_texture_float_linear);\n EXPECT_FALSE(info_->feature_flags().enable_texture_half_float_linear);\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(), \"GL_OES_texture_float\"));\n EXPECT_FALSE(\n gfx::HasExtension(info_->extensions(), \"GL_OES_texture_half_float\"));\n EXPECT_FALSE(\n gfx::HasExtension(info_->extensions(), \"GL_OES_texture_float_linear\"));\n EXPECT_FALSE(gfx::HasExtension(info_->extensions(),\n \"GL_OES_texture_half_float_linear\"));\n EXPECT_TRUE(info_->validators()->pixel_type.IsValid(GL_FLOAT));\n EXPECT_FALSE(info_->validators()->pixel_type.IsValid(GL_HALF_FLOAT_OES));\n}\n\nTEST_P(FeatureInfoTest, InitializeOES_texture_float_linearGLES2) {\n SetupInitExpectations(\"GL_OES_texture_float GL_OES_texture_float_linear\");\n EXPECT_TRUE(info_->feature_flags().enable_texture_float_linear);\n EXPECT_FALSE(info_->feature_flags().enable_texture_half_float_linear);\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(), \"GL_OES_texture_float\"));\n EXPECT_FALSE(\n gfx::HasExtension(info_->extensions(), \"GL_OES_texture_half_float\"));\n EXPECT_TRUE(\n gfx::HasExtension(info_->extensions(), \"GL_OES_texture_float_linear\"));\n EXPECT_FALSE(gfx::HasExtension(info_->extensions(),\n \"GL_OES_texture_half_float_linear\"));\n EXPECT_TRUE(info_->validators()->pixel_type.IsValid(GL_FLOAT));\n EXPECT_FALSE(info_->validators()->pixel_type.IsValid(GL_HALF_FLOAT_OES));\n}\n\nTEST_P(FeatureInfoTest, InitializeOES_texture_half_floatGLES2) {\n SetupInitExpectations(\"GL_OES_texture_half_float\");\n EXPECT_FALSE(info_->feature_flags().enable_texture_float_linear);\n EXPECT_FALSE(info_->feature_flags().enable_texture_half_float_linear);\n EXPECT_FALSE(gfx::HasExtension(info_->extensions(), \"GL_OES_texture_float\"));\n EXPECT_TRUE(\n gfx::HasExtension(info_->extensions(), \"GL_OES_texture_half_float\"));\n EXPECT_FALSE(\n gfx::HasExtension(info_->extensions(), \"GL_OES_texture_float_linear\"));\n EXPECT_FALSE(gfx::HasExtension(info_->extensions(),\n \"GL_OES_texture_half_float_linear\"));\n EXPECT_FALSE(info_->validators()->pixel_type.IsValid(GL_FLOAT));\n EXPECT_TRUE(info_->validators()->pixel_type.IsValid(GL_HALF_FLOAT_OES));\n}\n\nTEST_P(FeatureInfoTest, InitializeOES_texture_half_float_linearGLES2) {\n SetupInitExpectations(\n \"GL_OES_texture_half_float GL_OES_texture_half_float_linear\");\n EXPECT_FALSE(info_->feature_flags().enable_texture_float_linear);\n EXPECT_TRUE(info_->feature_flags().enable_texture_half_float_linear);\n EXPECT_FALSE(gfx::HasExtension(info_->extensions(), \"GL_OES_texture_float\"));\n EXPECT_TRUE(\n gfx::HasExtension(info_->extensions(), \"GL_OES_texture_half_float\"));\n EXPECT_FALSE(\n gfx::HasExtension(info_->extensions(), \"GL_OES_texture_float_linear\"));\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(),\n \"GL_OES_texture_half_float_linear\"));\n EXPECT_FALSE(info_->validators()->pixel_type.IsValid(GL_FLOAT));\n EXPECT_TRUE(info_->validators()->pixel_type.IsValid(GL_HALF_FLOAT_OES));\n}\n\nTEST_P(FeatureInfoTest, InitializeEXT_framebuffer_multisample) {\n SetupInitExpectations(\n \"GL_EXT_framebuffer_blit GL_EXT_framebuffer_multisample\");\n EXPECT_TRUE(info_->feature_flags().chromium_framebuffer_multisample);\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(),\n \"GL_CHROMIUM_framebuffer_multisample\"));\n EXPECT_TRUE(\n info_->validators()->framebuffer_target.IsValid(GL_READ_FRAMEBUFFER_EXT));\n EXPECT_TRUE(\n info_->validators()->framebuffer_target.IsValid(GL_DRAW_FRAMEBUFFER_EXT));\n EXPECT_TRUE(\n info_->validators()->g_l_state.IsValid(GL_READ_FRAMEBUFFER_BINDING_EXT));\n EXPECT_TRUE(info_->validators()->g_l_state.IsValid(GL_MAX_SAMPLES_EXT));\n EXPECT_TRUE(info_->validators()->render_buffer_parameter.IsValid(\n GL_RENDERBUFFER_SAMPLES_EXT));\n}\n\nTEST_P(FeatureInfoTest, InitializeARB_framebuffer_multisample) {\n SetupInitExpectations(\"GL_ARB_framebuffer_object\");\n EXPECT_TRUE(info_->feature_flags().chromium_framebuffer_multisample);\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(),\n \"GL_CHROMIUM_framebuffer_multisample\"));\n EXPECT_TRUE(info_->validators()->framebuffer_target.IsValid(\n GL_READ_FRAMEBUFFER_EXT));\n EXPECT_TRUE(info_->validators()->framebuffer_target.IsValid(\n GL_DRAW_FRAMEBUFFER_EXT));\n EXPECT_TRUE(info_->validators()->g_l_state.IsValid(\n GL_READ_FRAMEBUFFER_BINDING_EXT));\n EXPECT_TRUE(info_->validators()->g_l_state.IsValid(\n GL_MAX_SAMPLES_EXT));\n EXPECT_TRUE(info_->validators()->render_buffer_parameter.IsValid(\n GL_RENDERBUFFER_SAMPLES_EXT));\n}\n\nTEST_P(FeatureInfoTest, InitializeANGLE_framebuffer_multisample) {\n SetupInitExpectationsWithGLVersion(\n \"GL_ANGLE_framebuffer_multisample\", kGLRendererStringANGLE, \"\");\n EXPECT_TRUE(info_->feature_flags().chromium_framebuffer_multisample);\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(),\n \"GL_CHROMIUM_framebuffer_multisample\"));\n EXPECT_TRUE(info_->validators()->framebuffer_target.IsValid(\n GL_READ_FRAMEBUFFER_EXT));\n EXPECT_TRUE(info_->validators()->framebuffer_target.IsValid(\n GL_DRAW_FRAMEBUFFER_EXT));\n EXPECT_TRUE(info_->validators()->g_l_state.IsValid(\n GL_READ_FRAMEBUFFER_BINDING_EXT));\n EXPECT_TRUE(info_->validators()->g_l_state.IsValid(\n GL_MAX_SAMPLES_EXT));\n EXPECT_TRUE(info_->validators()->render_buffer_parameter.IsValid(\n GL_RENDERBUFFER_SAMPLES_EXT));\n}\n\n// We don't allow ANGLE_framebuffer_multisample on non-ANGLE implementations,\n// because we wouldn't be choosing the right driver entry point and because the\n// extension was falsely advertised on some Android devices (crbug.com/165736).\nTEST_P(FeatureInfoTest, InitializeANGLE_framebuffer_multisampleWithoutANGLE) {\n SetupInitExpectations(\"GL_ANGLE_framebuffer_multisample\");\n EXPECT_FALSE(info_->feature_flags().chromium_framebuffer_multisample);\n EXPECT_FALSE(gfx::HasExtension(info_->extensions(),\n \"GL_CHROMIUM_framebuffer_multisample\"));\n EXPECT_FALSE(info_->validators()->framebuffer_target.IsValid(\n GL_READ_FRAMEBUFFER_EXT));\n EXPECT_FALSE(info_->validators()->framebuffer_target.IsValid(\n GL_DRAW_FRAMEBUFFER_EXT));\n EXPECT_FALSE(info_->validators()->g_l_state.IsValid(\n GL_READ_FRAMEBUFFER_BINDING_EXT));\n EXPECT_FALSE(info_->validators()->g_l_state.IsValid(\n GL_MAX_SAMPLES_EXT));\n EXPECT_FALSE(info_->validators()->render_buffer_parameter.IsValid(\n GL_RENDERBUFFER_SAMPLES_EXT));\n}\n\nTEST_P(FeatureInfoTest, InitializeEXT_multisampled_render_to_texture) {\n SetupInitExpectations(\"GL_EXT_multisampled_render_to_texture\");\n EXPECT_TRUE(info_->feature_flags(\n ).multisampled_render_to_texture);\n EXPECT_FALSE(info_->feature_flags(\n ).use_img_for_multisampled_render_to_texture);\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(),\n \"GL_EXT_multisampled_render_to_texture\"));\n EXPECT_TRUE(info_->validators()->g_l_state.IsValid(\n GL_MAX_SAMPLES_EXT));\n EXPECT_TRUE(info_->validators()->render_buffer_parameter.IsValid(\n GL_RENDERBUFFER_SAMPLES_EXT));\n EXPECT_TRUE(info_->validators()->framebuffer_attachment_parameter.IsValid(\n GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_SAMPLES_EXT));\n}\n\nTEST_P(FeatureInfoTest, InitializeIMG_multisampled_render_to_texture) {\n SetupInitExpectations(\"GL_IMG_multisampled_render_to_texture\");\n EXPECT_TRUE(info_->feature_flags(\n ).multisampled_render_to_texture);\n EXPECT_TRUE(info_->feature_flags(\n ).use_img_for_multisampled_render_to_texture);\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(),\n \"GL_EXT_multisampled_render_to_texture\"));\n EXPECT_TRUE(info_->validators()->g_l_state.IsValid(\n GL_MAX_SAMPLES_EXT));\n EXPECT_TRUE(info_->validators()->render_buffer_parameter.IsValid(\n GL_RENDERBUFFER_SAMPLES_EXT));\n EXPECT_TRUE(info_->validators()->framebuffer_attachment_parameter.IsValid(\n GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_SAMPLES_EXT));\n}\n\nTEST_P(FeatureInfoTest, InitializeEXT_texture_filter_anisotropic) {\n SetupInitExpectations(\"GL_EXT_texture_filter_anisotropic\");\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(),\n \"GL_EXT_texture_filter_anisotropic\"));\n EXPECT_TRUE(info_->validators()->texture_parameter.IsValid(\n GL_TEXTURE_MAX_ANISOTROPY_EXT));\n EXPECT_TRUE(info_->validators()->g_l_state.IsValid(\n GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT));\n}\n\nTEST_P(FeatureInfoTest, InitializeEXT_ARB_depth_texture) {\n SetupInitExpectations(\"GL_ARB_depth_texture\");\n EXPECT_TRUE(\n gfx::HasExtension(info_->extensions(), \"GL_GOOGLE_depth_texture\"));\n EXPECT_TRUE(\n gfx::HasExtension(info_->extensions(), \"GL_CHROMIUM_depth_texture\"));\n EXPECT_TRUE(info_->validators()->texture_internal_format.IsValid(\n GL_DEPTH_COMPONENT));\n EXPECT_TRUE(info_->validators()->texture_format.IsValid(GL_DEPTH_COMPONENT));\n EXPECT_FALSE(info_->validators()->texture_format.IsValid(GL_DEPTH_STENCIL));\n EXPECT_TRUE(info_->validators()->pixel_type.IsValid(GL_UNSIGNED_SHORT));\n EXPECT_TRUE(info_->validators()->pixel_type.IsValid(GL_UNSIGNED_INT));\n}\n\nTEST_P(FeatureInfoTest, InitializeOES_ARB_depth_texture) {\n SetupInitExpectations(\"GL_OES_depth_texture\");\n EXPECT_TRUE(\n gfx::HasExtension(info_->extensions(), \"GL_GOOGLE_depth_texture\"));\n EXPECT_TRUE(\n gfx::HasExtension(info_->extensions(), \"GL_CHROMIUM_depth_texture\"));\n EXPECT_TRUE(info_->validators()->texture_internal_format.IsValid(\n GL_DEPTH_COMPONENT));\n EXPECT_TRUE(info_->validators()->texture_format.IsValid(GL_DEPTH_COMPONENT));\n EXPECT_FALSE(info_->validators()->texture_format.IsValid(GL_DEPTH_STENCIL));\n EXPECT_TRUE(info_->validators()->pixel_type.IsValid(GL_UNSIGNED_SHORT));\n EXPECT_TRUE(info_->validators()->pixel_type.IsValid(GL_UNSIGNED_INT));\n}\n\nTEST_P(FeatureInfoTest, InitializeANGLE_depth_texture) {\n SetupInitExpectations(\"GL_ANGLE_depth_texture\");\n EXPECT_TRUE(\n gfx::HasExtension(info_->extensions(), \"GL_GOOGLE_depth_texture\"));\n EXPECT_TRUE(\n gfx::HasExtension(info_->extensions(), \"GL_CHROMIUM_depth_texture\"));\n EXPECT_FALSE(\n gfx::HasExtension(info_->extensions(), \"GL_ANGLE_depth_texture\"));\n EXPECT_TRUE(info_->feature_flags().angle_depth_texture);\n EXPECT_TRUE(info_->validators()->texture_internal_format.IsValid(\n GL_DEPTH_COMPONENT));\n EXPECT_TRUE(info_->validators()->texture_format.IsValid(GL_DEPTH_COMPONENT));\n EXPECT_FALSE(info_->validators()->texture_format.IsValid(GL_DEPTH_STENCIL));\n EXPECT_TRUE(info_->validators()->pixel_type.IsValid(GL_UNSIGNED_SHORT));\n EXPECT_TRUE(info_->validators()->pixel_type.IsValid(GL_UNSIGNED_INT));\n EXPECT_FALSE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_DEPTH_COMPONENT16));\n EXPECT_FALSE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_DEPTH_COMPONENT32_OES));\n EXPECT_FALSE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_DEPTH24_STENCIL8_OES));\n}\n\nTEST_P(FeatureInfoTest, InitializeEXT_packed_depth_stencil) {\n SetupInitExpectations(\"GL_EXT_packed_depth_stencil\");\n EXPECT_TRUE(\n gfx::HasExtension(info_->extensions(), \"GL_OES_packed_depth_stencil\"));\n EXPECT_TRUE(info_->validators()->render_buffer_format.IsValid(\n GL_DEPTH24_STENCIL8));\n EXPECT_FALSE(info_->validators()->texture_internal_format.IsValid(\n GL_DEPTH_COMPONENT));\n EXPECT_FALSE(info_->validators()->texture_format.IsValid(GL_DEPTH_COMPONENT));\n EXPECT_FALSE(info_->validators()->pixel_type.IsValid(GL_UNSIGNED_SHORT));\n EXPECT_FALSE(info_->validators()->pixel_type.IsValid(GL_UNSIGNED_INT));\n}\n\nTEST_P(FeatureInfoTest, InitializeOES_packed_depth_stencil) {\n SetupInitExpectations(\"GL_OES_packed_depth_stencil\");\n EXPECT_TRUE(\n gfx::HasExtension(info_->extensions(), \"GL_OES_packed_depth_stencil\"));\n EXPECT_TRUE(info_->validators()->render_buffer_format.IsValid(\n GL_DEPTH24_STENCIL8));\n EXPECT_FALSE(info_->validators()->texture_internal_format.IsValid(\n GL_DEPTH_COMPONENT));\n EXPECT_FALSE(info_->validators()->texture_format.IsValid(GL_DEPTH_COMPONENT));\n EXPECT_FALSE(info_->validators()->pixel_type.IsValid(GL_UNSIGNED_SHORT));\n EXPECT_FALSE(info_->validators()->pixel_type.IsValid(GL_UNSIGNED_INT));\n}\n\nTEST_P(FeatureInfoTest,\n InitializeOES_packed_depth_stencil_and_GL_ARB_depth_texture) {\n SetupInitExpectations(\"GL_OES_packed_depth_stencil GL_ARB_depth_texture\");\n EXPECT_TRUE(\n gfx::HasExtension(info_->extensions(), \"GL_OES_packed_depth_stencil\"));\n EXPECT_TRUE(info_->validators()->render_buffer_format.IsValid(\n GL_DEPTH24_STENCIL8));\n EXPECT_TRUE(info_->validators()->texture_internal_format.IsValid(\n GL_DEPTH_STENCIL));\n EXPECT_TRUE(info_->validators()->texture_format.IsValid(\n GL_DEPTH_STENCIL));\n EXPECT_TRUE(info_->validators()->pixel_type.IsValid(\n GL_UNSIGNED_INT_24_8));\n}\n\nTEST_P(FeatureInfoTest, InitializeOES_depth24) {\n SetupInitExpectations(\"GL_OES_depth24\");\n EXPECT_TRUE(info_->feature_flags().oes_depth24);\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(), \"GL_OES_depth24\"));\n EXPECT_TRUE(info_->validators()->render_buffer_format.IsValid(\n GL_DEPTH_COMPONENT24));\n}\n\nTEST_P(FeatureInfoTest, InitializeOES_standard_derivatives) {\n SetupInitExpectations(\"GL_OES_standard_derivatives\");\n EXPECT_TRUE(\n gfx::HasExtension(info_->extensions(), \"GL_OES_standard_derivatives\"));\n EXPECT_TRUE(info_->feature_flags().oes_standard_derivatives);\n EXPECT_TRUE(info_->validators()->hint_target.IsValid(\n GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES));\n EXPECT_TRUE(info_->validators()->g_l_state.IsValid(\n GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES));\n}\n\nTEST_P(FeatureInfoTest, InitializeOES_rgb8_rgba8) {\n SetupInitExpectations(\"GL_OES_rgb8_rgba8\");\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(), \"GL_OES_rgb8_rgba8\"));\n EXPECT_TRUE(info_->validators()->render_buffer_format.IsValid(\n GL_RGB8_OES));\n EXPECT_TRUE(info_->validators()->render_buffer_format.IsValid(\n GL_RGBA8_OES));\n}\n\nTEST_P(FeatureInfoTest, InitializeOES_EGL_image_external) {\n SetupInitExpectations(\"GL_OES_EGL_image_external\");\n EXPECT_TRUE(\n gfx::HasExtension(info_->extensions(), \"GL_OES_EGL_image_external\"));\n EXPECT_TRUE(info_->feature_flags().oes_egl_image_external);\n EXPECT_TRUE(info_->validators()->texture_bind_target.IsValid(\n GL_TEXTURE_EXTERNAL_OES));\n EXPECT_TRUE(info_->validators()->get_tex_param_target.IsValid(\n GL_TEXTURE_EXTERNAL_OES));\n EXPECT_TRUE(info_->validators()->texture_parameter.IsValid(\n GL_REQUIRED_TEXTURE_IMAGE_UNITS_OES));\n EXPECT_TRUE(info_->validators()->g_l_state.IsValid(\n GL_TEXTURE_BINDING_EXTERNAL_OES));\n}\n\nTEST_P(FeatureInfoTest, InitializeNV_EGL_stream_consumer_external) {\n SetupInitExpectations(\"GL_NV_EGL_stream_consumer_external\");\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(),\n \"GL_NV_EGL_stream_consumer_external\"));\n EXPECT_TRUE(info_->feature_flags().nv_egl_stream_consumer_external);\n EXPECT_TRUE(info_->validators()->texture_bind_target.IsValid(\n GL_TEXTURE_EXTERNAL_OES));\n EXPECT_TRUE(info_->validators()->get_tex_param_target.IsValid(\n GL_TEXTURE_EXTERNAL_OES));\n EXPECT_TRUE(info_->validators()->texture_parameter.IsValid(\n GL_REQUIRED_TEXTURE_IMAGE_UNITS_OES));\n EXPECT_TRUE(\n info_->validators()->g_l_state.IsValid(GL_TEXTURE_BINDING_EXTERNAL_OES));\n}\n\nTEST_P(FeatureInfoTest, InitializeOES_compressed_ETC1_RGB8_texture) {\n SetupInitExpectations(\"GL_OES_compressed_ETC1_RGB8_texture\");\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(),\n \"GL_OES_compressed_ETC1_RGB8_texture\"));\n EXPECT_TRUE(info_->validators()->compressed_texture_format.IsValid(\n GL_ETC1_RGB8_OES));\n EXPECT_FALSE(info_->validators()->texture_internal_format.IsValid(\n GL_ETC1_RGB8_OES));\n}\n\nTEST_P(FeatureInfoTest, InitializeAMD_compressed_ATC_texture) {\n SetupInitExpectations(\"GL_AMD_compressed_ATC_texture\");\n EXPECT_TRUE(\n gfx::HasExtension(info_->extensions(), \"GL_AMD_compressed_ATC_texture\"));\n EXPECT_TRUE(info_->validators()->compressed_texture_format.IsValid(\n GL_ATC_RGB_AMD));\n EXPECT_TRUE(info_->validators()->compressed_texture_format.IsValid(\n GL_ATC_RGBA_EXPLICIT_ALPHA_AMD));\n EXPECT_TRUE(info_->validators()->compressed_texture_format.IsValid(\n GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD));\n}\n\nTEST_P(FeatureInfoTest, InitializeIMG_texture_compression_pvrtc) {\n SetupInitExpectations(\"GL_IMG_texture_compression_pvrtc\");\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(),\n \"GL_IMG_texture_compression_pvrtc\"));\n EXPECT_TRUE(info_->validators()->compressed_texture_format.IsValid(\n GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG));\n EXPECT_TRUE(info_->validators()->compressed_texture_format.IsValid(\n GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG));\n EXPECT_TRUE(info_->validators()->compressed_texture_format.IsValid(\n GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG));\n EXPECT_TRUE(info_->validators()->compressed_texture_format.IsValid(\n GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG));\n}\n\nTEST_P(FeatureInfoTest, InitializeEXT_occlusion_query_boolean) {\n SetupInitExpectations(\"GL_EXT_occlusion_query_boolean\");\n if (GetContextType() == CONTEXT_TYPE_OPENGLES2) {\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(),\n \"GL_EXT_occlusion_query_boolean\"));\n }\n EXPECT_TRUE(info_->feature_flags().occlusion_query_boolean);\n EXPECT_FALSE(info_->feature_flags(\n ).use_arb_occlusion_query2_for_occlusion_query_boolean);\n EXPECT_FALSE(info_->feature_flags(\n ).use_arb_occlusion_query_for_occlusion_query_boolean);\n}\n\nTEST_P(FeatureInfoTest, InitializeARB_occlusion_query) {\n SetupInitExpectations(\"GL_ARB_occlusion_query\");\n if (GetContextType() == CONTEXT_TYPE_OPENGLES2) {\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(),\n \"GL_EXT_occlusion_query_boolean\"));\n }\n EXPECT_TRUE(info_->feature_flags().occlusion_query_boolean);\n EXPECT_FALSE(info_->feature_flags(\n ).use_arb_occlusion_query2_for_occlusion_query_boolean);\n EXPECT_TRUE(info_->feature_flags(\n ).use_arb_occlusion_query_for_occlusion_query_boolean);\n}\n\nTEST_P(FeatureInfoTest, InitializeARB_occlusion_query2) {\n SetupInitExpectations(\"GL_ARB_occlusion_query2 GL_ARB_occlusion_query2\");\n if (GetContextType() == CONTEXT_TYPE_OPENGLES2) {\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(),\n \"GL_EXT_occlusion_query_boolean\"));\n }\n EXPECT_TRUE(info_->feature_flags().occlusion_query_boolean);\n EXPECT_TRUE(info_->feature_flags(\n ).use_arb_occlusion_query2_for_occlusion_query_boolean);\n EXPECT_FALSE(info_->feature_flags(\n ).use_arb_occlusion_query_for_occlusion_query_boolean);\n}\n\nTEST_P(FeatureInfoTest, InitializeGLES3_occlusion_query_boolean) {\n SetupInitExpectationsWithGLVersion(\"\", \"\", \"OpenGL ES 3.0\");\n if (GetContextType() == CONTEXT_TYPE_OPENGLES2) {\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(),\n \"GL_EXT_occlusion_query_boolean\"));\n }\n EXPECT_TRUE(info_->feature_flags().occlusion_query_boolean);\n}\n\nTEST_P(FeatureInfoTest, InitializeGL33_occlusion_query2) {\n SetupInitExpectationsWithGLVersion(\"\", \"\", \"3.3\");\n if (GetContextType() == CONTEXT_TYPE_OPENGLES2) {\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(),\n \"GL_EXT_occlusion_query_boolean\"));\n }\n EXPECT_TRUE(info_->feature_flags().occlusion_query_boolean);\n EXPECT_TRUE(info_->feature_flags(\n ).use_arb_occlusion_query2_for_occlusion_query_boolean);\n}\n\nTEST_P(FeatureInfoTest, InitializeGL43_occlusion_query2) {\n SetupInitExpectationsWithGLVersion(\"\", \"\", \"4.3\");\n if (GetContextType() == CONTEXT_TYPE_OPENGLES2) {\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(),\n \"GL_EXT_occlusion_query_boolean\"));\n }\n EXPECT_TRUE(info_->feature_flags().occlusion_query_boolean);\n EXPECT_FALSE(info_->feature_flags(\n ).use_arb_occlusion_query2_for_occlusion_query_boolean);\n}\n\nTEST_P(FeatureInfoTest, InitializeOES_vertex_array_object) {\n SetupInitExpectations(\"GL_OES_vertex_array_object\");\n EXPECT_TRUE(\n gfx::HasExtension(info_->extensions(), \"GL_OES_vertex_array_object\"));\n EXPECT_TRUE(info_->feature_flags().native_vertex_array_object);\n}\n\nTEST_P(FeatureInfoTest, InitializeARB_vertex_array_object) {\n SetupInitExpectations(\"GL_ARB_vertex_array_object\");\n EXPECT_TRUE(\n gfx::HasExtension(info_->extensions(), \"GL_OES_vertex_array_object\"));\n EXPECT_TRUE(info_->feature_flags().native_vertex_array_object);\n}\n\nTEST_P(FeatureInfoTest, InitializeAPPLE_vertex_array_object) {\n SetupInitExpectations(\"GL_APPLE_vertex_array_object\");\n EXPECT_TRUE(\n gfx::HasExtension(info_->extensions(), \"GL_OES_vertex_array_object\"));\n EXPECT_TRUE(info_->feature_flags().native_vertex_array_object);\n}\n\nTEST_P(FeatureInfoTest, InitializeNo_vertex_array_object) {\n SetupInitExpectations(\"\");\n // Even if the native extensions are not available the implementation\n // may still emulate the GL_OES_vertex_array_object functionality. In this\n // scenario native_vertex_array_object must be false.\n EXPECT_TRUE(\n gfx::HasExtension(info_->extensions(), \"GL_OES_vertex_array_object\"));\n EXPECT_FALSE(info_->feature_flags().native_vertex_array_object);\n}\n\nTEST_P(FeatureInfoTest, InitializeOES_element_index_uint) {\n SetupInitExpectations(\"GL_OES_element_index_uint\");\n EXPECT_TRUE(\n gfx::HasExtension(info_->extensions(), \"GL_OES_element_index_uint\"));\n EXPECT_TRUE(info_->validators()->index_type.IsValid(GL_UNSIGNED_INT));\n}\n\nTEST_P(FeatureInfoTest, InitializeEXT_blend_minmax) {\n SetupInitExpectations(\"GL_EXT_blend_minmax\");\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(), \"GL_EXT_blend_minmax\"));\n EXPECT_TRUE(info_->validators()->equation.IsValid(GL_MIN_EXT));\n EXPECT_TRUE(info_->validators()->equation.IsValid(GL_MAX_EXT));\n}\n\nTEST_P(FeatureInfoTest, InitializeEXT_frag_depth) {\n SetupInitExpectations(\"GL_EXT_frag_depth\");\n EXPECT_TRUE(info_->feature_flags().ext_frag_depth);\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(), \"GL_EXT_frag_depth\"));\n}\n\nTEST_P(FeatureInfoTest, InitializeEXT_shader_texture_lod) {\n SetupInitExpectations(\"GL_EXT_shader_texture_lod\");\n EXPECT_TRUE(info_->feature_flags().ext_shader_texture_lod);\n EXPECT_TRUE(\n gfx::HasExtension(info_->extensions(), \"GL_EXT_shader_texture_lod\"));\n}\n\nTEST_P(FeatureInfoTest, InitializeEXT_discard_framebuffer) {\n SetupInitExpectations(\"GL_EXT_discard_framebuffer\");\n EXPECT_TRUE(info_->feature_flags().ext_discard_framebuffer);\n EXPECT_TRUE(\n gfx::HasExtension(info_->extensions(), \"GL_EXT_discard_framebuffer\"));\n}\n\nTEST_P(FeatureInfoTest, InitializeSamplersWithARBSamplerObjects) {\n SetupInitExpectationsWithGLVersion(\n \"GL_ARB_sampler_objects\", \"\", \"3.0\");\n EXPECT_TRUE(info_->feature_flags().enable_samplers);\n}\n\nTEST_P(FeatureInfoTest, InitializeWithES3) {\n SetupInitExpectationsWithGLVersion(\"\", \"\", \"OpenGL ES 3.0\");\n EXPECT_TRUE(info_->feature_flags().chromium_framebuffer_multisample);\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(),\n \"GL_CHROMIUM_framebuffer_multisample\"));\n EXPECT_TRUE(info_->feature_flags().use_async_readpixels);\n EXPECT_TRUE(info_->feature_flags().oes_standard_derivatives);\n EXPECT_TRUE(info_->feature_flags().oes_depth24);\n EXPECT_FALSE(\n gfx::HasExtension(info_->extensions(), \"GL_GOOGLE_depth_texture\"));\n EXPECT_FALSE(\n gfx::HasExtension(info_->extensions(), \"GL_CHROMIUM_depth_texture\"));\n EXPECT_FALSE(\n info_->validators()->texture_internal_format.IsValid(GL_DEPTH_COMPONENT));\n EXPECT_FALSE(\n info_->validators()->texture_internal_format.IsValid(GL_DEPTH_STENCIL));\n EXPECT_FALSE(info_->validators()->texture_format.IsValid(GL_DEPTH_COMPONENT));\n EXPECT_FALSE(info_->validators()->texture_format.IsValid(GL_DEPTH_STENCIL));\n EXPECT_FALSE(info_->validators()->pixel_type.IsValid(GL_UNSIGNED_SHORT));\n EXPECT_FALSE(info_->validators()->pixel_type.IsValid(GL_UNSIGNED_INT));\n EXPECT_FALSE(info_->validators()->pixel_type.IsValid(GL_UNSIGNED_INT_24_8));\n EXPECT_TRUE(info_->feature_flags().packed_depth24_stencil8);\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(), \"GL_OES_depth24\"));\n EXPECT_TRUE(\n info_->validators()->render_buffer_format.IsValid(GL_DEPTH_COMPONENT24));\n EXPECT_TRUE(\n info_->validators()->render_buffer_format.IsValid(GL_DEPTH24_STENCIL8));\n EXPECT_FALSE(\n info_->validators()->texture_internal_format.IsValid(GL_DEPTH_STENCIL));\n EXPECT_FALSE(info_->validators()->texture_format.IsValid(GL_DEPTH_STENCIL));\n EXPECT_TRUE(info_->feature_flags().npot_ok);\n EXPECT_TRUE(info_->feature_flags().native_vertex_array_object);\n EXPECT_TRUE(info_->feature_flags().enable_samplers);\n EXPECT_TRUE(info_->feature_flags().map_buffer_range);\n EXPECT_TRUE(info_->feature_flags().ext_discard_framebuffer);\n EXPECT_TRUE(\n gfx::HasExtension(info_->extensions(), \"GL_EXT_discard_framebuffer\"));\n EXPECT_TRUE(info_->feature_flags().chromium_sync_query);\n EXPECT_TRUE(gl::GLFence::IsSupported());\n}\n\nTEST_P(FeatureInfoTest, InitializeWithES3AndDepthTexture) {\n SetupInitExpectationsWithGLVersion(\n \"GL_ANGLE_depth_texture\", \"\", \"OpenGL ES 3.0\");\n EXPECT_TRUE(\n gfx::HasExtension(info_->extensions(), \"GL_GOOGLE_depth_texture\"));\n EXPECT_TRUE(\n gfx::HasExtension(info_->extensions(), \"GL_CHROMIUM_depth_texture\"));\n EXPECT_TRUE(\n info_->validators()->texture_internal_format.IsValid(GL_DEPTH_COMPONENT));\n EXPECT_TRUE(\n info_->validators()->texture_internal_format.IsValid(GL_DEPTH_STENCIL));\n EXPECT_TRUE(info_->validators()->texture_format.IsValid(GL_DEPTH_COMPONENT));\n EXPECT_TRUE(info_->validators()->texture_format.IsValid(GL_DEPTH_STENCIL));\n EXPECT_TRUE(info_->validators()->pixel_type.IsValid(GL_UNSIGNED_SHORT));\n EXPECT_TRUE(info_->validators()->pixel_type.IsValid(GL_UNSIGNED_INT));\n EXPECT_TRUE(info_->validators()->pixel_type.IsValid(GL_UNSIGNED_INT_24_8));\n EXPECT_TRUE(info_->feature_flags().packed_depth24_stencil8);\n EXPECT_TRUE(\n info_->validators()->texture_internal_format.IsValid(GL_DEPTH_STENCIL));\n EXPECT_TRUE(info_->validators()->texture_format.IsValid(GL_DEPTH_STENCIL));\n}\n\nTEST_P(FeatureInfoTest, InitializeWithoutSamplers) {\n SetupInitExpectationsWithGLVersion(\"\", \"\", \"3.0\");\n EXPECT_FALSE(info_->feature_flags().enable_samplers);\n}\n\nTEST_P(FeatureInfoTest, ParseDriverBugWorkaroundsSingle) {\n gpu::GpuDriverBugWorkarounds workarounds;\n workarounds.exit_on_context_lost = true;\n // Workarounds should get parsed without the need for a context.\n SetupWithWorkarounds(workarounds);\n EXPECT_TRUE(info_->workarounds().exit_on_context_lost);\n}\n\nTEST_P(FeatureInfoTest, ParseDriverBugWorkaroundsMultiple) {\n gpu::GpuDriverBugWorkarounds workarounds;\n workarounds.exit_on_context_lost = true;\n workarounds.webgl_or_caps_max_texture_size = 4096;\n // Workarounds should get parsed without the need for a context.\n SetupWithWorkarounds(workarounds);\n EXPECT_TRUE(info_->workarounds().exit_on_context_lost);\n EXPECT_EQ(4096, info_->workarounds().webgl_or_caps_max_texture_size);\n}\n\nTEST_P(FeatureInfoTest, InitializeWithARBSync) {\n SetupInitExpectations(\"GL_ARB_sync\");\n EXPECT_TRUE(info_->feature_flags().chromium_sync_query);\n EXPECT_TRUE(gl::GLFence::IsSupported());\n}\n\nTEST_P(FeatureInfoTest, InitializeWithNVFence) {\n SetupInitExpectations(\"GL_NV_fence\");\n EXPECT_TRUE(info_->feature_flags().chromium_sync_query);\n EXPECT_TRUE(gl::GLFence::IsSupported());\n}\n\nTEST_P(FeatureInfoTest, InitializeWithNVDrawBuffers) {\n SetupInitExpectationsWithGLVersion(\"GL_NV_draw_buffers\", \"\", \"OpenGL ES 3.0\");\n bool is_es2 = GetContextType() == CONTEXT_TYPE_OPENGLES2;\n EXPECT_EQ(is_es2, info_->feature_flags().nv_draw_buffers);\n EXPECT_EQ(is_es2, info_->feature_flags().ext_draw_buffers);\n}\n\nTEST_P(FeatureInfoTest, InitializeWithPreferredEXTDrawBuffers) {\n SetupInitExpectationsWithGLVersion(\n \"GL_NV_draw_buffers GL_EXT_draw_buffers\", \"\", \"OpenGL ES 3.0\");\n bool is_es2 = GetContextType() == CONTEXT_TYPE_OPENGLES2;\n EXPECT_FALSE(info_->feature_flags().nv_draw_buffers);\n EXPECT_EQ(is_es2, info_->feature_flags().ext_draw_buffers);\n}\n\nTEST_P(FeatureInfoTest, BlendEquationAdvancedDisabled) {\n gpu::GpuDriverBugWorkarounds workarounds;\n workarounds.disable_blend_equation_advanced = true;\n SetupInitExpectationsWithWorkarounds(\n \"GL_KHR_blend_equation_advanced_coherent GL_KHR_blend_equation_advanced\",\n workarounds);\n EXPECT_FALSE(info_->feature_flags().blend_equation_advanced);\n EXPECT_FALSE(info_->feature_flags().blend_equation_advanced_coherent);\n}\n\nTEST_P(FeatureInfoTest, InitializeNoKHR_blend_equation_advanced) {\n SetupInitExpectationsWithGLVersion(\"GL_ARB_compatibility\", \"\", \"4.3\");\n EXPECT_FALSE(info_->feature_flags().blend_equation_advanced);\n EXPECT_FALSE(\n gfx::HasExtension(info_->extensions(), \"GL_KHR_blend_equation_advanced\"));\n}\n\nTEST_P(FeatureInfoTest, InitializeKHR_blend_equations_advanced) {\n SetupInitExpectations(\"GL_KHR_blend_equation_advanced\");\n EXPECT_TRUE(\n gfx::HasExtension(info_->extensions(), \"GL_KHR_blend_equation_advanced\"));\n EXPECT_TRUE(info_->feature_flags().blend_equation_advanced);\n}\n\nTEST_P(FeatureInfoTest, InitializeNV_blend_equations_advanced) {\n SetupInitExpectations(\"GL_NV_blend_equation_advanced\");\n EXPECT_TRUE(\n gfx::HasExtension(info_->extensions(), \"GL_KHR_blend_equation_advanced\"));\n EXPECT_TRUE(info_->feature_flags().blend_equation_advanced);\n}\n\nTEST_P(FeatureInfoTest, InitializeNoKHR_blend_equation_advanced_coherent) {\n SetupInitExpectationsWithGLVersion(\"GL_ARB_compatibility \", \"\", \"4.3\");\n EXPECT_FALSE(info_->feature_flags().blend_equation_advanced_coherent);\n EXPECT_FALSE(gfx::HasExtension(info_->extensions(),\n \"GL_KHR_blend_equation_advanced_coherent\"));\n}\n\nTEST_P(FeatureInfoTest, InitializeKHR_blend_equations_advanced_coherent) {\n SetupInitExpectations(\"GL_KHR_blend_equation_advanced_coherent\");\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(),\n \"GL_KHR_blend_equation_advanced_coherent\"));\n EXPECT_TRUE(info_->feature_flags().blend_equation_advanced);\n EXPECT_TRUE(info_->feature_flags().blend_equation_advanced_coherent);\n}\n\nTEST_P(FeatureInfoTest, InitializeEXT_texture_rgWithFloat) {\n SetupInitExpectations(\n \"GL_EXT_texture_rg GL_OES_texture_float GL_OES_texture_half_float\");\n EXPECT_TRUE(info_->feature_flags().ext_texture_rg);\n\n EXPECT_TRUE(info_->validators()->texture_format.IsValid(GL_RED_EXT));\n EXPECT_TRUE(info_->validators()->texture_format.IsValid(GL_RG_EXT));\n EXPECT_TRUE(info_->validators()->texture_internal_format.IsValid(GL_RED_EXT));\n EXPECT_TRUE(info_->validators()->texture_internal_format.IsValid(GL_RG_EXT));\n EXPECT_TRUE(info_->validators()->read_pixel_format.IsValid(GL_RED_EXT));\n EXPECT_TRUE(info_->validators()->read_pixel_format.IsValid(GL_RG_EXT));\n EXPECT_TRUE(info_->validators()->render_buffer_format.IsValid(GL_R8_EXT));\n EXPECT_TRUE(info_->validators()->render_buffer_format.IsValid(GL_RG8_EXT));\n}\n\nTEST_P(FeatureInfoTest, InitializeARB_texture_rgNoFloat) {\n SetupInitExpectations(\"GL_ARB_texture_rg\");\n EXPECT_TRUE(info_->feature_flags().ext_texture_rg);\n\n EXPECT_TRUE(info_->validators()->texture_format.IsValid(GL_RED_EXT));\n EXPECT_TRUE(info_->validators()->texture_format.IsValid(GL_RG_EXT));\n EXPECT_TRUE(info_->validators()->texture_internal_format.IsValid(GL_RED_EXT));\n EXPECT_TRUE(info_->validators()->texture_internal_format.IsValid(GL_RG_EXT));\n EXPECT_TRUE(info_->validators()->read_pixel_format.IsValid(GL_RED_EXT));\n EXPECT_TRUE(info_->validators()->read_pixel_format.IsValid(GL_RG_EXT));\n EXPECT_TRUE(info_->validators()->render_buffer_format.IsValid(GL_R8_EXT));\n EXPECT_TRUE(info_->validators()->render_buffer_format.IsValid(GL_RG8_EXT));\n}\n\nTEST_P(FeatureInfoTest, InitializeEXT_texture_norm16) {\n SetupInitExpectations(\"GL_EXT_texture_norm16\");\n\n if (!info_->IsWebGL2OrES3OrHigherContext()) {\n return;\n }\n\n EXPECT_TRUE(info_->feature_flags().ext_texture_norm16);\n\n EXPECT_TRUE(info_->validators()->texture_format.IsValid(GL_RED_EXT));\n EXPECT_TRUE(info_->validators()->texture_format.IsValid(GL_RG_EXT));\n EXPECT_TRUE(info_->validators()->texture_format.IsValid(GL_RGB));\n EXPECT_TRUE(info_->validators()->texture_format.IsValid(GL_RGBA));\n EXPECT_TRUE(info_->validators()->texture_internal_format.IsValid(GL_R16_EXT));\n EXPECT_TRUE(\n info_->validators()->texture_internal_format.IsValid(GL_RG16_EXT));\n EXPECT_TRUE(\n info_->validators()->texture_internal_format.IsValid(GL_RGB16_EXT));\n EXPECT_TRUE(\n info_->validators()->texture_internal_format.IsValid(GL_RGBA16_EXT));\n EXPECT_TRUE(info_->validators()->read_pixel_format.IsValid(GL_R16_EXT));\n EXPECT_TRUE(info_->validators()->read_pixel_format.IsValid(GL_RG16_EXT));\n EXPECT_TRUE(info_->validators()->read_pixel_format.IsValid(GL_RGBA16_EXT));\n EXPECT_TRUE(info_->validators()->render_buffer_format.IsValid(GL_R16_EXT));\n EXPECT_TRUE(info_->validators()->render_buffer_format.IsValid(GL_RG16_EXT));\n EXPECT_TRUE(info_->validators()->render_buffer_format.IsValid(GL_RGBA16_EXT));\n EXPECT_TRUE(\n info_->validators()->texture_internal_format_storage.IsValid(GL_R16_EXT));\n EXPECT_TRUE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_RG16_EXT));\n EXPECT_TRUE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_RGB16_EXT));\n EXPECT_TRUE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_RGBA16_EXT));\n}\n\nTEST_P(FeatureInfoTest, InitializeMESAFramebufferFlipYExtensionTrue) {\n SetupInitExpectations(\"GL_MESA_framebuffer_flip_y\");\n EXPECT_TRUE(info_->feature_flags().mesa_framebuffer_flip_y);\n}\n\n} // namespace gles2\n} // namespace gpu\n"
},
"written_data": {
"gpu/command_buffer/service/feature_info_unittest.cc": "// Copyright 2012 The Chromium Authors\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\n#include \"gpu/command_buffer/service/feature_info.h\"\n\n#include <stddef.h>\n\n#include <memory>\n\n#include \"gpu/command_buffer/service/gpu_service_test.h\"\n#include \"gpu/command_buffer/service/gpu_switches.h\"\n#include \"gpu/command_buffer/service/test_helper.h\"\n#include \"gpu/command_buffer/service/texture_manager.h\"\n#include \"gpu/config/gpu_driver_bug_workarounds.h\"\n#include \"gpu/config/gpu_switches.h\"\n#include \"testing/gtest/include/gtest/gtest.h\"\n#include \"ui/gl/gl_fence.h\"\n#include \"ui/gl/gl_implementation.h\"\n#include \"ui/gl/gl_mock.h\"\n#include \"ui/gl/gl_version_info.h\"\n\nusing ::testing::_;\nusing ::testing::DoAll;\nusing ::testing::HasSubstr;\nusing ::testing::InSequence;\nusing ::testing::MatcherCast;\nusing ::testing::Not;\nusing ::testing::Pointee;\nusing ::testing::Return;\nusing ::testing::SetArrayArgument;\nusing ::testing::SetArgPointee;\nusing ::testing::StrEq;\n\nnamespace gpu {\nnamespace gles2 {\n\nnamespace {\nconst char kGLRendererStringANGLE[] = \"ANGLE (some renderer)\";\n} // anonymous namespace\n\nenum MockedGLVersionKind {\n ES2_on_Version3_0,\n ES2_on_Version3_2Compatibility,\n ES3_on_Version3_0,\n ES3_on_Version3_2Compatibility,\n\n // Currently, nothing cares about both ES version and passthrough, so just\n // create one representative passthrough case.\n ES2_on_Version3_0_Passthrough\n};\n\nclass FeatureInfoTest\n : public GpuServiceTest,\n public ::testing::WithParamInterface<MockedGLVersionKind> {\n public:\n FeatureInfoTest() = default;\n\n void SetupInitExpectations(const char* extensions) {\n std::string extensions_str = extensions;\n // Most of the tests' expectations currently assume the desktop\n // OpenGL compatibility profile.\n switch (GetParam()) {\n case ES2_on_Version3_0:\n case ES2_on_Version3_0_Passthrough:\n case ES3_on_Version3_0:\n SetupInitExpectationsWithGLVersion(extensions_str.c_str(), \"\", \"3.0\");\n break;\n case ES2_on_Version3_2Compatibility:\n case ES3_on_Version3_2Compatibility:\n if (extensions_str.find(\"GL_ARB_compatibility\") == std::string::npos) {\n extensions_str += \" GL_ARB_compatibility\";\n }\n SetupInitExpectationsWithGLVersion(extensions_str.c_str(), \"\", \"3.2\");\n break;\n default:\n NOTREACHED_IN_MIGRATION();\n break;\n }\n }\n\n ContextType GetContextType() {\n switch (GetParam()) {\n case ES2_on_Version3_0:\n case ES2_on_Version3_0_Passthrough:\n case ES2_on_Version3_2Compatibility:\n return CONTEXT_TYPE_OPENGLES2;\n case ES3_on_Version3_0:\n case ES3_on_Version3_2Compatibility:\n return CONTEXT_TYPE_OPENGLES3;\n default:\n NOTREACHED_IN_MIGRATION();\n return CONTEXT_TYPE_OPENGLES2;\n }\n }\n\n bool IsPassthroughCmdDecoder() {\n switch (GetParam()) {\n case ES2_on_Version3_0_Passthrough:\n return true;\n case ES2_on_Version3_0:\n case ES2_on_Version3_2Compatibility:\n case ES3_on_Version3_0:\n case ES3_on_Version3_2Compatibility:\n return false;\n default:\n NOTREACHED_IN_MIGRATION();\n return false;\n }\n }\n\n void SetupInitExpectationsWithGLVersion(\n const char* extensions, const char* renderer, const char* version) {\n GpuServiceTest::SetUpWithGLVersion(version, extensions);\n TestHelper::SetupFeatureInfoInitExpectationsWithGLVersion(\n gl_.get(), extensions, renderer, version, GetContextType());\n info_ = new FeatureInfo();\n info_->Initialize(GetContextType(), IsPassthroughCmdDecoder(),\n DisallowedFeatures());\n }\n\n void SetupInitExpectationsWithGLVersionAndDisallowedFeatures(\n const char* extensions,\n const char* renderer,\n const char* version,\n const DisallowedFeatures& disallowed_features) {\n GpuServiceTest::SetUpWithGLVersion(version, extensions);\n TestHelper::SetupFeatureInfoInitExpectationsWithGLVersion(\n gl_.get(), extensions, renderer, version, GetContextType());\n info_ = new FeatureInfo();\n info_->Initialize(GetContextType(), IsPassthroughCmdDecoder(),\n disallowed_features);\n }\n\n void SetupWithWorkarounds(const gpu::GpuDriverBugWorkarounds& workarounds) {\n GpuServiceTest::SetUp();\n info_ = new FeatureInfo(workarounds, GpuFeatureInfo());\n }\n\n void SetupInitExpectationsWithWorkarounds(\n const char* extensions,\n const gpu::GpuDriverBugWorkarounds& workarounds) {\n GpuServiceTest::SetUpWithGLVersion(\"2.0\", extensions);\n TestHelper::SetupFeatureInfoInitExpectationsWithGLVersion(\n gl_.get(), extensions, \"\", \"\", GetContextType());\n info_ = new FeatureInfo(workarounds, GpuFeatureInfo());\n info_->Initialize(GetContextType(), IsPassthroughCmdDecoder(),\n DisallowedFeatures());\n }\n\n void SetupWithoutInit() {\n GpuServiceTest::SetUp();\n info_ = new FeatureInfo();\n }\n\n protected:\n void SetUp() override {\n // Do nothing here, since we are using the explicit Setup*() functions.\n }\n\n void TearDown() override {\n info_ = nullptr;\n GpuServiceTest::TearDown();\n }\n\n scoped_refptr<FeatureInfo> info_;\n};\n\nstatic const MockedGLVersionKind kGLVersionKinds[] = {\n ES2_on_Version3_0,\n ES2_on_Version3_2Compatibility,\n ES3_on_Version3_0,\n ES3_on_Version3_2Compatibility\n};\n\nINSTANTIATE_TEST_SUITE_P(Service,\n FeatureInfoTest,\n ::testing::ValuesIn(kGLVersionKinds));\n\nTEST_P(FeatureInfoTest, DISABLED_Basic) {\n SetupWithoutInit();\n // Test it starts off uninitialized.\n EXPECT_FALSE(info_->feature_flags().chromium_framebuffer_multisample);\n EXPECT_FALSE(info_->feature_flags().multisampled_render_to_texture);\n EXPECT_FALSE(info_->feature_flags(\n ).use_img_for_multisampled_render_to_texture);\n EXPECT_FALSE(info_->feature_flags().oes_standard_derivatives);\n EXPECT_FALSE(info_->feature_flags().npot_ok);\n EXPECT_FALSE(info_->feature_flags().enable_texture_float_linear);\n EXPECT_FALSE(info_->feature_flags().enable_texture_half_float_linear);\n EXPECT_FALSE(info_->feature_flags().oes_egl_image_external);\n EXPECT_FALSE(info_->feature_flags().nv_egl_stream_consumer_external);\n EXPECT_FALSE(info_->feature_flags().oes_depth24);\n EXPECT_FALSE(info_->feature_flags().packed_depth24_stencil8);\n EXPECT_FALSE(info_->feature_flags().angle_translated_shader_source);\n EXPECT_FALSE(info_->feature_flags().angle_pack_reverse_row_order);\n EXPECT_FALSE(info_->feature_flags().arb_texture_rectangle);\n EXPECT_FALSE(info_->feature_flags().angle_instanced_arrays);\n EXPECT_FALSE(info_->feature_flags().occlusion_query_boolean);\n EXPECT_FALSE(info_->feature_flags(\n ).use_arb_occlusion_query2_for_occlusion_query_boolean);\n EXPECT_FALSE(info_->feature_flags(\n ).use_arb_occlusion_query_for_occlusion_query_boolean);\n EXPECT_FALSE(info_->feature_flags().native_vertex_array_object);\n EXPECT_FALSE(info_->feature_flags().map_buffer_range);\n EXPECT_FALSE(info_->feature_flags().use_async_readpixels);\n EXPECT_FALSE(info_->feature_flags().ext_draw_buffers);\n EXPECT_FALSE(info_->feature_flags().nv_draw_buffers);\n EXPECT_FALSE(info_->feature_flags().ext_discard_framebuffer);\n EXPECT_FALSE(info_->feature_flags().angle_depth_texture);\n EXPECT_FALSE(info_->feature_flags().ext_read_format_bgra);\n\n#define GPU_OP(type, name) EXPECT_FALSE(info_->workarounds().name);\n GPU_DRIVER_BUG_WORKAROUNDS(GPU_OP)\n#undef GPU_OP\n EXPECT_EQ(0, info_->workarounds().webgl_or_caps_max_texture_size);\n EXPECT_FALSE(info_->workarounds().gl_clear_broken);\n}\n\nTEST_P(FeatureInfoTest, InitializeNoExtensions) {\n SetupInitExpectations(\"\");\n // Check default extensions are there\n EXPECT_TRUE(\n gfx::HasExtension(info_->extensions(), \"GL_CHROMIUM_resource_safe\"));\n EXPECT_TRUE(\n gfx::HasExtension(info_->extensions(), \"GL_CHROMIUM_strict_attribs\"));\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(),\n \"GL_ANGLE_translated_shader_source\"));\n EXPECT_TRUE(\n gfx::HasExtension(info_->extensions(), \"GL_CHROMIUM_trace_marker\"));\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(), \"GL_EXT_unpack_subimage\"));\n\n bool expect_ext_srgb = false;\n switch (GetParam()) {\n case ES2_on_Version3_0:\n case ES3_on_Version3_0:\n case ES3_on_Version3_2Compatibility:\n break;\n case ES2_on_Version3_2Compatibility:\n // sRGB features are available as core GL 3.2.\n expect_ext_srgb = true;\n break;\n default:\n NOTREACHED_IN_MIGRATION();\n break;\n }\n // Note that because GL_EXT_sRGB is a substring of GL_EXT_sRGB_write_control,\n // which is not part of the ES3 core, we have to be careful to search for\n // \"GL_EXT_sRGB \", and append a space to the end of the extension string.\n if (expect_ext_srgb) {\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(), \"GL_EXT_sRGB\"));\n EXPECT_TRUE(info_->validators()->texture_format.IsValid(GL_SRGB_EXT));\n EXPECT_TRUE(info_->validators()->texture_format.IsValid(GL_SRGB_ALPHA_EXT));\n EXPECT_TRUE(info_->validators()->texture_internal_format.IsValid(\n GL_SRGB_EXT));\n EXPECT_TRUE(info_->validators()->texture_internal_format.IsValid(\n GL_SRGB_ALPHA_EXT));\n EXPECT_TRUE(info_->validators()->render_buffer_format.IsValid(\n GL_SRGB8_ALPHA8_EXT));\n EXPECT_TRUE(info_->validators()->framebuffer_attachment_parameter.IsValid(\n GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT));\n } else {\n EXPECT_FALSE(gfx::HasExtension(info_->extensions(), \"GL_EXT_sRGB\"));\n EXPECT_FALSE(info_->validators()->texture_format.IsValid(GL_SRGB_EXT));\n EXPECT_FALSE(info_->validators()->texture_format.IsValid(\n GL_SRGB_ALPHA_EXT));\n EXPECT_FALSE(info_->validators()->texture_internal_format.IsValid(\n GL_SRGB_EXT));\n EXPECT_FALSE(info_->validators()->texture_internal_format.IsValid(\n GL_SRGB_ALPHA_EXT));\n EXPECT_FALSE(info_->validators()->render_buffer_format.IsValid(\n GL_SRGB8_ALPHA8_EXT));\n EXPECT_FALSE(info_->validators()->framebuffer_attachment_parameter.IsValid(\n GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT));\n }\n\n // Check a couple of random extensions that should not be there.\n EXPECT_FALSE(gfx::HasExtension(info_->extensions(), \"GL_OES_texture_npot\"));\n EXPECT_FALSE(gfx::HasExtension(info_->extensions(),\n \"GL_ANGLE_texture_compression_dxt1\"));\n EXPECT_FALSE(gfx::HasExtension(info_->extensions(),\n \"GL_ANGLE_texture_compression_dxt3\"));\n EXPECT_FALSE(gfx::HasExtension(info_->extensions(),\n \"GL_ANGLE_texture_compression_dxt5\"));\n EXPECT_FALSE(\n gfx::HasExtension(info_->extensions(), \"GL_ANGLE_texture_usage\"));\n EXPECT_FALSE(\n gfx::HasExtension(info_->extensions(), \"GL_EXT_texture_storage\"));\n EXPECT_FALSE(gfx::HasExtension(info_->extensions(),\n \"GL_OES_compressed_ETC1_RGB8_texture\"));\n EXPECT_FALSE(\n gfx::HasExtension(info_->extensions(), \"GL_AMD_compressed_ATC_texture\"));\n EXPECT_FALSE(gfx::HasExtension(info_->extensions(),\n \"GL_IMG_texture_compression_pvrtc\"));\n EXPECT_FALSE(gfx::HasExtension(info_->extensions(),\n \"GL_EXT_texture_compression_s3tc_srgb\"));\n EXPECT_FALSE(info_->feature_flags().npot_ok);\n EXPECT_FALSE(info_->validators()->compressed_texture_format.IsValid(\n GL_COMPRESSED_RGB_S3TC_DXT1_EXT));\n EXPECT_FALSE(info_->validators()->compressed_texture_format.IsValid(\n GL_COMPRESSED_RGBA_S3TC_DXT1_EXT));\n EXPECT_FALSE(info_->validators()->compressed_texture_format.IsValid(\n GL_COMPRESSED_RGBA_S3TC_DXT3_EXT));\n EXPECT_FALSE(info_->validators()->compressed_texture_format.IsValid(\n GL_COMPRESSED_RGBA_S3TC_DXT5_EXT));\n EXPECT_FALSE(info_->validators()->compressed_texture_format.IsValid(\n GL_COMPRESSED_SRGB_S3TC_DXT1_EXT));\n EXPECT_FALSE(info_->validators()->compressed_texture_format.IsValid(\n GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT));\n EXPECT_FALSE(info_->validators()->compressed_texture_format.IsValid(\n GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT));\n EXPECT_FALSE(info_->validators()->compressed_texture_format.IsValid(\n GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT));\n EXPECT_FALSE(info_->validators()->compressed_texture_format.IsValid(\n GL_ETC1_RGB8_OES));\n EXPECT_FALSE(info_->validators()->compressed_texture_format.IsValid(\n GL_ATC_RGB_AMD));\n EXPECT_FALSE(info_->validators()->compressed_texture_format.IsValid(\n GL_ATC_RGBA_EXPLICIT_ALPHA_AMD));\n EXPECT_FALSE(info_->validators()->compressed_texture_format.IsValid(\n GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD));\n EXPECT_FALSE(info_->validators()->compressed_texture_format.IsValid(\n GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG));\n EXPECT_FALSE(info_->validators()->compressed_texture_format.IsValid(\n GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG));\n EXPECT_FALSE(info_->validators()->compressed_texture_format.IsValid(\n GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG));\n EXPECT_FALSE(info_->validators()->compressed_texture_format.IsValid(\n GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG));\n EXPECT_FALSE(info_->validators()->texture_parameter.IsValid(\n GL_TEXTURE_MAX_ANISOTROPY_EXT));\n EXPECT_FALSE(info_->validators()->g_l_state.IsValid(\n GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT));\n EXPECT_FALSE(info_->validators()->framebuffer_target.IsValid(\n GL_READ_FRAMEBUFFER_EXT));\n EXPECT_FALSE(info_->validators()->framebuffer_target.IsValid(\n GL_DRAW_FRAMEBUFFER_EXT));\n EXPECT_FALSE(info_->validators()->g_l_state.IsValid(\n GL_READ_FRAMEBUFFER_BINDING_EXT));\n EXPECT_FALSE(info_->validators()->render_buffer_parameter.IsValid(\n GL_MAX_SAMPLES_EXT));\n EXPECT_FALSE(info_->validators()->texture_internal_format.IsValid(\n GL_DEPTH_COMPONENT));\n EXPECT_FALSE(info_->validators()->texture_format.IsValid(GL_DEPTH_COMPONENT));\n EXPECT_FALSE(info_->validators()->pixel_type.IsValid(GL_UNSIGNED_SHORT));\n EXPECT_FALSE(info_->validators()->pixel_type.IsValid(GL_UNSIGNED_INT));\n EXPECT_FALSE(info_->validators()->render_buffer_format.IsValid(\n GL_DEPTH24_STENCIL8));\n EXPECT_FALSE(info_->validators()->texture_internal_format.IsValid(\n GL_DEPTH_STENCIL));\n EXPECT_FALSE(info_->validators()->texture_internal_format.IsValid(\n GL_RGBA32F));\n EXPECT_FALSE(info_->validators()->texture_internal_format.IsValid(\n GL_RGB32F));\n EXPECT_FALSE(info_->validators()->texture_format.IsValid(\n GL_DEPTH_STENCIL));\n EXPECT_FALSE(info_->validators()->pixel_type.IsValid(\n GL_UNSIGNED_INT_24_8));\n EXPECT_FALSE(info_->validators()->render_buffer_format.IsValid(\n GL_DEPTH_COMPONENT24));\n EXPECT_FALSE(info_->validators()->texture_parameter.IsValid(\n GL_TEXTURE_USAGE_ANGLE));\n EXPECT_FALSE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_DEPTH_COMPONENT16));\n EXPECT_FALSE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_DEPTH_COMPONENT32_OES));\n EXPECT_FALSE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_DEPTH24_STENCIL8_OES));\n EXPECT_FALSE(info_->validators()->equation.IsValid(GL_MIN_EXT));\n EXPECT_FALSE(info_->validators()->equation.IsValid(GL_MAX_EXT));\n EXPECT_FALSE(info_->feature_flags().chromium_sync_query);\n EXPECT_FALSE(info_->feature_flags().chromium_image_ycbcr_422);\n}\n\nTEST_P(FeatureInfoTest, InitializeWithANGLE) {\n SetupInitExpectationsWithGLVersion(\"\", kGLRendererStringANGLE, \"\");\n EXPECT_TRUE(info_->gl_version_info().is_angle);\n}\n\nTEST_P(FeatureInfoTest, InitializeWithANGLED3D9Ex) {\n SetupInitExpectationsWithGLVersion(\"\", \"ANGLE (foo bar Direct3D9Ex baz)\", \"\");\n EXPECT_TRUE(info_->gl_version_info().is_angle);\n EXPECT_TRUE(info_->gl_version_info().is_d3d);\n}\n\nTEST_P(FeatureInfoTest, InitializeWithANGLED3D11) {\n SetupInitExpectationsWithGLVersion(\"\", \"ANGLE (foo bar Direct3D11 baz)\", \"\");\n EXPECT_TRUE(info_->gl_version_info().is_angle);\n EXPECT_TRUE(info_->gl_version_info().is_d3d);\n}\n\nTEST_P(FeatureInfoTest, InitializeWithANGLEOpenGL) {\n SetupInitExpectationsWithGLVersion(\"\", \"ANGLE (foo bar OpenGL baz)\", \"\");\n EXPECT_TRUE(info_->gl_version_info().is_angle);\n EXPECT_FALSE(info_->gl_version_info().is_d3d);\n}\n\nTEST_P(FeatureInfoTest, InitializeNPOTExtensionGLES) {\n SetupInitExpectations(\"GL_OES_texture_npot\");\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(), \"GL_OES_texture_npot\"));\n EXPECT_TRUE(info_->feature_flags().npot_ok);\n}\n\nTEST_P(FeatureInfoTest, InitializeNPOTExtensionGL) {\n SetupInitExpectations(\"GL_ARB_texture_non_power_of_two\");\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(), \"GL_OES_texture_npot\"));\n EXPECT_TRUE(info_->feature_flags().npot_ok);\n}\n\nTEST_P(FeatureInfoTest, InitializeDXTExtensionGLES2) {\n SetupInitExpectations(\"GL_ANGLE_texture_compression_dxt1\");\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(),\n \"GL_ANGLE_texture_compression_dxt1\"));\n EXPECT_TRUE(info_->validators()->compressed_texture_format.IsValid(\n GL_COMPRESSED_RGB_S3TC_DXT1_EXT));\n EXPECT_TRUE(info_->validators()->compressed_texture_format.IsValid(\n GL_COMPRESSED_RGBA_S3TC_DXT1_EXT));\n EXPECT_FALSE(info_->validators()->compressed_texture_format.IsValid(\n GL_COMPRESSED_RGBA_S3TC_DXT3_EXT));\n EXPECT_FALSE(info_->validators()->compressed_texture_format.IsValid(\n GL_COMPRESSED_RGBA_S3TC_DXT5_EXT));\n}\n\nTEST_P(FeatureInfoTest, InitializeDXTExtensionGL) {\n SetupInitExpectations(\"GL_EXT_texture_compression_s3tc\");\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(),\n \"GL_ANGLE_texture_compression_dxt1\"));\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(),\n \"GL_ANGLE_texture_compression_dxt3\"));\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(),\n \"GL_ANGLE_texture_compression_dxt5\"));\n EXPECT_TRUE(info_->validators()->compressed_texture_format.IsValid(\n GL_COMPRESSED_RGB_S3TC_DXT1_EXT));\n EXPECT_TRUE(info_->validators()->compressed_texture_format.IsValid(\n GL_COMPRESSED_RGBA_S3TC_DXT1_EXT));\n EXPECT_TRUE(info_->validators()->compressed_texture_format.IsValid(\n GL_COMPRESSED_RGBA_S3TC_DXT3_EXT));\n EXPECT_TRUE(info_->validators()->compressed_texture_format.IsValid(\n GL_COMPRESSED_RGBA_S3TC_DXT5_EXT));\n}\n\nTEST_P(FeatureInfoTest, InitializeEXT_texture_compression_s3tc_srgb) {\n SetupInitExpectationsWithGLVersion(\"GL_NV_sRGB_formats\", \"\",\n \"OpenGL ES 2.0\");\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(),\n \"GL_EXT_texture_compression_s3tc_srgb\"));\n EXPECT_TRUE(info_->validators()->compressed_texture_format.IsValid(\n GL_COMPRESSED_SRGB_S3TC_DXT1_EXT));\n EXPECT_TRUE(info_->validators()->compressed_texture_format.IsValid(\n GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT));\n EXPECT_TRUE(info_->validators()->compressed_texture_format.IsValid(\n GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT));\n EXPECT_TRUE(info_->validators()->compressed_texture_format.IsValid(\n GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT));\n}\n\nTEST_P(FeatureInfoTest, InitializeEXT_texture_compression_s3tc_srgbGL) {\n SetupInitExpectations(\"GL_EXT_texture_sRGB GL_EXT_texture_compression_s3tc\");\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(),\n \"GL_EXT_texture_compression_s3tc_srgb\"));\n EXPECT_TRUE(info_->validators()->compressed_texture_format.IsValid(\n GL_COMPRESSED_SRGB_S3TC_DXT1_EXT));\n EXPECT_TRUE(info_->validators()->compressed_texture_format.IsValid(\n GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT));\n EXPECT_TRUE(info_->validators()->compressed_texture_format.IsValid(\n GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT));\n EXPECT_TRUE(info_->validators()->compressed_texture_format.IsValid(\n GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT));\n}\n\nTEST_P(FeatureInfoTest, InitializeANGLE_compressed_texture_etc) {\n SetupInitExpectationsWithGLVersion(\"\", \"\",\n \"OpenGL ES 3.0\");\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(),\n \"GL_ANGLE_compressed_texture_etc\"));\n EXPECT_TRUE(info_->validators()->compressed_texture_format.IsValid(\n GL_COMPRESSED_R11_EAC));\n EXPECT_TRUE(info_->validators()->compressed_texture_format.IsValid(\n GL_COMPRESSED_SIGNED_R11_EAC));\n EXPECT_TRUE(info_->validators()->compressed_texture_format.IsValid(\n GL_COMPRESSED_RGB8_ETC2));\n EXPECT_TRUE(info_->validators()->compressed_texture_format.IsValid(\n GL_COMPRESSED_SRGB8_ETC2));\n EXPECT_TRUE(info_->validators()->compressed_texture_format.IsValid(\n GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2));\n EXPECT_TRUE(info_->validators()->compressed_texture_format.IsValid(\n GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2));\n EXPECT_TRUE(info_->validators()->compressed_texture_format.IsValid(\n GL_COMPRESSED_RG11_EAC));\n EXPECT_TRUE(info_->validators()->compressed_texture_format.IsValid(\n GL_COMPRESSED_SIGNED_RG11_EAC));\n EXPECT_TRUE(info_->validators()->compressed_texture_format.IsValid(\n GL_COMPRESSED_RGBA8_ETC2_EAC));\n EXPECT_TRUE(info_->validators()->compressed_texture_format.IsValid(\n GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC));\n\n EXPECT_TRUE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_COMPRESSED_R11_EAC));\n EXPECT_TRUE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_COMPRESSED_SIGNED_R11_EAC));\n EXPECT_TRUE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_COMPRESSED_RGB8_ETC2));\n EXPECT_TRUE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_COMPRESSED_SRGB8_ETC2));\n EXPECT_TRUE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2));\n EXPECT_TRUE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2));\n EXPECT_TRUE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_COMPRESSED_RG11_EAC));\n EXPECT_TRUE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_COMPRESSED_SIGNED_RG11_EAC));\n EXPECT_TRUE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_COMPRESSED_RGBA8_ETC2_EAC));\n EXPECT_TRUE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC));\n}\n\nTEST_P(FeatureInfoTest, InitializeEXT_texture_format_BGRA8888GLES2) {\n SetupInitExpectationsWithGLVersion(\"GL_EXT_texture_format_BGRA8888\", \"\",\n \"OpenGL ES 2.0\");\n EXPECT_TRUE(\n gfx::HasExtension(info_->extensions(), \"GL_EXT_texture_format_BGRA8888\"));\n EXPECT_TRUE(info_->validators()->texture_format.IsValid(\n GL_BGRA_EXT));\n EXPECT_TRUE(info_->validators()->texture_internal_format.IsValid(\n GL_BGRA_EXT));\n\n // On GL ES, render buffer and read pixels functionality is unrelated to\n // GL_EXT_texture_format_BGRA8888, make sure we don't enable it.\n EXPECT_FALSE(info_->validators()->render_buffer_format.IsValid(\n GL_BGRA8_EXT));\n EXPECT_FALSE(info_->feature_flags().ext_render_buffer_format_bgra8888);\n EXPECT_FALSE(info_->validators()->read_pixel_format.IsValid(GL_BGRA8_EXT));\n EXPECT_FALSE(info_->feature_flags().ext_read_format_bgra);\n}\n\nTEST_P(FeatureInfoTest, InitializeEXT_texture_format_BGRA8888GL) {\n SetupInitExpectationsWithGLVersion(\"\", \"\", \"OpenGL 2.0\");\n EXPECT_TRUE(\n gfx::HasExtension(info_->extensions(), \"GL_EXT_texture_format_BGRA8888\"));\n EXPECT_TRUE(info_->validators()->texture_format.IsValid(\n GL_BGRA_EXT));\n EXPECT_TRUE(info_->validators()->texture_internal_format.IsValid(\n GL_BGRA_EXT));\n}\n\nTEST_P(FeatureInfoTest, InitializeEXT_texture_format_BGRA8888Apple) {\n SetupInitExpectationsWithGLVersion(\"GL_APPLE_texture_format_BGRA8888\", \"\",\n \"OpenGL ES 2.0\");\n EXPECT_TRUE(\n gfx::HasExtension(info_->extensions(), \"GL_EXT_texture_format_BGRA8888\"));\n EXPECT_TRUE(info_->validators()->texture_format.IsValid(\n GL_BGRA_EXT));\n EXPECT_TRUE(info_->validators()->texture_internal_format.IsValid(\n GL_BGRA_EXT));\n\n // On GL ES, render buffer and read pixels functionality is unrelated to\n // GL_APPLE_texture_format_BGRA8888, make sure we don't enable it.\n EXPECT_FALSE(info_->validators()->render_buffer_format.IsValid(\n GL_BGRA8_EXT));\n EXPECT_FALSE(info_->feature_flags().ext_render_buffer_format_bgra8888);\n EXPECT_FALSE(info_->validators()->read_pixel_format.IsValid(GL_BGRA8_EXT));\n EXPECT_FALSE(info_->feature_flags().ext_read_format_bgra);\n}\n\nTEST_P(FeatureInfoTest, InitializeGLES_no_EXT_texture_format_BGRA8888GL) {\n SetupInitExpectationsWithGLVersion(\"\", \"\", \"OpenGL ES 2.0\");\n EXPECT_FALSE(\n gfx::HasExtension(info_->extensions(), \"GL_EXT_texture_format_BGRA8888\"));\n EXPECT_FALSE(info_->validators()->texture_format.IsValid(GL_BGRA_EXT));\n EXPECT_FALSE(\n info_->validators()->texture_internal_format.IsValid(GL_BGRA_EXT));\n}\n\nTEST_P(FeatureInfoTest, InitializeGLES2EXT_read_format_bgra) {\n SetupInitExpectationsWithGLVersion(\n \"GL_EXT_read_format_bgra\", \"\", \"OpenGL ES 2.0\");\n EXPECT_TRUE(\n gfx::HasExtension(info_->extensions(), \"GL_EXT_read_format_bgra\"));\n EXPECT_TRUE(info_->feature_flags().ext_read_format_bgra);\n EXPECT_TRUE(info_->validators()->read_pixel_format.IsValid(\n GL_BGRA_EXT));\n\n // On GL ES, texture and render buffer functionality is unrelated to\n // GL_EXT_read_format_bgra, make sure we don't enable it.\n EXPECT_FALSE(info_->validators()->render_buffer_format.IsValid(\n GL_BGRA8_EXT));\n EXPECT_FALSE(info_->feature_flags().ext_render_buffer_format_bgra8888);\n EXPECT_FALSE(info_->validators()->texture_format.IsValid(GL_BGRA_EXT));\n EXPECT_FALSE(\n info_->validators()->texture_internal_format.IsValid(GL_BGRA_EXT));\n}\n\nTEST_P(FeatureInfoTest, InitializeGLEXT_read_format_bgra) {\n SetupInitExpectationsWithGLVersion(\"\", \"\", \"OpenGL 2.0\");\n EXPECT_TRUE(\n gfx::HasExtension(info_->extensions(), \"GL_EXT_read_format_bgra\"));\n EXPECT_TRUE(info_->feature_flags().ext_read_format_bgra);\n EXPECT_TRUE(info_->validators()->read_pixel_format.IsValid(\n GL_BGRA_EXT));\n}\n\nTEST_P(FeatureInfoTest, InitializeGLES_no_EXT_read_format_bgra) {\n SetupInitExpectationsWithGLVersion(\"\", \"\", \"OpenGL ES 2.0\");\n EXPECT_FALSE(\n gfx::HasExtension(info_->extensions(), \"GL_EXT_read_format_bgra\"));\n EXPECT_FALSE(info_->feature_flags().ext_read_format_bgra);\n EXPECT_FALSE(info_->validators()->read_pixel_format.IsValid(GL_BGRA_EXT));\n}\n\nTEST_P(FeatureInfoTest, InitializeEXT_sRGB) {\n SetupInitExpectations(\"GL_EXT_sRGB GL_OES_rgb8_rgba8\");\n\n if (GetContextType() == CONTEXT_TYPE_OPENGLES3) {\n EXPECT_FALSE(gfx::HasExtension(info_->extensions(), \"GL_EXT_sRGB\"));\n EXPECT_FALSE(info_->validators()->texture_format.IsValid(GL_SRGB_EXT));\n EXPECT_FALSE(\n info_->validators()->texture_format.IsValid(GL_SRGB_ALPHA_EXT));\n EXPECT_FALSE(\n info_->validators()->texture_internal_format.IsValid(GL_SRGB_EXT));\n EXPECT_FALSE(info_->validators()->texture_internal_format.IsValid(\n GL_SRGB_ALPHA_EXT));\n EXPECT_FALSE(\n info_->validators()->render_buffer_format.IsValid(GL_SRGB8_ALPHA8_EXT));\n EXPECT_FALSE(info_->validators()->framebuffer_attachment_parameter.IsValid(\n GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT));\n } else {\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(), \"GL_EXT_sRGB\"));\n EXPECT_TRUE(info_->validators()->texture_format.IsValid(GL_SRGB_EXT));\n EXPECT_TRUE(info_->validators()->texture_format.IsValid(GL_SRGB_ALPHA_EXT));\n EXPECT_TRUE(\n info_->validators()->texture_internal_format.IsValid(GL_SRGB_EXT));\n EXPECT_TRUE(info_->validators()->texture_internal_format.IsValid(\n GL_SRGB_ALPHA_EXT));\n EXPECT_TRUE(\n info_->validators()->render_buffer_format.IsValid(GL_SRGB8_ALPHA8_EXT));\n EXPECT_TRUE(info_->validators()->framebuffer_attachment_parameter.IsValid(\n GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT));\n }\n}\n\nTEST_P(FeatureInfoTest, InitializeGLES2EXT_texture_storage) {\n SetupInitExpectationsWithGLVersion(\n \"GL_EXT_texture_storage\", \"\", \"OpenGL ES 2.0\");\n EXPECT_TRUE(info_->feature_flags().ext_texture_storage);\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(), \"GL_EXT_texture_storage\"));\n EXPECT_TRUE(info_->validators()->texture_parameter.IsValid(\n GL_TEXTURE_IMMUTABLE_FORMAT_EXT));\n EXPECT_FALSE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_BGRA8_EXT));\n EXPECT_FALSE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_RGBA32F_EXT));\n EXPECT_FALSE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_RGB32F_EXT));\n EXPECT_FALSE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_ALPHA32F_EXT));\n EXPECT_FALSE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_LUMINANCE32F_EXT));\n EXPECT_FALSE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_LUMINANCE_ALPHA32F_EXT));\n EXPECT_FALSE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_RGBA16F_EXT));\n EXPECT_FALSE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_RGB16F_EXT));\n EXPECT_FALSE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_ALPHA16F_EXT));\n EXPECT_FALSE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_LUMINANCE16F_EXT));\n EXPECT_FALSE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_LUMINANCE_ALPHA16F_EXT));\n}\n\nTEST_P(FeatureInfoTest, InitializeEXT_texture_storage) {\n SetupInitExpectations(\"GL_EXT_texture_storage\");\n EXPECT_TRUE(info_->feature_flags().ext_texture_storage);\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(), \"GL_EXT_texture_storage\"));\n EXPECT_TRUE(info_->validators()->texture_parameter.IsValid(\n GL_TEXTURE_IMMUTABLE_FORMAT_EXT));\n EXPECT_TRUE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_BGRA8_EXT));\n EXPECT_FALSE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_RGBA32F_EXT));\n EXPECT_FALSE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_RGB32F_EXT));\n EXPECT_FALSE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_ALPHA32F_EXT));\n EXPECT_FALSE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_LUMINANCE32F_EXT));\n EXPECT_FALSE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_LUMINANCE_ALPHA32F_EXT));\n EXPECT_FALSE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_RGBA16F_EXT));\n EXPECT_FALSE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_RGB16F_EXT));\n EXPECT_FALSE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_ALPHA16F_EXT));\n EXPECT_FALSE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_LUMINANCE16F_EXT));\n EXPECT_FALSE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_LUMINANCE_ALPHA16F_EXT));\n}\n\nTEST_P(FeatureInfoTest, InitializeARB_texture_storage) {\n SetupInitExpectations(\"GL_ARB_texture_storage\");\n EXPECT_TRUE(info_->feature_flags().ext_texture_storage);\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(), \"GL_EXT_texture_storage\"));\n EXPECT_TRUE(info_->validators()->texture_parameter.IsValid(\n GL_TEXTURE_IMMUTABLE_FORMAT_EXT));\n}\n\nTEST_P(FeatureInfoTest, InitializeEXT_texture_storage_BGRA) {\n SetupInitExpectationsWithGLVersion(\"GL_EXT_texture_storage\", \"\",\n \"OpenGL 2.0\");\n EXPECT_TRUE(info_->feature_flags().ext_texture_storage);\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(), \"GL_EXT_texture_storage\"));\n EXPECT_TRUE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_BGRA8_EXT));\n EXPECT_TRUE(\n gfx::HasExtension(info_->extensions(), \"GL_EXT_texture_format_BGRA8888\"));\n}\n\nTEST_P(FeatureInfoTest, InitializeARB_texture_storage_BGRA) {\n SetupInitExpectationsWithGLVersion(\"GL_ARB_texture_storage\", \"\",\n \"OpenGL 2.0\");\n EXPECT_TRUE(info_->feature_flags().ext_texture_storage);\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(), \"GL_EXT_texture_storage\"));\n EXPECT_TRUE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_BGRA8_EXT));\n EXPECT_TRUE(\n gfx::HasExtension(info_->extensions(), \"GL_EXT_texture_format_BGRA8888\"));\n}\n\nTEST_P(FeatureInfoTest, InitializeEXT_texture_storage_BGRA8888) {\n SetupInitExpectations(\n \"GL_EXT_texture_storage GL_EXT_texture_format_BGRA8888\");\n EXPECT_TRUE(info_->feature_flags().ext_texture_storage);\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(), \"GL_EXT_texture_storage\"));\n EXPECT_TRUE(\n gfx::HasExtension(info_->extensions(), \"GL_EXT_texture_format_BGRA8888\"));\n EXPECT_TRUE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_BGRA8_EXT));\n EXPECT_TRUE(\n gfx::HasExtension(info_->extensions(), \"GL_EXT_texture_format_BGRA8888\"));\n}\n\nTEST_P(FeatureInfoTest, InitializeEXT_texture_storage_float) {\n SetupInitExpectations(\"GL_EXT_texture_storage GL_OES_texture_float\");\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(), \"GL_EXT_texture_storage\"));\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(), \"GL_OES_texture_float\"));\n EXPECT_TRUE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_RGBA32F_EXT));\n EXPECT_TRUE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_RGB32F_EXT));\n EXPECT_TRUE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_ALPHA32F_EXT));\n EXPECT_TRUE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_LUMINANCE32F_EXT));\n EXPECT_TRUE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_LUMINANCE_ALPHA32F_EXT));\n}\n\nTEST_P(FeatureInfoTest, InitializeEXT_texture_storage_half_float) {\n SetupInitExpectations(\"GL_EXT_texture_storage GL_OES_texture_half_float\");\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(), \"GL_EXT_texture_storage\"));\n EXPECT_TRUE(\n gfx::HasExtension(info_->extensions(), \"GL_OES_texture_half_float\"));\n EXPECT_TRUE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_RGBA16F_EXT));\n EXPECT_TRUE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_RGB16F_EXT));\n EXPECT_TRUE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_ALPHA16F_EXT));\n EXPECT_TRUE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_LUMINANCE16F_EXT));\n EXPECT_TRUE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_LUMINANCE_ALPHA16F_EXT));\n}\n\n// Check that desktop (unlike ES, handled below) always supports BGRA render\n// buffers.\nTEST_P(FeatureInfoTest, InitializeGL_renderbuffer_format_BGRA8888) {\n SetupInitExpectationsWithGLVersion(\"\", \"\", \"OpenGL 2.0\");\n\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(),\n \"GL_CHROMIUM_renderbuffer_format_BGRA8888\"));\n EXPECT_TRUE(info_->feature_flags().ext_render_buffer_format_bgra8888);\n EXPECT_TRUE(info_->validators()->render_buffer_format.IsValid(GL_BGRA8_EXT));\n}\n\n// Check how to handle ES, texture_storage and BGRA combination; 10 tests.\n\n// 1- ES2 + GL_EXT_texture_storage -> GL_EXT_texture_storage (and no\n// GL_EXT_texture_format_BGRA8888 - we don't claim to handle GL_BGRA8 in\n// glTexStorage2DEXT)\nTEST_P(FeatureInfoTest, InitializeGLES2_texture_storage) {\n SetupInitExpectationsWithGLVersion(\n \"GL_EXT_texture_storage\", \"\", \"OpenGL ES 2.0\");\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(), \"GL_EXT_texture_storage\"));\n EXPECT_FALSE(\n gfx::HasExtension(info_->extensions(), \"GL_EXT_texture_format_BGRA8888\"));\n}\n\n// 2- ES2 + GL_EXT_texture_storage + (GL_EXT_texture_format_BGRA8888 or\n// GL_APPLE_texture_format_bgra8888)\nTEST_P(FeatureInfoTest, InitializeGLES2_texture_storage_BGRA) {\n SetupInitExpectationsWithGLVersion(\n \"GL_EXT_texture_storage GL_EXT_texture_format_BGRA8888\",\n \"\",\n \"OpenGL ES 2.0\");\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(), \"GL_EXT_texture_storage\"));\n EXPECT_TRUE(\n gfx::HasExtension(info_->extensions(), \"GL_EXT_texture_format_BGRA8888\"));\n}\n\n// 3- ES2 + GL_EXT_texture_format_BGRA8888 or GL_APPLE_texture_format_bgra8888\nTEST_P(FeatureInfoTest, InitializeGLES2_texture_format_BGRA) {\n SetupInitExpectationsWithGLVersion(\n \"GL_EXT_texture_format_BGRA8888\", \"\", \"OpenGL ES 2.0\");\n EXPECT_FALSE(\n gfx::HasExtension(info_->extensions(), \"GL_EXT_texture_storage\"));\n EXPECT_TRUE(\n gfx::HasExtension(info_->extensions(), \"GL_EXT_texture_format_BGRA8888\"));\n}\n\n// 4- ES2 (neither GL_EXT_texture_storage nor GL_EXT_texture_format_BGRA8888) ->\n// nothing\nTEST_P(FeatureInfoTest, InitializeGLES2_neither_texture_storage_nor_BGRA) {\n SetupInitExpectationsWithGLVersion(\"\", \"\", \"OpenGL ES 2.0\");\n EXPECT_FALSE(\n gfx::HasExtension(info_->extensions(), \"GL_EXT_texture_storage\"));\n EXPECT_FALSE(\n gfx::HasExtension(info_->extensions(), \"GL_EXT_texture_format_BGRA8888\"));\n}\n\n// 5- ES3 + GL_EXT_texture_format_BGRA8888\n// If creating a GLES2 context, expose GL_EXT_texture_format_BGRA8888\n// If creating a GLES3 context, expose GL_EXT_texture_storage\n// (we can't expose both at the same time because we fail the GL_BGRA8\n// requirement)\nTEST_P(FeatureInfoTest, InitializeGLES3_texture_storage_EXT_BGRA) {\n SetupInitExpectationsWithGLVersion(\n \"GL_EXT_texture_format_BGRA8888\", \"\", \"OpenGL ES 3.0\");\n if (GetContextType() == CONTEXT_TYPE_OPENGLES3) {\n EXPECT_TRUE(\n gfx::HasExtension(info_->extensions(), \"GL_EXT_texture_storage\"));\n EXPECT_FALSE(gfx::HasExtension(info_->extensions(),\n \"GL_EXT_texture_format_BGRA8888\"));\n } else {\n EXPECT_FALSE(\n gfx::HasExtension(info_->extensions(), \"GL_EXT_texture_storage\"));\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(),\n \"GL_EXT_texture_format_BGRA8888\"));\n }\n}\n\n// 6- ES3 + GL_APPLE_texture_format_bgra8888 -> GL_EXT_texture_storage +\n// GL_EXT_texture_format_BGRA8888 (driver promises to handle GL_BGRA8 by\n// exposing GL_APPLE_texture_format_bgra8888)\nTEST_P(FeatureInfoTest, InitializeGLES3_texture_storage_APPLE_BGRA) {\n SetupInitExpectationsWithGLVersion(\n \"GL_APPLE_texture_format_BGRA8888\", \"\", \"OpenGL ES 3.0\");\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(), \"GL_EXT_texture_storage\"));\n EXPECT_TRUE(\n gfx::HasExtension(info_->extensions(), \"GL_EXT_texture_format_BGRA8888\"));\n}\n\n// 7- ES3 + GL_EXT_texture_storage + GL_EXT_texture_format_BGRA8888 ->\n// GL_EXT_texture_storage + GL_EXT_texture_format_BGRA8888 (driver promises to\n// handle GL_BGRA8 by exposing GL_EXT_texture_storage)\nTEST_P(FeatureInfoTest, InitializeGLES3_EXT_texture_storage_EXT_BGRA) {\n SetupInitExpectationsWithGLVersion(\n \"GL_EXT_texture_storage GL_EXT_texture_format_BGRA8888\",\n \"\",\n \"OpenGL ES 3.0\");\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(), \"GL_EXT_texture_storage\"));\n EXPECT_TRUE(\n gfx::HasExtension(info_->extensions(), \"GL_EXT_texture_format_BGRA8888\"));\n}\n\n// 8- ES3 + none of the above -> GL_EXT_texture_storage (and no\n// GL_EXT_texture_format_BGRA8888 - we don't claim to handle GL_BGRA8)\nTEST_P(FeatureInfoTest, InitializeGLES3_texture_storage) {\n SetupInitExpectationsWithGLVersion(\"\", \"\", \"OpenGL ES 3.0\");\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(), \"GL_EXT_texture_storage\"));\n EXPECT_FALSE(\n gfx::HasExtension(info_->extensions(), \"GL_EXT_texture_format_BGRA8888\"));\n}\n\n// 9- ANGLE will add the GL_CHROMIUM_renderbuffer_format_BGRA8888 extension and\n// the GL_BGRA8_EXT render buffer format.\nTEST_P(FeatureInfoTest, InitializeWithANGLE_BGRA8) {\n SetupInitExpectationsWithGLVersion(\"\", kGLRendererStringANGLE, \"\");\n EXPECT_TRUE(info_->gl_version_info().is_angle);\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(),\n \"GL_CHROMIUM_renderbuffer_format_BGRA8888\"));\n EXPECT_TRUE(info_->feature_flags().ext_render_buffer_format_bgra8888);\n EXPECT_TRUE(info_->validators()->render_buffer_format.IsValid(GL_BGRA8_EXT));\n}\n\n// 10- vanilla opengl es means no GL_CHROMIUM_renderbuffer_format_BGRA8888\nTEST_P(FeatureInfoTest,\n InitializeGLES2_no_CHROMIUM_renderbuffer_format_BGRA8888) {\n SetupInitExpectationsWithGLVersion(\"\", \"\", \"OpenGL ES 2.0\");\n EXPECT_FALSE(info_->feature_flags().ext_render_buffer_format_bgra8888);\n EXPECT_FALSE(gfx::HasExtension(info_->extensions(),\n \"GL_CHROMIUM_renderbuffer_format_BGRA8888\"));\n}\n\nTEST_P(FeatureInfoTest, InitializeARB_texture_float) {\n DisallowedFeatures disallowed_features;\n disallowed_features.chromium_color_buffer_float_rgb = true;\n disallowed_features.chromium_color_buffer_float_rgba = true;\n SetupInitExpectationsWithGLVersionAndDisallowedFeatures(\n \"GL_ARB_texture_float\", \"\", \"3.0\", disallowed_features);\n EXPECT_FALSE(gfx::HasExtension(info_->extensions(),\n \"GL_CHROMIUM_color_buffer_float_rgb\"));\n EXPECT_FALSE(gfx::HasExtension(info_->extensions(),\n \"GL_CHROMIUM_color_buffer_float_rgba\"));\n EXPECT_FALSE(info_->validators()->texture_internal_format.IsValid(\n GL_RGBA32F));\n EXPECT_FALSE(info_->validators()->texture_internal_format.IsValid(\n GL_RGB32F));\n\n info_->EnableCHROMIUMColorBufferFloatRGBA();\n EXPECT_FALSE(gfx::HasExtension(info_->extensions(),\n \"GL_CHROMIUM_color_buffer_float_rgb\"));\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(),\n \"GL_CHROMIUM_color_buffer_float_rgba\"));\n EXPECT_TRUE(info_->validators()->texture_internal_format.IsValid(\n GL_RGBA32F));\n EXPECT_FALSE(info_->validators()->texture_internal_format.IsValid(\n GL_RGB32F));\n\n info_->EnableCHROMIUMColorBufferFloatRGB();\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(),\n \"GL_CHROMIUM_color_buffer_float_rgb\"));\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(),\n \"GL_CHROMIUM_color_buffer_float_rgba\"));\n EXPECT_TRUE(info_->validators()->texture_internal_format.IsValid(\n GL_RGBA32F));\n EXPECT_TRUE(info_->validators()->texture_internal_format.IsValid(\n GL_RGB32F));\n}\n\nTEST_P(FeatureInfoTest, Initialize_texture_floatGLES3) {\n SetupInitExpectationsWithGLVersion(\"\", \"\", \"OpenGL ES 3.0\");\n EXPECT_FALSE(gfx::HasExtension(info_->extensions(), \"GL_OES_texture_float\"));\n EXPECT_FALSE(\n gfx::HasExtension(info_->extensions(), \"GL_OES_texture_half_float\"));\n EXPECT_FALSE(\n gfx::HasExtension(info_->extensions(), \"GL_OES_texture_float_linear\"));\n EXPECT_FALSE(gfx::HasExtension(info_->extensions(),\n \"GL_OES_texture_half_float_linear\"));\n}\n\nTEST_P(FeatureInfoTest, Initialize_sRGBGLES3) {\n SetupInitExpectationsWithGLVersion(\"\", \"\", \"OpenGL ES 3.0\");\n EXPECT_FALSE(gfx::HasExtension(info_->extensions(), \"GL_EXT_sRGB\"));\n EXPECT_FALSE(info_->validators()->texture_format.IsValid(\n GL_SRGB_EXT));\n EXPECT_FALSE(info_->validators()->texture_format.IsValid(\n GL_SRGB_ALPHA_EXT));\n EXPECT_FALSE(info_->validators()->texture_internal_format.IsValid(\n GL_SRGB_EXT));\n EXPECT_FALSE(info_->validators()->texture_internal_format.IsValid(\n GL_SRGB_ALPHA_EXT));\n EXPECT_FALSE(info_->validators()->render_buffer_format.IsValid(\n GL_SRGB8_ALPHA8_EXT));\n EXPECT_FALSE(info_->validators()->framebuffer_attachment_parameter.IsValid(\n GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT));\n}\n\nTEST_P(FeatureInfoTest, InitializeOES_texture_floatGLES2) {\n SetupInitExpectations(\"GL_OES_texture_float\");\n EXPECT_FALSE(info_->feature_flags().enable_texture_float_linear);\n EXPECT_FALSE(info_->feature_flags().enable_texture_half_float_linear);\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(), \"GL_OES_texture_float\"));\n EXPECT_FALSE(\n gfx::HasExtension(info_->extensions(), \"GL_OES_texture_half_float\"));\n EXPECT_FALSE(\n gfx::HasExtension(info_->extensions(), \"GL_OES_texture_float_linear\"));\n EXPECT_FALSE(gfx::HasExtension(info_->extensions(),\n \"GL_OES_texture_half_float_linear\"));\n EXPECT_TRUE(info_->validators()->pixel_type.IsValid(GL_FLOAT));\n EXPECT_FALSE(info_->validators()->pixel_type.IsValid(GL_HALF_FLOAT_OES));\n}\n\nTEST_P(FeatureInfoTest, InitializeOES_texture_float_linearGLES2) {\n SetupInitExpectations(\"GL_OES_texture_float GL_OES_texture_float_linear\");\n EXPECT_TRUE(info_->feature_flags().enable_texture_float_linear);\n EXPECT_FALSE(info_->feature_flags().enable_texture_half_float_linear);\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(), \"GL_OES_texture_float\"));\n EXPECT_FALSE(\n gfx::HasExtension(info_->extensions(), \"GL_OES_texture_half_float\"));\n EXPECT_TRUE(\n gfx::HasExtension(info_->extensions(), \"GL_OES_texture_float_linear\"));\n EXPECT_FALSE(gfx::HasExtension(info_->extensions(),\n \"GL_OES_texture_half_float_linear\"));\n EXPECT_TRUE(info_->validators()->pixel_type.IsValid(GL_FLOAT));\n EXPECT_FALSE(info_->validators()->pixel_type.IsValid(GL_HALF_FLOAT_OES));\n}\n\nTEST_P(FeatureInfoTest, InitializeOES_texture_half_floatGLES2) {\n SetupInitExpectations(\"GL_OES_texture_half_float\");\n EXPECT_FALSE(info_->feature_flags().enable_texture_float_linear);\n EXPECT_FALSE(info_->feature_flags().enable_texture_half_float_linear);\n EXPECT_FALSE(gfx::HasExtension(info_->extensions(), \"GL_OES_texture_float\"));\n EXPECT_TRUE(\n gfx::HasExtension(info_->extensions(), \"GL_OES_texture_half_float\"));\n EXPECT_FALSE(\n gfx::HasExtension(info_->extensions(), \"GL_OES_texture_float_linear\"));\n EXPECT_FALSE(gfx::HasExtension(info_->extensions(),\n \"GL_OES_texture_half_float_linear\"));\n EXPECT_FALSE(info_->validators()->pixel_type.IsValid(GL_FLOAT));\n EXPECT_TRUE(info_->validators()->pixel_type.IsValid(GL_HALF_FLOAT_OES));\n}\n\nTEST_P(FeatureInfoTest, InitializeOES_texture_half_float_linearGLES2) {\n SetupInitExpectations(\n \"GL_OES_texture_half_float GL_OES_texture_half_float_linear\");\n EXPECT_FALSE(info_->feature_flags().enable_texture_float_linear);\n EXPECT_TRUE(info_->feature_flags().enable_texture_half_float_linear);\n EXPECT_FALSE(gfx::HasExtension(info_->extensions(), \"GL_OES_texture_float\"));\n EXPECT_TRUE(\n gfx::HasExtension(info_->extensions(), \"GL_OES_texture_half_float\"));\n EXPECT_FALSE(\n gfx::HasExtension(info_->extensions(), \"GL_OES_texture_float_linear\"));\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(),\n \"GL_OES_texture_half_float_linear\"));\n EXPECT_FALSE(info_->validators()->pixel_type.IsValid(GL_FLOAT));\n EXPECT_TRUE(info_->validators()->pixel_type.IsValid(GL_HALF_FLOAT_OES));\n}\n\nTEST_P(FeatureInfoTest, InitializeEXT_framebuffer_multisample) {\n SetupInitExpectations(\n \"GL_EXT_framebuffer_blit GL_EXT_framebuffer_multisample\");\n EXPECT_TRUE(info_->feature_flags().chromium_framebuffer_multisample);\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(),\n \"GL_CHROMIUM_framebuffer_multisample\"));\n EXPECT_TRUE(\n info_->validators()->framebuffer_target.IsValid(GL_READ_FRAMEBUFFER_EXT));\n EXPECT_TRUE(\n info_->validators()->framebuffer_target.IsValid(GL_DRAW_FRAMEBUFFER_EXT));\n EXPECT_TRUE(\n info_->validators()->g_l_state.IsValid(GL_READ_FRAMEBUFFER_BINDING_EXT));\n EXPECT_TRUE(info_->validators()->g_l_state.IsValid(GL_MAX_SAMPLES_EXT));\n EXPECT_TRUE(info_->validators()->render_buffer_parameter.IsValid(\n GL_RENDERBUFFER_SAMPLES_EXT));\n}\n\nTEST_P(FeatureInfoTest, InitializeARB_framebuffer_multisample) {\n SetupInitExpectations(\"GL_ARB_framebuffer_object\");\n EXPECT_TRUE(info_->feature_flags().chromium_framebuffer_multisample);\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(),\n \"GL_CHROMIUM_framebuffer_multisample\"));\n EXPECT_TRUE(info_->validators()->framebuffer_target.IsValid(\n GL_READ_FRAMEBUFFER_EXT));\n EXPECT_TRUE(info_->validators()->framebuffer_target.IsValid(\n GL_DRAW_FRAMEBUFFER_EXT));\n EXPECT_TRUE(info_->validators()->g_l_state.IsValid(\n GL_READ_FRAMEBUFFER_BINDING_EXT));\n EXPECT_TRUE(info_->validators()->g_l_state.IsValid(\n GL_MAX_SAMPLES_EXT));\n EXPECT_TRUE(info_->validators()->render_buffer_parameter.IsValid(\n GL_RENDERBUFFER_SAMPLES_EXT));\n}\n\nTEST_P(FeatureInfoTest, InitializeANGLE_framebuffer_multisample) {\n SetupInitExpectationsWithGLVersion(\n \"GL_ANGLE_framebuffer_multisample\", kGLRendererStringANGLE, \"\");\n EXPECT_TRUE(info_->feature_flags().chromium_framebuffer_multisample);\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(),\n \"GL_CHROMIUM_framebuffer_multisample\"));\n EXPECT_TRUE(info_->validators()->framebuffer_target.IsValid(\n GL_READ_FRAMEBUFFER_EXT));\n EXPECT_TRUE(info_->validators()->framebuffer_target.IsValid(\n GL_DRAW_FRAMEBUFFER_EXT));\n EXPECT_TRUE(info_->validators()->g_l_state.IsValid(\n GL_READ_FRAMEBUFFER_BINDING_EXT));\n EXPECT_TRUE(info_->validators()->g_l_state.IsValid(\n GL_MAX_SAMPLES_EXT));\n EXPECT_TRUE(info_->validators()->render_buffer_parameter.IsValid(\n GL_RENDERBUFFER_SAMPLES_EXT));\n}\n\n// We don't allow ANGLE_framebuffer_multisample on non-ANGLE implementations,\n// because we wouldn't be choosing the right driver entry point and because the\n// extension was falsely advertised on some Android devices (crbug.com/165736).\nTEST_P(FeatureInfoTest, InitializeANGLE_framebuffer_multisampleWithoutANGLE) {\n SetupInitExpectations(\"GL_ANGLE_framebuffer_multisample\");\n EXPECT_FALSE(info_->feature_flags().chromium_framebuffer_multisample);\n EXPECT_FALSE(gfx::HasExtension(info_->extensions(),\n \"GL_CHROMIUM_framebuffer_multisample\"));\n EXPECT_FALSE(info_->validators()->framebuffer_target.IsValid(\n GL_READ_FRAMEBUFFER_EXT));\n EXPECT_FALSE(info_->validators()->framebuffer_target.IsValid(\n GL_DRAW_FRAMEBUFFER_EXT));\n EXPECT_FALSE(info_->validators()->g_l_state.IsValid(\n GL_READ_FRAMEBUFFER_BINDING_EXT));\n EXPECT_FALSE(info_->validators()->g_l_state.IsValid(\n GL_MAX_SAMPLES_EXT));\n EXPECT_FALSE(info_->validators()->render_buffer_parameter.IsValid(\n GL_RENDERBUFFER_SAMPLES_EXT));\n}\n\nTEST_P(FeatureInfoTest, InitializeEXT_multisampled_render_to_texture) {\n SetupInitExpectations(\"GL_EXT_multisampled_render_to_texture\");\n EXPECT_TRUE(info_->feature_flags(\n ).multisampled_render_to_texture);\n EXPECT_FALSE(info_->feature_flags(\n ).use_img_for_multisampled_render_to_texture);\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(),\n \"GL_EXT_multisampled_render_to_texture\"));\n EXPECT_TRUE(info_->validators()->g_l_state.IsValid(\n GL_MAX_SAMPLES_EXT));\n EXPECT_TRUE(info_->validators()->render_buffer_parameter.IsValid(\n GL_RENDERBUFFER_SAMPLES_EXT));\n EXPECT_TRUE(info_->validators()->framebuffer_attachment_parameter.IsValid(\n GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_SAMPLES_EXT));\n}\n\nTEST_P(FeatureInfoTest, InitializeIMG_multisampled_render_to_texture) {\n SetupInitExpectations(\"GL_IMG_multisampled_render_to_texture\");\n EXPECT_TRUE(info_->feature_flags(\n ).multisampled_render_to_texture);\n EXPECT_TRUE(info_->feature_flags(\n ).use_img_for_multisampled_render_to_texture);\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(),\n \"GL_EXT_multisampled_render_to_texture\"));\n EXPECT_TRUE(info_->validators()->g_l_state.IsValid(\n GL_MAX_SAMPLES_EXT));\n EXPECT_TRUE(info_->validators()->render_buffer_parameter.IsValid(\n GL_RENDERBUFFER_SAMPLES_EXT));\n EXPECT_TRUE(info_->validators()->framebuffer_attachment_parameter.IsValid(\n GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_SAMPLES_EXT));\n}\n\nTEST_P(FeatureInfoTest, InitializeEXT_texture_filter_anisotropic) {\n SetupInitExpectations(\"GL_EXT_texture_filter_anisotropic\");\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(),\n \"GL_EXT_texture_filter_anisotropic\"));\n EXPECT_TRUE(info_->validators()->texture_parameter.IsValid(\n GL_TEXTURE_MAX_ANISOTROPY_EXT));\n EXPECT_TRUE(info_->validators()->g_l_state.IsValid(\n GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT));\n}\n\nTEST_P(FeatureInfoTest, InitializeEXT_ARB_depth_texture) {\n SetupInitExpectations(\"GL_ARB_depth_texture\");\n EXPECT_TRUE(\n gfx::HasExtension(info_->extensions(), \"GL_GOOGLE_depth_texture\"));\n EXPECT_TRUE(\n gfx::HasExtension(info_->extensions(), \"GL_CHROMIUM_depth_texture\"));\n EXPECT_TRUE(info_->validators()->texture_internal_format.IsValid(\n GL_DEPTH_COMPONENT));\n EXPECT_TRUE(info_->validators()->texture_format.IsValid(GL_DEPTH_COMPONENT));\n EXPECT_FALSE(info_->validators()->texture_format.IsValid(GL_DEPTH_STENCIL));\n EXPECT_TRUE(info_->validators()->pixel_type.IsValid(GL_UNSIGNED_SHORT));\n EXPECT_TRUE(info_->validators()->pixel_type.IsValid(GL_UNSIGNED_INT));\n}\n\nTEST_P(FeatureInfoTest, InitializeOES_ARB_depth_texture) {\n SetupInitExpectations(\"GL_OES_depth_texture\");\n EXPECT_TRUE(\n gfx::HasExtension(info_->extensions(), \"GL_GOOGLE_depth_texture\"));\n EXPECT_TRUE(\n gfx::HasExtension(info_->extensions(), \"GL_CHROMIUM_depth_texture\"));\n EXPECT_TRUE(info_->validators()->texture_internal_format.IsValid(\n GL_DEPTH_COMPONENT));\n EXPECT_TRUE(info_->validators()->texture_format.IsValid(GL_DEPTH_COMPONENT));\n EXPECT_FALSE(info_->validators()->texture_format.IsValid(GL_DEPTH_STENCIL));\n EXPECT_TRUE(info_->validators()->pixel_type.IsValid(GL_UNSIGNED_SHORT));\n EXPECT_TRUE(info_->validators()->pixel_type.IsValid(GL_UNSIGNED_INT));\n}\n\nTEST_P(FeatureInfoTest, InitializeANGLE_depth_texture) {\n SetupInitExpectations(\"GL_ANGLE_depth_texture\");\n EXPECT_TRUE(\n gfx::HasExtension(info_->extensions(), \"GL_GOOGLE_depth_texture\"));\n EXPECT_TRUE(\n gfx::HasExtension(info_->extensions(), \"GL_CHROMIUM_depth_texture\"));\n EXPECT_FALSE(\n gfx::HasExtension(info_->extensions(), \"GL_ANGLE_depth_texture\"));\n EXPECT_TRUE(info_->feature_flags().angle_depth_texture);\n EXPECT_TRUE(info_->validators()->texture_internal_format.IsValid(\n GL_DEPTH_COMPONENT));\n EXPECT_TRUE(info_->validators()->texture_format.IsValid(GL_DEPTH_COMPONENT));\n EXPECT_FALSE(info_->validators()->texture_format.IsValid(GL_DEPTH_STENCIL));\n EXPECT_TRUE(info_->validators()->pixel_type.IsValid(GL_UNSIGNED_SHORT));\n EXPECT_TRUE(info_->validators()->pixel_type.IsValid(GL_UNSIGNED_INT));\n EXPECT_FALSE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_DEPTH_COMPONENT16));\n EXPECT_FALSE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_DEPTH_COMPONENT32_OES));\n EXPECT_FALSE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_DEPTH24_STENCIL8_OES));\n}\n\nTEST_P(FeatureInfoTest, InitializeEXT_packed_depth_stencil) {\n SetupInitExpectations(\"GL_EXT_packed_depth_stencil\");\n EXPECT_TRUE(\n gfx::HasExtension(info_->extensions(), \"GL_OES_packed_depth_stencil\"));\n EXPECT_TRUE(info_->validators()->render_buffer_format.IsValid(\n GL_DEPTH24_STENCIL8));\n EXPECT_FALSE(info_->validators()->texture_internal_format.IsValid(\n GL_DEPTH_COMPONENT));\n EXPECT_FALSE(info_->validators()->texture_format.IsValid(GL_DEPTH_COMPONENT));\n EXPECT_FALSE(info_->validators()->pixel_type.IsValid(GL_UNSIGNED_SHORT));\n EXPECT_FALSE(info_->validators()->pixel_type.IsValid(GL_UNSIGNED_INT));\n}\n\nTEST_P(FeatureInfoTest, InitializeOES_packed_depth_stencil) {\n SetupInitExpectations(\"GL_OES_packed_depth_stencil\");\n EXPECT_TRUE(\n gfx::HasExtension(info_->extensions(), \"GL_OES_packed_depth_stencil\"));\n EXPECT_TRUE(info_->validators()->render_buffer_format.IsValid(\n GL_DEPTH24_STENCIL8));\n EXPECT_FALSE(info_->validators()->texture_internal_format.IsValid(\n GL_DEPTH_COMPONENT));\n EXPECT_FALSE(info_->validators()->texture_format.IsValid(GL_DEPTH_COMPONENT));\n EXPECT_FALSE(info_->validators()->pixel_type.IsValid(GL_UNSIGNED_SHORT));\n EXPECT_FALSE(info_->validators()->pixel_type.IsValid(GL_UNSIGNED_INT));\n}\n\nTEST_P(FeatureInfoTest,\n InitializeOES_packed_depth_stencil_and_GL_ARB_depth_texture) {\n SetupInitExpectations(\"GL_OES_packed_depth_stencil GL_ARB_depth_texture\");\n EXPECT_TRUE(\n gfx::HasExtension(info_->extensions(), \"GL_OES_packed_depth_stencil\"));\n EXPECT_TRUE(info_->validators()->render_buffer_format.IsValid(\n GL_DEPTH24_STENCIL8));\n EXPECT_TRUE(info_->validators()->texture_internal_format.IsValid(\n GL_DEPTH_STENCIL));\n EXPECT_TRUE(info_->validators()->texture_format.IsValid(\n GL_DEPTH_STENCIL));\n EXPECT_TRUE(info_->validators()->pixel_type.IsValid(\n GL_UNSIGNED_INT_24_8));\n}\n\nTEST_P(FeatureInfoTest, InitializeOES_depth24) {\n SetupInitExpectations(\"GL_OES_depth24\");\n EXPECT_TRUE(info_->feature_flags().oes_depth24);\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(), \"GL_OES_depth24\"));\n EXPECT_TRUE(info_->validators()->render_buffer_format.IsValid(\n GL_DEPTH_COMPONENT24));\n}\n\nTEST_P(FeatureInfoTest, InitializeOES_standard_derivatives) {\n SetupInitExpectations(\"GL_OES_standard_derivatives\");\n EXPECT_TRUE(\n gfx::HasExtension(info_->extensions(), \"GL_OES_standard_derivatives\"));\n EXPECT_TRUE(info_->feature_flags().oes_standard_derivatives);\n EXPECT_TRUE(info_->validators()->hint_target.IsValid(\n GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES));\n EXPECT_TRUE(info_->validators()->g_l_state.IsValid(\n GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES));\n}\n\nTEST_P(FeatureInfoTest, InitializeOES_rgb8_rgba8) {\n SetupInitExpectations(\"GL_OES_rgb8_rgba8\");\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(), \"GL_OES_rgb8_rgba8\"));\n EXPECT_TRUE(info_->validators()->render_buffer_format.IsValid(\n GL_RGB8_OES));\n EXPECT_TRUE(info_->validators()->render_buffer_format.IsValid(\n GL_RGBA8_OES));\n}\n\nTEST_P(FeatureInfoTest, InitializeOES_EGL_image_external) {\n SetupInitExpectations(\"GL_OES_EGL_image_external\");\n EXPECT_TRUE(\n gfx::HasExtension(info_->extensions(), \"GL_OES_EGL_image_external\"));\n EXPECT_TRUE(info_->feature_flags().oes_egl_image_external);\n EXPECT_TRUE(info_->validators()->texture_bind_target.IsValid(\n GL_TEXTURE_EXTERNAL_OES));\n EXPECT_TRUE(info_->validators()->get_tex_param_target.IsValid(\n GL_TEXTURE_EXTERNAL_OES));\n EXPECT_TRUE(info_->validators()->texture_parameter.IsValid(\n GL_REQUIRED_TEXTURE_IMAGE_UNITS_OES));\n EXPECT_TRUE(info_->validators()->g_l_state.IsValid(\n GL_TEXTURE_BINDING_EXTERNAL_OES));\n}\n\nTEST_P(FeatureInfoTest, InitializeNV_EGL_stream_consumer_external) {\n SetupInitExpectations(\"GL_NV_EGL_stream_consumer_external\");\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(),\n \"GL_NV_EGL_stream_consumer_external\"));\n EXPECT_TRUE(info_->feature_flags().nv_egl_stream_consumer_external);\n EXPECT_TRUE(info_->validators()->texture_bind_target.IsValid(\n GL_TEXTURE_EXTERNAL_OES));\n EXPECT_TRUE(info_->validators()->get_tex_param_target.IsValid(\n GL_TEXTURE_EXTERNAL_OES));\n EXPECT_TRUE(info_->validators()->texture_parameter.IsValid(\n GL_REQUIRED_TEXTURE_IMAGE_UNITS_OES));\n EXPECT_TRUE(\n info_->validators()->g_l_state.IsValid(GL_TEXTURE_BINDING_EXTERNAL_OES));\n}\n\nTEST_P(FeatureInfoTest, InitializeOES_compressed_ETC1_RGB8_texture) {\n SetupInitExpectations(\"GL_OES_compressed_ETC1_RGB8_texture\");\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(),\n \"GL_OES_compressed_ETC1_RGB8_texture\"));\n EXPECT_TRUE(info_->validators()->compressed_texture_format.IsValid(\n GL_ETC1_RGB8_OES));\n EXPECT_FALSE(info_->validators()->texture_internal_format.IsValid(\n GL_ETC1_RGB8_OES));\n}\n\nTEST_P(FeatureInfoTest, InitializeAMD_compressed_ATC_texture) {\n SetupInitExpectations(\"GL_AMD_compressed_ATC_texture\");\n EXPECT_TRUE(\n gfx::HasExtension(info_->extensions(), \"GL_AMD_compressed_ATC_texture\"));\n EXPECT_TRUE(info_->validators()->compressed_texture_format.IsValid(\n GL_ATC_RGB_AMD));\n EXPECT_TRUE(info_->validators()->compressed_texture_format.IsValid(\n GL_ATC_RGBA_EXPLICIT_ALPHA_AMD));\n EXPECT_TRUE(info_->validators()->compressed_texture_format.IsValid(\n GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD));\n}\n\nTEST_P(FeatureInfoTest, InitializeIMG_texture_compression_pvrtc) {\n SetupInitExpectations(\"GL_IMG_texture_compression_pvrtc\");\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(),\n \"GL_IMG_texture_compression_pvrtc\"));\n EXPECT_TRUE(info_->validators()->compressed_texture_format.IsValid(\n GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG));\n EXPECT_TRUE(info_->validators()->compressed_texture_format.IsValid(\n GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG));\n EXPECT_TRUE(info_->validators()->compressed_texture_format.IsValid(\n GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG));\n EXPECT_TRUE(info_->validators()->compressed_texture_format.IsValid(\n GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG));\n}\n\nTEST_P(FeatureInfoTest, InitializeEXT_occlusion_query_boolean) {\n SetupInitExpectations(\"GL_EXT_occlusion_query_boolean\");\n if (GetContextType() == CONTEXT_TYPE_OPENGLES2) {\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(),\n \"GL_EXT_occlusion_query_boolean\"));\n }\n EXPECT_TRUE(info_->feature_flags().occlusion_query_boolean);\n EXPECT_FALSE(info_->feature_flags(\n ).use_arb_occlusion_query2_for_occlusion_query_boolean);\n EXPECT_FALSE(info_->feature_flags(\n ).use_arb_occlusion_query_for_occlusion_query_boolean);\n}\n\nTEST_P(FeatureInfoTest, InitializeARB_occlusion_query) {\n SetupInitExpectations(\"GL_ARB_occlusion_query\");\n if (GetContextType() == CONTEXT_TYPE_OPENGLES2) {\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(),\n \"GL_EXT_occlusion_query_boolean\"));\n }\n EXPECT_TRUE(info_->feature_flags().occlusion_query_boolean);\n EXPECT_FALSE(info_->feature_flags(\n ).use_arb_occlusion_query2_for_occlusion_query_boolean);\n EXPECT_TRUE(info_->feature_flags(\n ).use_arb_occlusion_query_for_occlusion_query_boolean);\n}\n\nTEST_P(FeatureInfoTest, InitializeARB_occlusion_query2) {\n SetupInitExpectations(\"GL_ARB_occlusion_query2 GL_ARB_occlusion_query2\");\n if (GetContextType() == CONTEXT_TYPE_OPENGLES2) {\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(),\n \"GL_EXT_occlusion_query_boolean\"));\n }\n EXPECT_TRUE(info_->feature_flags().occlusion_query_boolean);\n EXPECT_TRUE(info_->feature_flags(\n ).use_arb_occlusion_query2_for_occlusion_query_boolean);\n EXPECT_FALSE(info_->feature_flags(\n ).use_arb_occlusion_query_for_occlusion_query_boolean);\n}\n\nTEST_P(FeatureInfoTest, InitializeGLES3_occlusion_query_boolean) {\n SetupInitExpectationsWithGLVersion(\"\", \"\", \"OpenGL ES 3.0\");\n if (GetContextType() == CONTEXT_TYPE_OPENGLES2) {\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(),\n \"GL_EXT_occlusion_query_boolean\"));\n }\n EXPECT_TRUE(info_->feature_flags().occlusion_query_boolean);\n}\n\nTEST_P(FeatureInfoTest, InitializeGL33_occlusion_query2) {\n SetupInitExpectationsWithGLVersion(\"\", \"\", \"3.3\");\n if (GetContextType() == CONTEXT_TYPE_OPENGLES2) {\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(),\n \"GL_EXT_occlusion_query_boolean\"));\n }\n EXPECT_TRUE(info_->feature_flags().occlusion_query_boolean);\n EXPECT_TRUE(info_->feature_flags(\n ).use_arb_occlusion_query2_for_occlusion_query_boolean);\n}\n\nTEST_P(FeatureInfoTest, InitializeGL43_occlusion_query2) {\n SetupInitExpectationsWithGLVersion(\"\", \"\", \"4.3\");\n if (GetContextType() == CONTEXT_TYPE_OPENGLES2) {\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(),\n \"GL_EXT_occlusion_query_boolean\"));\n }\n EXPECT_TRUE(info_->feature_flags().occlusion_query_boolean);\n EXPECT_FALSE(info_->feature_flags(\n ).use_arb_occlusion_query2_for_occlusion_query_boolean);\n}\n\nTEST_P(FeatureInfoTest, InitializeOES_vertex_array_object) {\n SetupInitExpectations(\"GL_OES_vertex_array_object\");\n EXPECT_TRUE(\n gfx::HasExtension(info_->extensions(), \"GL_OES_vertex_array_object\"));\n EXPECT_TRUE(info_->feature_flags().native_vertex_array_object);\n}\n\nTEST_P(FeatureInfoTest, InitializeARB_vertex_array_object) {\n SetupInitExpectations(\"GL_ARB_vertex_array_object\");\n EXPECT_TRUE(\n gfx::HasExtension(info_->extensions(), \"GL_OES_vertex_array_object\"));\n EXPECT_TRUE(info_->feature_flags().native_vertex_array_object);\n}\n\nTEST_P(FeatureInfoTest, InitializeAPPLE_vertex_array_object) {\n SetupInitExpectations(\"GL_APPLE_vertex_array_object\");\n EXPECT_TRUE(\n gfx::HasExtension(info_->extensions(), \"GL_OES_vertex_array_object\"));\n EXPECT_TRUE(info_->feature_flags().native_vertex_array_object);\n}\n\nTEST_P(FeatureInfoTest, InitializeNo_vertex_array_object) {\n SetupInitExpectations(\"\");\n // Even if the native extensions are not available the implementation\n // may still emulate the GL_OES_vertex_array_object functionality. In this\n // scenario native_vertex_array_object must be false.\n EXPECT_TRUE(\n gfx::HasExtension(info_->extensions(), \"GL_OES_vertex_array_object\"));\n EXPECT_FALSE(info_->feature_flags().native_vertex_array_object);\n}\n\nTEST_P(FeatureInfoTest, InitializeOES_element_index_uint) {\n SetupInitExpectations(\"GL_OES_element_index_uint\");\n EXPECT_TRUE(\n gfx::HasExtension(info_->extensions(), \"GL_OES_element_index_uint\"));\n EXPECT_TRUE(info_->validators()->index_type.IsValid(GL_UNSIGNED_INT));\n}\n\nTEST_P(FeatureInfoTest, InitializeEXT_blend_minmax) {\n SetupInitExpectations(\"GL_EXT_blend_minmax\");\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(), \"GL_EXT_blend_minmax\"));\n EXPECT_TRUE(info_->validators()->equation.IsValid(GL_MIN_EXT));\n EXPECT_TRUE(info_->validators()->equation.IsValid(GL_MAX_EXT));\n}\n\nTEST_P(FeatureInfoTest, InitializeEXT_frag_depth) {\n SetupInitExpectations(\"GL_EXT_frag_depth\");\n EXPECT_TRUE(info_->feature_flags().ext_frag_depth);\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(), \"GL_EXT_frag_depth\"));\n}\n\nTEST_P(FeatureInfoTest, InitializeEXT_shader_texture_lod) {\n SetupInitExpectations(\"GL_EXT_shader_texture_lod\");\n EXPECT_TRUE(info_->feature_flags().ext_shader_texture_lod);\n EXPECT_TRUE(\n gfx::HasExtension(info_->extensions(), \"GL_EXT_shader_texture_lod\"));\n}\n\nTEST_P(FeatureInfoTest, InitializeEXT_discard_framebuffer) {\n SetupInitExpectations(\"GL_EXT_discard_framebuffer\");\n EXPECT_TRUE(info_->feature_flags().ext_discard_framebuffer);\n EXPECT_TRUE(\n gfx::HasExtension(info_->extensions(), \"GL_EXT_discard_framebuffer\"));\n}\n\nTEST_P(FeatureInfoTest, InitializeSamplersWithARBSamplerObjects) {\n SetupInitExpectationsWithGLVersion(\n \"GL_ARB_sampler_objects\", \"\", \"3.0\");\n EXPECT_TRUE(info_->feature_flags().enable_samplers);\n}\n\nTEST_P(FeatureInfoTest, InitializeWithES3) {\n SetupInitExpectationsWithGLVersion(\"\", \"\", \"OpenGL ES 3.0\");\n EXPECT_TRUE(info_->feature_flags().chromium_framebuffer_multisample);\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(),\n \"GL_CHROMIUM_framebuffer_multisample\"));\n EXPECT_TRUE(info_->feature_flags().use_async_readpixels);\n EXPECT_TRUE(info_->feature_flags().oes_standard_derivatives);\n EXPECT_TRUE(info_->feature_flags().oes_depth24);\n EXPECT_FALSE(\n gfx::HasExtension(info_->extensions(), \"GL_GOOGLE_depth_texture\"));\n EXPECT_FALSE(\n gfx::HasExtension(info_->extensions(), \"GL_CHROMIUM_depth_texture\"));\n EXPECT_FALSE(\n info_->validators()->texture_internal_format.IsValid(GL_DEPTH_COMPONENT));\n EXPECT_FALSE(\n info_->validators()->texture_internal_format.IsValid(GL_DEPTH_STENCIL));\n EXPECT_FALSE(info_->validators()->texture_format.IsValid(GL_DEPTH_COMPONENT));\n EXPECT_FALSE(info_->validators()->texture_format.IsValid(GL_DEPTH_STENCIL));\n EXPECT_FALSE(info_->validators()->pixel_type.IsValid(GL_UNSIGNED_SHORT));\n EXPECT_FALSE(info_->validators()->pixel_type.IsValid(GL_UNSIGNED_INT));\n EXPECT_FALSE(info_->validators()->pixel_type.IsValid(GL_UNSIGNED_INT_24_8));\n EXPECT_TRUE(info_->feature_flags().packed_depth24_stencil8);\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(), \"GL_OES_depth24\"));\n EXPECT_TRUE(\n info_->validators()->render_buffer_format.IsValid(GL_DEPTH_COMPONENT24));\n EXPECT_TRUE(\n info_->validators()->render_buffer_format.IsValid(GL_DEPTH24_STENCIL8));\n EXPECT_FALSE(\n info_->validators()->texture_internal_format.IsValid(GL_DEPTH_STENCIL));\n EXPECT_FALSE(info_->validators()->texture_format.IsValid(GL_DEPTH_STENCIL));\n EXPECT_TRUE(info_->feature_flags().npot_ok);\n EXPECT_TRUE(info_->feature_flags().native_vertex_array_object);\n EXPECT_TRUE(info_->feature_flags().enable_samplers);\n EXPECT_TRUE(info_->feature_flags().map_buffer_range);\n EXPECT_TRUE(info_->feature_flags().ext_discard_framebuffer);\n EXPECT_TRUE(\n gfx::HasExtension(info_->extensions(), \"GL_EXT_discard_framebuffer\"));\n EXPECT_TRUE(info_->feature_flags().chromium_sync_query);\n EXPECT_TRUE(gl::GLFence::IsSupported());\n}\n\nTEST_P(FeatureInfoTest, InitializeWithES3AndDepthTexture) {\n SetupInitExpectationsWithGLVersion(\n \"GL_ANGLE_depth_texture\", \"\", \"OpenGL ES 3.0\");\n EXPECT_TRUE(\n gfx::HasExtension(info_->extensions(), \"GL_GOOGLE_depth_texture\"));\n EXPECT_TRUE(\n gfx::HasExtension(info_->extensions(), \"GL_CHROMIUM_depth_texture\"));\n EXPECT_TRUE(\n info_->validators()->texture_internal_format.IsValid(GL_DEPTH_COMPONENT));\n EXPECT_TRUE(\n info_->validators()->texture_internal_format.IsValid(GL_DEPTH_STENCIL));\n EXPECT_TRUE(info_->validators()->texture_format.IsValid(GL_DEPTH_COMPONENT));\n EXPECT_TRUE(info_->validators()->texture_format.IsValid(GL_DEPTH_STENCIL));\n EXPECT_TRUE(info_->validators()->pixel_type.IsValid(GL_UNSIGNED_SHORT));\n EXPECT_TRUE(info_->validators()->pixel_type.IsValid(GL_UNSIGNED_INT));\n EXPECT_TRUE(info_->validators()->pixel_type.IsValid(GL_UNSIGNED_INT_24_8));\n EXPECT_TRUE(info_->feature_flags().packed_depth24_stencil8);\n EXPECT_TRUE(\n info_->validators()->texture_internal_format.IsValid(GL_DEPTH_STENCIL));\n EXPECT_TRUE(info_->validators()->texture_format.IsValid(GL_DEPTH_STENCIL));\n}\n\nTEST_P(FeatureInfoTest, InitializeWithoutSamplers) {\n SetupInitExpectationsWithGLVersion(\"\", \"\", \"3.0\");\n EXPECT_FALSE(info_->feature_flags().enable_samplers);\n}\n\nTEST_P(FeatureInfoTest, ParseDriverBugWorkaroundsSingle) {\n gpu::GpuDriverBugWorkarounds workarounds;\n workarounds.exit_on_context_lost = true;\n // Workarounds should get parsed without the need for a context.\n SetupWithWorkarounds(workarounds);\n EXPECT_TRUE(info_->workarounds().exit_on_context_lost);\n}\n\nTEST_P(FeatureInfoTest, ParseDriverBugWorkaroundsMultiple) {\n gpu::GpuDriverBugWorkarounds workarounds;\n workarounds.exit_on_context_lost = true;\n workarounds.webgl_or_caps_max_texture_size = 4096;\n // Workarounds should get parsed without the need for a context.\n SetupWithWorkarounds(workarounds);\n EXPECT_TRUE(info_->workarounds().exit_on_context_lost);\n EXPECT_EQ(4096, info_->workarounds().webgl_or_caps_max_texture_size);\n}\n\nTEST_P(FeatureInfoTest, InitializeWithARBSync) {\n SetupInitExpectations(\"GL_ARB_sync\");\n EXPECT_TRUE(info_->feature_flags().chromium_sync_query);\n EXPECT_TRUE(gl::GLFence::IsSupported());\n}\n\nTEST_P(FeatureInfoTest, InitializeWithNVFence) {\n SetupInitExpectations(\"GL_NV_fence\");\n EXPECT_TRUE(info_->feature_flags().chromium_sync_query);\n EXPECT_TRUE(gl::GLFence::IsSupported());\n}\n\nTEST_P(FeatureInfoTest, InitializeWithNVDrawBuffers) {\n SetupInitExpectationsWithGLVersion(\"GL_NV_draw_buffers\", \"\", \"OpenGL ES 3.0\");\n bool is_es2 = GetContextType() == CONTEXT_TYPE_OPENGLES2;\n EXPECT_EQ(is_es2, info_->feature_flags().nv_draw_buffers);\n EXPECT_EQ(is_es2, info_->feature_flags().ext_draw_buffers);\n}\n\nTEST_P(FeatureInfoTest, InitializeWithPreferredEXTDrawBuffers) {\n SetupInitExpectationsWithGLVersion(\n \"GL_NV_draw_buffers GL_EXT_draw_buffers\", \"\", \"OpenGL ES 3.0\");\n bool is_es2 = GetContextType() == CONTEXT_TYPE_OPENGLES2;\n EXPECT_FALSE(info_->feature_flags().nv_draw_buffers);\n EXPECT_EQ(is_es2, info_->feature_flags().ext_draw_buffers);\n}\n\nTEST_P(FeatureInfoTest, BlendEquationAdvancedDisabled) {\n gpu::GpuDriverBugWorkarounds workarounds;\n workarounds.disable_blend_equation_advanced = true;\n SetupInitExpectationsWithWorkarounds(\n \"GL_KHR_blend_equation_advanced_coherent GL_KHR_blend_equation_advanced\",\n workarounds);\n EXPECT_FALSE(info_->feature_flags().blend_equation_advanced);\n EXPECT_FALSE(info_->feature_flags().blend_equation_advanced_coherent);\n}\n\nTEST_P(FeatureInfoTest, InitializeNoKHR_blend_equation_advanced) {\n SetupInitExpectationsWithGLVersion(\"GL_ARB_compatibility\", \"\", \"4.3\");\n EXPECT_FALSE(info_->feature_flags().blend_equation_advanced);\n EXPECT_FALSE(\n gfx::HasExtension(info_->extensions(), \"GL_KHR_blend_equation_advanced\"));\n}\n\nTEST_P(FeatureInfoTest, InitializeKHR_blend_equations_advanced) {\n SetupInitExpectations(\"GL_KHR_blend_equation_advanced\");\n EXPECT_TRUE(\n gfx::HasExtension(info_->extensions(), \"GL_KHR_blend_equation_advanced\"));\n EXPECT_TRUE(info_->feature_flags().blend_equation_advanced);\n}\n\nTEST_P(FeatureInfoTest, InitializeNV_blend_equations_advanced) {\n SetupInitExpectations(\"GL_NV_blend_equation_advanced\");\n EXPECT_TRUE(\n gfx::HasExtension(info_->extensions(), \"GL_KHR_blend_equation_advanced\"));\n EXPECT_TRUE(info_->feature_flags().blend_equation_advanced);\n}\n\nTEST_P(FeatureInfoTest, InitializeNoKHR_blend_equation_advanced_coherent) {\n SetupInitExpectationsWithGLVersion(\"GL_ARB_compatibility \", \"\", \"4.3\");\n EXPECT_FALSE(info_->feature_flags().blend_equation_advanced_coherent);\n EXPECT_FALSE(gfx::HasExtension(info_->extensions(),\n \"GL_KHR_blend_equation_advanced_coherent\"));\n}\n\nTEST_P(FeatureInfoTest, InitializeKHR_blend_equations_advanced_coherent) {\n SetupInitExpectations(\"GL_KHR_blend_equation_advanced_coherent\");\n EXPECT_TRUE(gfx::HasExtension(info_->extensions(),\n \"GL_KHR_blend_equation_advanced_coherent\"));\n EXPECT_TRUE(info_->feature_flags().blend_equation_advanced);\n EXPECT_TRUE(info_->feature_flags().blend_equation_advanced_coherent);\n}\n\nTEST_P(FeatureInfoTest, InitializeEXT_texture_rgWithFloat) {\n SetupInitExpectations(\n \"GL_EXT_texture_rg GL_OES_texture_float GL_OES_texture_half_float\");\n EXPECT_TRUE(info_->feature_flags().ext_texture_rg);\n\n EXPECT_TRUE(info_->validators()->texture_format.IsValid(GL_RED_EXT));\n EXPECT_TRUE(info_->validators()->texture_format.IsValid(GL_RG_EXT));\n EXPECT_TRUE(info_->validators()->texture_internal_format.IsValid(GL_RED_EXT));\n EXPECT_TRUE(info_->validators()->texture_internal_format.IsValid(GL_RG_EXT));\n EXPECT_TRUE(info_->validators()->read_pixel_format.IsValid(GL_RED_EXT));\n EXPECT_TRUE(info_->validators()->read_pixel_format.IsValid(GL_RG_EXT));\n EXPECT_TRUE(info_->validators()->render_buffer_format.IsValid(GL_R8_EXT));\n EXPECT_TRUE(info_->validators()->render_buffer_format.IsValid(GL_RG8_EXT));\n}\n\nTEST_P(FeatureInfoTest, InitializeARB_texture_rgNoFloat) {\n SetupInitExpectations(\"GL_ARB_texture_rg\");\n EXPECT_TRUE(info_->feature_flags().ext_texture_rg);\n\n EXPECT_TRUE(info_->validators()->texture_format.IsValid(GL_RED_EXT));\n EXPECT_TRUE(info_->validators()->texture_format.IsValid(GL_RG_EXT));\n EXPECT_TRUE(info_->validators()->texture_internal_format.IsValid(GL_RED_EXT));\n EXPECT_TRUE(info_->validators()->texture_internal_format.IsValid(GL_RG_EXT));\n EXPECT_TRUE(info_->validators()->read_pixel_format.IsValid(GL_RED_EXT));\n EXPECT_TRUE(info_->validators()->read_pixel_format.IsValid(GL_RG_EXT));\n EXPECT_TRUE(info_->validators()->render_buffer_format.IsValid(GL_R8_EXT));\n EXPECT_TRUE(info_->validators()->render_buffer_format.IsValid(GL_RG8_EXT));\n}\n\nTEST_P(FeatureInfoTest, InitializeEXT_texture_norm16) {\n SetupInitExpectations(\"GL_EXT_texture_norm16\");\n\n if (!info_->IsWebGL2OrES3OrHigherContext()) {\n return;\n }\n\n EXPECT_TRUE(info_->feature_flags().ext_texture_norm16);\n\n EXPECT_TRUE(info_->validators()->texture_format.IsValid(GL_RED_EXT));\n EXPECT_TRUE(info_->validators()->texture_format.IsValid(GL_RG_EXT));\n EXPECT_TRUE(info_->validators()->texture_format.IsValid(GL_RGB));\n EXPECT_TRUE(info_->validators()->texture_format.IsValid(GL_RGBA));\n EXPECT_TRUE(info_->validators()->texture_internal_format.IsValid(GL_R16_EXT));\n EXPECT_TRUE(\n info_->validators()->texture_internal_format.IsValid(GL_RG16_EXT));\n EXPECT_TRUE(\n info_->validators()->texture_internal_format.IsValid(GL_RGB16_EXT));\n EXPECT_TRUE(\n info_->validators()->texture_internal_format.IsValid(GL_RGBA16_EXT));\n EXPECT_TRUE(info_->validators()->read_pixel_format.IsValid(GL_R16_EXT));\n EXPECT_TRUE(info_->validators()->read_pixel_format.IsValid(GL_RG16_EXT));\n EXPECT_TRUE(info_->validators()->read_pixel_format.IsValid(GL_RGBA16_EXT));\n EXPECT_TRUE(info_->validators()->render_buffer_format.IsValid(GL_R16_EXT));\n EXPECT_TRUE(info_->validators()->render_buffer_format.IsValid(GL_RG16_EXT));\n EXPECT_TRUE(info_->validators()->render_buffer_format.IsValid(GL_RGBA16_EXT));\n EXPECT_TRUE(\n info_->validators()->texture_internal_format_storage.IsValid(GL_R16_EXT));\n EXPECT_TRUE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_RG16_EXT));\n EXPECT_TRUE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_RGB16_EXT));\n EXPECT_TRUE(info_->validators()->texture_internal_format_storage.IsValid(\n GL_RGBA16_EXT));\n}\n\nTEST_P(FeatureInfoTest, InitializeMESAFramebufferFlipYExtensionTrue) {\n SetupInitExpectations(\"GL_MESA_framebuffer_flip_y\");\n EXPECT_TRUE(info_->feature_flags().mesa_framebuffer_flip_y);\n}\n\n} // namespace gles2\n} // namespace gpu\n"
}
}