diff options
author | hendrikw <hendrikw@chromium.org> | 2015-02-24 18:56:09 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-02-25 02:57:15 +0000 |
commit | 02a2e2d381ed5089d7ab613aec9960616739dfe8 (patch) | |
tree | bf83e66b3c06559a015306a5523b8ff328e036d6 /gpu | |
parent | 98ac98f2e5ab1766c9850b5d9a424f47bdf10205 (diff) | |
download | chromium_src-02a2e2d381ed5089d7ab613aec9960616739dfe8.zip chromium_src-02a2e2d381ed5089d7ab613aec9960616739dfe8.tar.gz chromium_src-02a2e2d381ed5089d7ab613aec9960616739dfe8.tar.bz2 |
Fix MSAA on windows
MSAA would brake on windows because skia creates a BGRA8 internal format render
buffer, which we didn't support on windows.
We were turning on BGRA8_EXT for render buffers when we had
https://www.opengl.org/registry/specs/EXT/bgra.txt, this is a desktop spec that doesn't mention BGRA8_EXT
for render buffers, but we're assuming that it should support it.
I've added the condition that BGRA8 is supported for ANGLE as well as GL_EXT_bgra, and a couple test
to confirm this.
BUG=460567
Review URL: https://codereview.chromium.org/947653002
Cr-Commit-Position: refs/heads/master@{#317958}
Diffstat (limited to 'gpu')
-rw-r--r-- | gpu/command_buffer/service/feature_info.cc | 4 | ||||
-rw-r--r-- | gpu/command_buffer/service/feature_info_unittest.cc | 20 |
2 files changed, 22 insertions, 2 deletions
diff --git a/gpu/command_buffer/service/feature_info.cc b/gpu/command_buffer/service/feature_info.cc index 803b121..79cc361 100644 --- a/gpu/command_buffer/service/feature_info.cc +++ b/gpu/command_buffer/service/feature_info.cc @@ -471,7 +471,9 @@ void FeatureInfo::InitializeFeatures() { enable_texture_format_bgra8888 = true; } - if (extensions.Contains("GL_EXT_bgra")) { + // Only desktop GL extension GL_EXT_bgra or ANGLE guarantee that we can + // allocate a renderbuffer with this format. + if (extensions.Contains("GL_EXT_bgra") || gl_version_info_->is_angle) { enable_render_buffer_bgra = true; } diff --git a/gpu/command_buffer/service/feature_info_unittest.cc b/gpu/command_buffer/service/feature_info_unittest.cc index 8455be6..177ef10 100644 --- a/gpu/command_buffer/service/feature_info_unittest.cc +++ b/gpu/command_buffer/service/feature_info_unittest.cc @@ -576,7 +576,7 @@ TEST_F(FeatureInfoTest, InitializeEXT_texture_storage_half_float) { GL_LUMINANCE_ALPHA16F_EXT)); } -// Check how to handle ES, texture_storage and BGRA combination; 8 tests. +// Check how to handle ES, texture_storage and BGRA combination; 10 tests. // 1- ES2 + GL_EXT_texture_storage -> GL_EXT_texture_storage (and no // GL_EXT_texture_format_BGRA8888 - we don't claim to handle GL_BGRA8 in @@ -658,6 +658,24 @@ TEST_F(FeatureInfoTest, InitializeGLES3_texture_storage) { Not(HasSubstr("GL_EXT_texture_format_BGRA8888"))); } +// 9- ANGLE will add the GL_CHROMIUM_renderbuffer_format_BGRA8888 extension and +// the GL_BGRA8_EXT render buffer format. +TEST_F(FeatureInfoTest, InitializeWithANGLE_BGRA8) { + SetupInitExpectationsWithGLVersion("", kGLRendererStringANGLE, ""); + EXPECT_TRUE(info_->gl_version_info().is_angle); + EXPECT_THAT(info_->extensions(), + HasSubstr("GL_CHROMIUM_renderbuffer_format_BGRA8888")); + EXPECT_TRUE(info_->validators()->render_buffer_format.IsValid(GL_BGRA8_EXT)); +} + +// 10- vanilla opengl es means no GL_CHROMIUM_renderbuffer_format_BGRA8888 +TEST_F(FeatureInfoTest, + InitializeGLES2_no_CHROMIUM_renderbuffer_format_BGRA8888) { + SetupInitExpectationsWithGLVersion("", "", "OpenGL ES 2.0"); + EXPECT_THAT(info_->extensions(), + Not(HasSubstr("GL_CHROMIUM_renderbuffer_format_BGRA8888"))); +} + TEST_F(FeatureInfoTest, InitializeARB_texture_float) { SetupInitExpectations("GL_ARB_texture_float"); EXPECT_TRUE(info_->feature_flags().chromium_color_buffer_float_rgba); |