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

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

Issue 6028005: Make CopyTexImage2D and CopyTexSubImage2D fail if... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years 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.cc
===================================================================
--- gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc (revision 69969)
+++ gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc (working copy)
@@ -1235,7 +1235,7 @@
FramebufferTexture2D cmd;
cmd.Init(
GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, client_texture_id_,
- 5);
+ 0);
EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
EXPECT_EQ(GL_INVALID_OPERATION, GetGLError());
}
@@ -1259,11 +1259,17 @@
TEST_F(GLES2DecoderTest, GetFramebufferAttachmentParameterivWithRenderbuffer) {
DoBindFramebuffer(GL_FRAMEBUFFER, client_framebuffer_id_,
kServiceFramebufferId);
+ EXPECT_CALL(*gl_, GetError())
+ .WillOnce(Return(GL_NO_ERROR))
+ .RetiresOnSaturation();
EXPECT_CALL(*gl_, FramebufferRenderbufferEXT(
GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER,
kServiceRenderbufferId))
.Times(1)
.RetiresOnSaturation();
+ EXPECT_CALL(*gl_, GetError())
+ .WillOnce(Return(GL_NO_ERROR))
+ .RetiresOnSaturation();
SetupExpectationsForFramebufferAttachment(
GL_COLOR_BUFFER_BIT, // clear bits
0, 0, 0, 0, // color
@@ -1313,11 +1319,17 @@
TEST_F(GLES2DecoderTest, GetFramebufferAttachmentParameterivWithTexture) {
DoBindFramebuffer(GL_FRAMEBUFFER, client_framebuffer_id_,
kServiceFramebufferId);
+ EXPECT_CALL(*gl_, GetError())
+ .WillOnce(Return(GL_NO_ERROR))
+ .RetiresOnSaturation();
EXPECT_CALL(*gl_, FramebufferTexture2DEXT(
GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D,
- kServiceTextureId, 5))
+ kServiceTextureId, 0))
.Times(1)
.RetiresOnSaturation();
+ EXPECT_CALL(*gl_, GetError())
+ .WillOnce(Return(GL_NO_ERROR))
+ .RetiresOnSaturation();
SetupExpectationsForFramebufferAttachment(
0, // clear bits
0, 0, 0, 0, // color
@@ -1353,7 +1365,7 @@
GetFramebufferAttachmentParameteriv cmd;
fbtex_cmd.Init(
GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, client_texture_id_,
- 5);
+ 0);
cmd.Init(
GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, shared_memory_id_,
@@ -1485,38 +1497,34 @@
kFormat, GL_UNSIGNED_BYTE, 0, 0);
DoBindFramebuffer(GL_FRAMEBUFFER, client_framebuffer_id_,
kServiceFramebufferId);
+ EXPECT_CALL(*gl_, GetError())
+ .WillOnce(Return(GL_NO_ERROR))
+ .RetiresOnSaturation();
+ EXPECT_CALL(*gl_, FramebufferTexture2DEXT(
+ GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D,
+ kServiceTextureId, 0))
+ .Times(1)
+ .RetiresOnSaturation();
+ EXPECT_CALL(*gl_, GetError())
+ .WillOnce(Return(GL_NO_ERROR))
+ .RetiresOnSaturation();
+ SetupExpectationsForFramebufferAttachment(
+ 0, // clear bits
+ 0, 0, 0, 0, // color
+ 0x1111, // color bits
+ 0, // stencil
+ -1, // stencil mask back,
+ -1, // stencil mask front,
+ 1.0f, // depth
+ 1, // depth mask
+ false); // scissor test
+ FramebufferTexture2D fbtex_cmd;
+ fbtex_cmd.Init(
+ GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, client_texture_id_,
+ 0);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(fbtex_cmd));
}
- // We need to tell our mock GL to return the info about our FBO.
- EXPECT_CALL(*gl_, GetFramebufferAttachmentParameterivEXT(
- GL_FRAMEBUFFER,
- GL_COLOR_ATTACHMENT0,
- GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE,
- _))
- .WillOnce(SetArgumentPointee<3>(GL_TEXTURE))
- .RetiresOnSaturation();
- EXPECT_CALL(*gl_, GetFramebufferAttachmentParameterivEXT(
- GL_FRAMEBUFFER,
- GL_COLOR_ATTACHMENT0,
- GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME,
- _))
- .WillOnce(SetArgumentPointee<3>(kServiceTextureId))
- .RetiresOnSaturation();
- EXPECT_CALL(*gl_, GetFramebufferAttachmentParameterivEXT(
- GL_FRAMEBUFFER,
- GL_COLOR_ATTACHMENT0,
- GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL,
- _))
- .WillOnce(SetArgumentPointee<3>(0))
- .RetiresOnSaturation();
- EXPECT_CALL(*gl_, GetFramebufferAttachmentParameterivEXT(
- GL_FRAMEBUFFER,
- GL_COLOR_ATTACHMENT0,
- GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE,
- _))
- .WillOnce(SetArgumentPointee<3>(0))
- .RetiresOnSaturation();
-
ReadPixelsEmulator emu(
kWidth, kHeight, kBytesPerPixel, kSrcPixels, kPackAlignment);
typedef ReadPixels::Result Result;
@@ -2447,11 +2455,17 @@
EXPECT_CALL(*gl_, Enable(GL_SCISSOR_TEST))
.Times(1)
.RetiresOnSaturation();
+ EXPECT_CALL(*gl_, GetError())
+ .WillOnce(Return(GL_NO_ERROR))
+ .RetiresOnSaturation();
EXPECT_CALL(*gl_, FramebufferRenderbufferEXT(
GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER,
kServiceRenderbufferId))
.Times(1)
.RetiresOnSaturation();
+ EXPECT_CALL(*gl_, GetError())
+ .WillOnce(Return(GL_NO_ERROR))
+ .RetiresOnSaturation();
SetupExpectationsForFramebufferAttachment(
GL_COLOR_BUFFER_BIT, // clear bits
0.1f, 0.2f, 0.3f, 0.4f, // color
@@ -2486,11 +2500,17 @@
EXPECT_CALL(*gl_, DepthMask(0))
.Times(1)
.RetiresOnSaturation();
+ EXPECT_CALL(*gl_, GetError())
+ .WillOnce(Return(GL_NO_ERROR))
+ .RetiresOnSaturation();
EXPECT_CALL(*gl_, FramebufferRenderbufferEXT(
GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER,
kServiceRenderbufferId))
.Times(1)
.RetiresOnSaturation();
+ EXPECT_CALL(*gl_, GetError())
+ .WillOnce(Return(GL_NO_ERROR))
+ .RetiresOnSaturation();
SetupExpectationsForFramebufferAttachment(
GL_DEPTH_BUFFER_BIT, // clear bits
0, 0, 0, 0, // color
@@ -2524,11 +2544,17 @@
EXPECT_CALL(*gl_, StencilMaskSeparate(GL_BACK, 0x1234u))
.Times(1)
.RetiresOnSaturation();
+ EXPECT_CALL(*gl_, GetError())
+ .WillOnce(Return(GL_NO_ERROR))
+ .RetiresOnSaturation();
EXPECT_CALL(*gl_, FramebufferRenderbufferEXT(
GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER,
kServiceRenderbufferId))
.Times(1)
.RetiresOnSaturation();
+ EXPECT_CALL(*gl_, GetError())
+ .WillOnce(Return(GL_NO_ERROR))
+ .RetiresOnSaturation();
SetupExpectationsForFramebufferAttachment(
GL_STENCIL_BUFFER_BIT, // clear bits
0, 0, 0, 0, // color
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder_autogen.h ('k') | gpu/command_buffer/service/gles2_cmd_decoder_unittest_1.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698