diff options
author | kbr@chromium.org <kbr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-26 02:33:57 +0000 |
---|---|---|
committer | kbr@chromium.org <kbr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-26 02:33:57 +0000 |
commit | 51dc466c1221560541a9eac02c1d1b72ff37ea90 (patch) | |
tree | 68a86b696a5e21552a2e83933321ac9b15c8f8c6 /gpu | |
parent | c7403e2e25e42253a7473b8b6a6c10594af0fbeb (diff) | |
download | chromium_src-51dc466c1221560541a9eac02c1d1b72ff37ea90.zip chromium_src-51dc466c1221560541a9eac02c1d1b72ff37ea90.tar.gz chromium_src-51dc466c1221560541a9eac02c1d1b72ff37ea90.tar.bz2 |
Fix GL_CHROMIUM_framebuffer_multisample to accept the correct enums.
Add support for GL_OES_rgb8_rgba8. Update feature_info unit tests.
Tested with the accelerated 2D canvas in WebKit with multisampling
turned on.
BUG=none
TEST=gpu_unittests
Review URL: http://codereview.chromium.org/6268016
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@72595 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu')
-rw-r--r-- | gpu/command_buffer/common/gles2_cmd_utils.cc | 4 | ||||
-rw-r--r-- | gpu/command_buffer/service/feature_info.cc | 12 | ||||
-rw-r--r-- | gpu/command_buffer/service/feature_info_unittest.cc | 15 | ||||
-rw-r--r-- | gpu/command_buffer/service/gl_utils.h | 2 |
4 files changed, 31 insertions, 2 deletions
diff --git a/gpu/command_buffer/common/gles2_cmd_utils.cc b/gpu/command_buffer/common/gles2_cmd_utils.cc index 8574f4f..a46d420 100644 --- a/gpu/command_buffer/common/gles2_cmd_utils.cc +++ b/gpu/command_buffer/common/gles2_cmd_utils.cc @@ -193,6 +193,10 @@ int GLES2Util::GLGetNumValuesReturned(int id) const { return 1; case GL_VIEWPORT: return 4; + // -- glGetBooleanv, glGetFloatv, glGetIntergerv with + // GL_CHROMIUM_framebuffer_multisample + case GL_MAX_SAMPLES_EXT: + return 1; // -- glGetBufferParameteriv case GL_BUFFER_SIZE: diff --git a/gpu/command_buffer/service/feature_info.cc b/gpu/command_buffer/service/feature_info.cc index b42bd4e..ad85737 100644 --- a/gpu/command_buffer/service/feature_info.cc +++ b/gpu/command_buffer/service/feature_info.cc @@ -204,6 +204,15 @@ void FeatureInfo::AddFeatures(const char* desired_features) { validators_.read_pixel_format.AddValue(GL_BGRA_EXT); } + if (ext.Desire("GL_OES_rgb8_rgba8")) { + if (ext.Have("GL_OES_rgb8_rgba8") || + gfx::GetGLImplementation() == gfx::kGLImplementationDesktopGL) { + AddExtensionString("GL_OES_rgb8_rgba8"); + validators_.render_buffer_format.AddValue(GL_RGB8_OES); + validators_.render_buffer_format.AddValue(GL_RGBA8_OES); + } + } + // Check if we should allow GL_OES_texture_npot if (ext.Desire("GL_OES_texture_npot") && (ext.Have("GL_ARB_texture_non_power_of_two") || @@ -273,7 +282,8 @@ void FeatureInfo::AddFeatures(const char* desired_features) { validators_.frame_buffer_target.AddValue(GL_READ_FRAMEBUFFER_EXT); validators_.frame_buffer_target.AddValue(GL_DRAW_FRAMEBUFFER_EXT); validators_.g_l_state.AddValue(GL_READ_FRAMEBUFFER_BINDING_EXT); - validators_.render_buffer_parameter.AddValue(GL_MAX_SAMPLES_EXT); + validators_.g_l_state.AddValue(GL_MAX_SAMPLES_EXT); + validators_.render_buffer_parameter.AddValue(GL_RENDERBUFFER_SAMPLES_EXT); AddExtensionString("GL_CHROMIUM_framebuffer_multisample"); } diff --git a/gpu/command_buffer/service/feature_info_unittest.cc b/gpu/command_buffer/service/feature_info_unittest.cc index 8a46c3e..4db4229 100644 --- a/gpu/command_buffer/service/feature_info_unittest.cc +++ b/gpu/command_buffer/service/feature_info_unittest.cc @@ -286,8 +286,10 @@ TEST_F(FeatureInfoTest, InitializeEXT_framebuffer_multisample) { GL_DRAW_FRAMEBUFFER_EXT)); EXPECT_TRUE(info_.validators()->g_l_state.IsValid( GL_READ_FRAMEBUFFER_BINDING_EXT)); - EXPECT_TRUE(info_.validators()->render_buffer_parameter.IsValid( + EXPECT_TRUE(info_.validators()->g_l_state.IsValid( GL_MAX_SAMPLES_EXT)); + EXPECT_TRUE(info_.validators()->render_buffer_parameter.IsValid( + GL_RENDERBUFFER_SAMPLES_EXT)); } TEST_F(FeatureInfoTest, InitializeEXT_texture_filter_anisotropic) { @@ -395,6 +397,17 @@ TEST_F(FeatureInfoTest, InitializeCHROMIUM_webglsl) { EXPECT_TRUE(info_.feature_flags().chromium_webglsl); } +TEST_F(FeatureInfoTest, InitializeOES_rgb8_rgba8) { + SetupInitExpectations("GL_OES_rgb8_rgba8"); + info_.Initialize(NULL); + EXPECT_THAT(info_.extensions(), + HasSubstr("GL_OES_rgb8_rgba8")); + EXPECT_TRUE(info_.validators()->render_buffer_format.IsValid( + GL_RGB8_OES)); + EXPECT_TRUE(info_.validators()->render_buffer_format.IsValid( + GL_RGBA8_OES)); +} + } // namespace gles2 } // namespace gpu diff --git a/gpu/command_buffer/service/gl_utils.h b/gpu/command_buffer/service/gl_utils.h index 0a14c9f..f7a5f8f 100644 --- a/gpu/command_buffer/service/gl_utils.h +++ b/gpu/command_buffer/service/gl_utils.h @@ -29,6 +29,8 @@ #define GL_SHADER_COMPILER 0x8DFA #define GL_RGB565 0x8D62 #define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES 0x8B8B +#define GL_RGB8_OES 0x8051 +#define GL_RGBA8_OES 0x8058 #define GL_GLEXT_PROTOTYPES 1 |