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

Unified Diff: gpu/command_buffer/client/gles2_implementation_unittest_autogen.h

Issue 11363191: Cache more GL state both service and client side. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 1 month 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/client/gles2_implementation_unittest_autogen.h
diff --git a/gpu/command_buffer/client/gles2_implementation_unittest_autogen.h b/gpu/command_buffer/client/gles2_implementation_unittest_autogen.h
index 890df134a58280f57ec14bb1f49be81838d9b2d5..304b3575e101314a6e6aca2523475a1413723cc6 100644
--- a/gpu/command_buffer/client/gles2_implementation_unittest_autogen.h
+++ b/gpu/command_buffer/client/gles2_implementation_unittest_autogen.h
@@ -33,6 +33,9 @@ TEST_F(GLES2ImplementationTest, BindBuffer) {
gl_->BindBuffer(GL_ARRAY_BUFFER, 2);
EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
+ ClearCommands();
+ gl_->BindBuffer(GL_ARRAY_BUFFER, 2);
+ EXPECT_TRUE(NoCommandsWritten());
}
TEST_F(GLES2ImplementationTest, BindFramebuffer) {
@@ -44,6 +47,9 @@ TEST_F(GLES2ImplementationTest, BindFramebuffer) {
gl_->BindFramebuffer(GL_FRAMEBUFFER, 2);
EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
+ ClearCommands();
+ gl_->BindFramebuffer(GL_FRAMEBUFFER, 2);
+ EXPECT_TRUE(NoCommandsWritten());
}
TEST_F(GLES2ImplementationTest, BindRenderbuffer) {
@@ -55,6 +61,9 @@ TEST_F(GLES2ImplementationTest, BindRenderbuffer) {
gl_->BindRenderbuffer(GL_RENDERBUFFER, 2);
EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
+ ClearCommands();
+ gl_->BindRenderbuffer(GL_RENDERBUFFER, 2);
+ EXPECT_TRUE(NoCommandsWritten());
}
TEST_F(GLES2ImplementationTest, BindTexture) {
@@ -66,6 +75,9 @@ TEST_F(GLES2ImplementationTest, BindTexture) {
gl_->BindTexture(GL_TEXTURE_2D, 2);
EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
+ ClearCommands();
+ gl_->BindTexture(GL_TEXTURE_2D, 2);
+ EXPECT_TRUE(NoCommandsWritten());
}
TEST_F(GLES2ImplementationTest, BlendColor) {
@@ -84,9 +96,9 @@ TEST_F(GLES2ImplementationTest, BlendEquation) {
BlendEquation cmd;
};
Cmds expected;
- expected.cmd.Init(GL_FUNC_ADD);
+ expected.cmd.Init(GL_FUNC_SUBTRACT);
- gl_->BlendEquation(GL_FUNC_ADD);
+ gl_->BlendEquation(GL_FUNC_SUBTRACT);
EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
}
@@ -95,9 +107,9 @@ TEST_F(GLES2ImplementationTest, BlendEquationSeparate) {
BlendEquationSeparate cmd;
};
Cmds expected;
- expected.cmd.Init(GL_FUNC_ADD, GL_FUNC_ADD);
+ expected.cmd.Init(GL_FUNC_SUBTRACT, GL_FUNC_ADD);
- gl_->BlendEquationSeparate(GL_FUNC_ADD, GL_FUNC_ADD);
+ gl_->BlendEquationSeparate(GL_FUNC_SUBTRACT, GL_FUNC_ADD);
EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
}
@@ -366,17 +378,6 @@ TEST_F(GLES2ImplementationTest, DetachShader) {
EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
}
-TEST_F(GLES2ImplementationTest, Disable) {
- struct Cmds {
- Disable cmd;
- };
- Cmds expected;
- expected.cmd.Init(GL_BLEND);
-
- gl_->Disable(GL_BLEND);
- EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
-}
-
TEST_F(GLES2ImplementationTest, DisableVertexAttribArray) {
struct Cmds {
DisableVertexAttribArray cmd;
@@ -399,17 +400,6 @@ TEST_F(GLES2ImplementationTest, DrawArrays) {
EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
}
-TEST_F(GLES2ImplementationTest, Enable) {
- struct Cmds {
- Enable cmd;
- };
- Cmds expected;
- expected.cmd.Init(GL_BLEND);
-
- gl_->Enable(GL_BLEND);
- EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
-}
-
TEST_F(GLES2ImplementationTest, EnableVertexAttribArray) {
struct Cmds {
EnableVertexAttribArray cmd;
@@ -1050,9 +1040,9 @@ TEST_F(GLES2ImplementationTest, StencilOp) {
StencilOp cmd;
};
Cmds expected;
- expected.cmd.Init(GL_KEEP, GL_KEEP, GL_KEEP);
+ expected.cmd.Init(GL_KEEP, GL_INCR, GL_KEEP);
- gl_->StencilOp(GL_KEEP, GL_KEEP, GL_KEEP);
+ gl_->StencilOp(GL_KEEP, GL_INCR, GL_KEEP);
EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
}
@@ -1061,9 +1051,9 @@ TEST_F(GLES2ImplementationTest, StencilOpSeparate) {
StencilOpSeparate cmd;
};
Cmds expected;
- expected.cmd.Init(GL_FRONT, GL_KEEP, GL_KEEP, GL_KEEP);
+ expected.cmd.Init(GL_FRONT, GL_INCR, GL_KEEP, GL_KEEP);
- gl_->StencilOpSeparate(GL_FRONT, GL_KEEP, GL_KEEP, GL_KEEP);
+ gl_->StencilOpSeparate(GL_FRONT, GL_INCR, GL_KEEP, GL_KEEP);
EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
}
@@ -1667,6 +1657,9 @@ TEST_F(GLES2ImplementationTest, BindVertexArrayOES) {
gl_->BindVertexArrayOES(1);
EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
+ ClearCommands();
+ gl_->BindVertexArrayOES(1);
+ EXPECT_TRUE(NoCommandsWritten());
}
// TODO: Implement unit test for GenSharedIdsCHROMIUM
// TODO: Implement unit test for DeleteSharedIdsCHROMIUM
« no previous file with comments | « gpu/command_buffer/client/gles2_implementation_unittest.cc ('k') | gpu/command_buffer/service/context_state.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698