From a08a328e4b03625eafa1fc67a92a9ff9a3f24f3a Mon Sep 17 00:00:00 2001 From: "bajones@chromium.org" Date: Tue, 13 May 2014 04:16:36 +0000 Subject: Added Chrome-side support for EXT_blend_minmax WebGL extension BUG=344451 Review URL: https://codereview.chromium.org/286553002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@270012 0039d316-1c4b-4281-b951-d872f2087c98 --- gpu/command_buffer/service/feature_info.cc | 7 +++++++ gpu/command_buffer/service/feature_info_unittest.cc | 9 +++++++++ 2 files changed, 16 insertions(+) diff --git a/gpu/command_buffer/service/feature_info.cc b/gpu/command_buffer/service/feature_info.cc index 81df6b6..9fa91b7 100644 --- a/gpu/command_buffer/service/feature_info.cc +++ b/gpu/command_buffer/service/feature_info.cc @@ -777,6 +777,13 @@ void FeatureInfo::InitializeFeatures() { } } + if (extensions.Contains("GL_EXT_blend_minmax") || + gfx::HasDesktopGLFeatures()) { + AddExtensionString("GL_EXT_blend_minmax"); + validators_.equation.AddValue(GL_MIN_EXT); + validators_.equation.AddValue(GL_MAX_EXT); + } + if (extensions.Contains("GL_EXT_frag_depth") || gfx::HasDesktopGLFeatures()) { AddExtensionString("GL_EXT_frag_depth"); feature_flags_.ext_frag_depth = true; diff --git a/gpu/command_buffer/service/feature_info_unittest.cc b/gpu/command_buffer/service/feature_info_unittest.cc index 973f2a0..81ecfe2 100644 --- a/gpu/command_buffer/service/feature_info_unittest.cc +++ b/gpu/command_buffer/service/feature_info_unittest.cc @@ -316,6 +316,8 @@ TEST_F(FeatureInfoTest, InitializeNoExtensions) { GL_DEPTH_COMPONENT32_OES)); EXPECT_FALSE(info_->validators()->texture_internal_format_storage.IsValid( GL_DEPTH24_STENCIL8_OES)); + EXPECT_FALSE(info_->validators()->equation.IsValid(GL_MIN_EXT)); + EXPECT_FALSE(info_->validators()->equation.IsValid(GL_MAX_EXT)); } TEST_F(FeatureInfoTest, InitializeWithANGLE) { @@ -952,6 +954,13 @@ TEST_F(FeatureInfoTest, InitializeVAOsWithClientSideArrays) { EXPECT_FALSE(info_->feature_flags().native_vertex_array_object); } +TEST_F(FeatureInfoTest, InitializeEXT_blend_minmax) { + SetupInitExpectations("GL_EXT_blend_minmax"); + EXPECT_THAT(info_->extensions(), HasSubstr("GL_EXT_blend_minmax")); + EXPECT_TRUE(info_->validators()->equation.IsValid(GL_MIN_EXT)); + EXPECT_TRUE(info_->validators()->equation.IsValid(GL_MAX_EXT)); +} + TEST_F(FeatureInfoTest, InitializeEXT_frag_depth) { SetupInitExpectations("GL_EXT_frag_depth"); EXPECT_TRUE(info_->feature_flags().ext_frag_depth); -- cgit v1.1