Skip to content

Commit

Permalink
Added Chrome-side support for EXT_blend_minmax WebGL extension
Browse files Browse the repository at this point in the history
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
  • Loading branch information
bajones@chromium.org committed May 13, 2014
1 parent e2ce39b commit a08a328
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
7 changes: 7 additions & 0 deletions gpu/command_buffer/service/feature_info.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
9 changes: 9 additions & 0 deletions gpu/command_buffer/service/feature_info_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit a08a328

Please sign in to comment.