Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(194)

Unified Diff: gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc

Issue 2009073002: command_buffer: Guard on extension and profiles in the decoder (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Check for GL errors in the unittest Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc
index 1401d2d8f277cf29439c3f71db672018d2b919f9..ffa888cdbe2151799cb3977e9373531599ed3203 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc
@@ -344,15 +344,34 @@ void GLES2DecoderTestBase::InitDecoderWithCommandLine(
EXPECT_CALL(*gl_, BindFramebufferEXT(GL_FRAMEBUFFER, 0))
.Times(1)
.RetiresOnSaturation();
- EXPECT_CALL(*gl_, GetIntegerv(GL_ALPHA_BITS, _))
- .WillOnce(SetArgumentPointee<1>(normalized_init.has_alpha ? 8 : 0))
- .RetiresOnSaturation();
- EXPECT_CALL(*gl_, GetIntegerv(GL_DEPTH_BITS, _))
- .WillOnce(SetArgumentPointee<1>(normalized_init.has_depth ? 24 : 0))
- .RetiresOnSaturation();
- EXPECT_CALL(*gl_, GetIntegerv(GL_STENCIL_BITS, _))
- .WillOnce(SetArgumentPointee<1>(normalized_init.has_stencil ? 8 : 0))
- .RetiresOnSaturation();
+
+ if (group_->feature_info()->gl_version_info().is_desktop_core_profile) {
+ EXPECT_CALL(*gl_, GetFramebufferAttachmentParameterivEXT(
+ GL_FRAMEBUFFER, GL_BACK_LEFT,
+ GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE, _))
+ .WillOnce(SetArgumentPointee<3>(normalized_init.has_alpha ? 8 : 0))
+ .RetiresOnSaturation();
+ EXPECT_CALL(*gl_, GetFramebufferAttachmentParameterivEXT(
+ GL_FRAMEBUFFER, GL_DEPTH,
+ GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE, _))
+ .WillOnce(SetArgumentPointee<3>(normalized_init.has_depth ? 24 : 0))
+ .RetiresOnSaturation();
+ EXPECT_CALL(*gl_, GetFramebufferAttachmentParameterivEXT(
+ GL_FRAMEBUFFER, GL_STENCIL,
+ GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE, _))
+ .WillOnce(SetArgumentPointee<3>(normalized_init.has_stencil ? 8 : 0))
+ .RetiresOnSaturation();
+ } else {
+ EXPECT_CALL(*gl_, GetIntegerv(GL_ALPHA_BITS, _))
+ .WillOnce(SetArgumentPointee<1>(normalized_init.has_alpha ? 8 : 0))
+ .RetiresOnSaturation();
+ EXPECT_CALL(*gl_, GetIntegerv(GL_DEPTH_BITS, _))
+ .WillOnce(SetArgumentPointee<1>(normalized_init.has_depth ? 24 : 0))
+ .RetiresOnSaturation();
+ EXPECT_CALL(*gl_, GetIntegerv(GL_STENCIL_BITS, _))
+ .WillOnce(SetArgumentPointee<1>(normalized_init.has_stencil ? 8 : 0))
+ .RetiresOnSaturation();
+ }
if (!group_->feature_info()->gl_version_info().BehavesLikeGLES()) {
EXPECT_CALL(*gl_, Enable(GL_VERTEX_PROGRAM_POINT_SIZE))
@@ -362,6 +381,12 @@ void GLES2DecoderTestBase::InitDecoderWithCommandLine(
EXPECT_CALL(*gl_, Enable(GL_POINT_SPRITE))
.Times(1)
.RetiresOnSaturation();
+ } else if (group_->feature_info()
+ ->gl_version_info()
+ .is_desktop_core_profile) {
+ EXPECT_CALL(*gl_, Enable(GL_PROGRAM_POINT_SIZE))
+ .Times(1)
+ .RetiresOnSaturation();
}
if (group_->feature_info()->gl_version_info().IsAtLeastGL(3, 2)) {

Powered by Google App Engine
This is Rietveld 408576698