diff options
author | bsalomon@google.com <bsalomon@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-18 11:20:04 +0000 |
---|---|---|
committer | bsalomon@google.com <bsalomon@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-18 11:20:04 +0000 |
commit | c01ab130e0a681458e0fee41d6261c7ea37e1743 (patch) | |
tree | 823ee340378891a9902a252a3267931b753dacff /gpu | |
parent | 8be161672d8d89525050cb678ecc4ea554f18c00 (diff) | |
download | chromium_src-c01ab130e0a681458e0fee41d6261c7ea37e1743.zip chromium_src-c01ab130e0a681458e0fee41d6261c7ea37e1743.tar.gz chromium_src-c01ab130e0a681458e0fee41d6261c7ea37e1743.tar.bz2 |
Add renderbuffer BGRA8 format extension and support in cmd buffer for desktop GL. This enables development of a canvas2d msaa flag on desktop systems that use BGRA for canvas2d.
BUG=308277
Review URL: https://codereview.chromium.org/27542003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@229359 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu')
3 files changed, 76 insertions, 2 deletions
diff --git a/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_renderbuffer_format_BGRA8888.txt b/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_renderbuffer_format_BGRA8888.txt new file mode 100644 index 0000000..75a1471 --- /dev/null +++ b/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_renderbuffer_format_BGRA8888.txt @@ -0,0 +1,58 @@ +Name + + CHROMIUM_renderbuffer_format_BGRA8888 + +Name Strings + + GL_CHROMIUM_renderbuffer_format_BGRA8888 + +Version + + Last Modifed Date: Oct 16, 2013 + +Dependencies + + OpenGL ES 2.0 is required. + GL_EXT_texture_format_BGRA8888 is required. + +Overview + + EXT_texture_format_BGRA8888 adds a BGRA8_EXT as a legal internal texture + format. This extension also allows BGRA8_EXT as a renderbuffer internal + format. It is particularly useful when ANGLE_framebuffer_multisample or + a similar extension is also present as it allows creating a multisampled + BGRA8 renderbuffer that can be downsampled into a BGRA8 texture. + +New Tokens + + None + +Additions to the OpenGL ES 2.0 Specification + + Modifications to Table 4.5 (Renderbuffer image formats) + + Add the following entry: + Sized Internal Format Renderable Type R bits G bits B bits A bits D bits S bits + ===================== =============== ====== ====== ====== ====== ====== ====== + BGRA8_EXT color-renderable 8 8 8 8 + +Interactions with GL_ANGLE_framebuffer_multisample + + If ANGLE_framebuffer_multisample is also present then BGRA8_EXT is a + legal parameter to RenderbufferStrorageMultisampleANGLE. + +New Procedures and Functions + + None + +Errors + + None + +New State + + None + +Revision History + + 10/16/2013 Initial version diff --git a/gpu/command_buffer/service/feature_info.cc b/gpu/command_buffer/service/feature_info.cc index cddf0a5..6e6b363 100644 --- a/gpu/command_buffer/service/feature_info.cc +++ b/gpu/command_buffer/service/feature_info.cc @@ -360,6 +360,8 @@ void FeatureInfo::InitializeFeatures() { bool enable_texture_format_bgra8888 = false; bool enable_read_format_bgra = false; + bool enable_render_buffer_bgra = false; + // Check if we should allow GL_EXT_texture_format_BGRA8888 if (extensions.Contains("GL_EXT_texture_format_BGRA8888") || extensions.Contains("GL_APPLE_texture_format_BGRA8888") || @@ -368,8 +370,7 @@ void FeatureInfo::InitializeFeatures() { } if (extensions.Contains("GL_EXT_bgra")) { - enable_texture_format_bgra8888 = true; - enable_read_format_bgra = true; + enable_render_buffer_bgra = true; } if (extensions.Contains("GL_EXT_read_format_bgra") || @@ -389,6 +390,11 @@ void FeatureInfo::InitializeFeatures() { validators_.read_pixel_format.AddValue(GL_BGRA_EXT); } + if (enable_render_buffer_bgra) { + AddExtensionString("GL_CHROMIUM_renderbuffer_format_BGRA8888"); + validators_.render_buffer_format.AddValue(GL_BGRA8_EXT); + } + if (extensions.Contains("GL_OES_rgb8_rgba8") || gfx::HasDesktopGLFeatures()) { AddExtensionString("GL_OES_rgb8_rgba8"); validators_.render_buffer_format.AddValue(GL_RGB8_OES); diff --git a/gpu/command_buffer/service/feature_info_unittest.cc b/gpu/command_buffer/service/feature_info_unittest.cc index 97cc76b..c5e8301 100644 --- a/gpu/command_buffer/service/feature_info_unittest.cc +++ b/gpu/command_buffer/service/feature_info_unittest.cc @@ -341,6 +341,8 @@ TEST_F(FeatureInfoTest, InitializeEXT_texture_format_BGRA8888GLES2) { GL_BGRA_EXT)); EXPECT_TRUE(info_->GetTextureFormatValidator(GL_BGRA_EXT).IsValid( GL_UNSIGNED_BYTE)); + EXPECT_FALSE(info_->validators()->render_buffer_format.IsValid( + GL_BGRA8_EXT)); } TEST_F(FeatureInfoTest, InitializeEXT_texture_format_BGRA8888GL) { @@ -349,6 +351,8 @@ TEST_F(FeatureInfoTest, InitializeEXT_texture_format_BGRA8888GL) { HasSubstr("GL_EXT_texture_format_BGRA8888")); EXPECT_THAT(info_->extensions(), HasSubstr("GL_EXT_read_format_bgra")); + EXPECT_THAT(info_->extensions(), + HasSubstr("GL_CHROMIUM_renderbuffer_format_BGRA8888")); EXPECT_TRUE(info_->validators()->texture_format.IsValid( GL_BGRA_EXT)); EXPECT_TRUE(info_->validators()->texture_internal_format.IsValid( @@ -357,6 +361,8 @@ TEST_F(FeatureInfoTest, InitializeEXT_texture_format_BGRA8888GL) { GL_BGRA_EXT)); EXPECT_TRUE(info_->GetTextureFormatValidator(GL_BGRA_EXT).IsValid( GL_UNSIGNED_BYTE)); + EXPECT_TRUE(info_->validators()->render_buffer_format.IsValid( + GL_BGRA8_EXT)); } TEST_F(FeatureInfoTest, InitializeEXT_texture_format_BGRA8888Apple) { @@ -369,6 +375,8 @@ TEST_F(FeatureInfoTest, InitializeEXT_texture_format_BGRA8888Apple) { GL_BGRA_EXT)); EXPECT_TRUE(info_->GetTextureFormatValidator(GL_BGRA_EXT).IsValid( GL_UNSIGNED_BYTE)); + EXPECT_FALSE(info_->validators()->render_buffer_format.IsValid( + GL_BGRA8_EXT)); } TEST_F(FeatureInfoTest, InitializeEXT_read_format_bgra) { @@ -381,6 +389,8 @@ TEST_F(FeatureInfoTest, InitializeEXT_read_format_bgra) { GL_BGRA_EXT)); EXPECT_TRUE(info_->validators()->read_pixel_format.IsValid( GL_BGRA_EXT)); + EXPECT_FALSE(info_->validators()->render_buffer_format.IsValid( + GL_BGRA8_EXT)); } TEST_F(FeatureInfoTest, InitializeOES_texture_floatGLES2) { |