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

Unified Diff: cc/texture_copier_unittest.cc

Issue 11368152: Disable scissor test during texture copies (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
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
« no previous file with comments | « cc/texture_copier.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/texture_copier_unittest.cc
diff --git a/cc/texture_copier_unittest.cc b/cc/texture_copier_unittest.cc
index a689abbea30a2ec6dc9e31fdacf598e880c04e3f..5765c516a1f342c1d1cddcd36a2b2f2fa37a0ef7 100644
--- a/cc/texture_copier_unittest.cc
+++ b/cc/texture_copier_unittest.cc
@@ -23,6 +23,8 @@ class MockContext : public FakeWebGraphicsContext3D {
public:
MOCK_METHOD2(bindFramebuffer, void(WGC3Denum, WebGLId));
MOCK_METHOD3(texParameteri, void(WGC3Denum target, WGC3Denum pname, WGC3Dint param));
+ MOCK_METHOD1(disable, void(WGC3Denum cap));
+ MOCK_METHOD1(enable, void(WGC3Denum cap));
MOCK_METHOD3(drawArrays, void(WGC3Denum mode, WGC3Dint first, WGC3Dsizei count));
};
@@ -34,6 +36,8 @@ TEST(TextureCopierTest, testDrawArraysCopy)
{
InSequence sequence;
+ EXPECT_CALL(*mockContext, disable(GL_SCISSOR_TEST));
+
// Here we check just some essential properties of copyTexture() to avoid mirroring the full implementation.
EXPECT_CALL(*mockContext, bindFramebuffer(GL_FRAMEBUFFER, _));
@@ -41,14 +45,15 @@ TEST(TextureCopierTest, testDrawArraysCopy)
EXPECT_CALL(*mockContext, texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST));
EXPECT_CALL(*mockContext, texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST));
+ EXPECT_CALL(*mockContext, disable(GL_BLEND));
+
EXPECT_CALL(*mockContext, drawArrays(_, _, _));
- // Linear filtering should be restored.
+ // Linear filtering, default framebuffer and scissor test should be restored.
EXPECT_CALL(*mockContext, texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR));
EXPECT_CALL(*mockContext, texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR));
-
- // Default framebuffer should be restored
EXPECT_CALL(*mockContext, bindFramebuffer(GL_FRAMEBUFFER, 0));
+ EXPECT_CALL(*mockContext, enable(GL_SCISSOR_TEST));
}
int sourceTextureId = 1;
« no previous file with comments | « cc/texture_copier.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698