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

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

Issue 1154053002: gpu: Use a rectangle to keep track of the cleared area of each texture level. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix GLES2DecoderImpl::DoCopyTexImage2D Created 5 years, 6 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_drawing.cc
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_drawing.cc b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_drawing.cc
index bb0286d2a8366378c2fcb322199067c966ce15a7..40e2381020754368c3d19601f89ffc974849b302 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_drawing.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_drawing.cc
@@ -1820,26 +1820,12 @@ TEST_P(GLES2DecoderWithShaderTest, DrawArraysClearsAfterTexImage2DNULL) {
DoTexImage2D(
GL_TEXTURE_2D, 1, GL_RGBA, 1, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0, 0);
// Expect 2 levels will be cleared.
- SetupClearTextureExpectations(kServiceTextureId,
- kServiceTextureId,
- GL_TEXTURE_2D,
- GL_TEXTURE_2D,
- 0,
- GL_RGBA,
- GL_RGBA,
- GL_UNSIGNED_BYTE,
- 2,
- 2);
- SetupClearTextureExpectations(kServiceTextureId,
- kServiceTextureId,
- GL_TEXTURE_2D,
- GL_TEXTURE_2D,
- 1,
- GL_RGBA,
- GL_RGBA,
- GL_UNSIGNED_BYTE,
- 1,
- 1);
+ SetupClearTextureExpectations(kServiceTextureId, kServiceTextureId,
+ GL_TEXTURE_2D, GL_TEXTURE_2D, 0, GL_RGBA,
+ GL_RGBA, GL_UNSIGNED_BYTE, 0, 0, 2, 2);
+ SetupClearTextureExpectations(kServiceTextureId, kServiceTextureId,
+ GL_TEXTURE_2D, GL_TEXTURE_2D, 1, GL_RGBA,
+ GL_RGBA, GL_UNSIGNED_BYTE, 0, 0, 1, 1);
SetupExpectationsForApplyingDefaultDirtyState();
EXPECT_CALL(*gl_, DrawArrays(GL_TRIANGLES, 0, kNumVertices))
.Times(1)
@@ -1867,26 +1853,12 @@ TEST_P(GLES2DecoderWithShaderTest, DrawElementsClearsAfterTexImage2DNULL) {
DoTexImage2D(
GL_TEXTURE_2D, 1, GL_RGBA, 1, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0, 0);
// Expect 2 levels will be cleared.
- SetupClearTextureExpectations(kServiceTextureId,
- kServiceTextureId,
- GL_TEXTURE_2D,
- GL_TEXTURE_2D,
- 0,
- GL_RGBA,
- GL_RGBA,
- GL_UNSIGNED_BYTE,
- 2,
- 2);
- SetupClearTextureExpectations(kServiceTextureId,
- kServiceTextureId,
- GL_TEXTURE_2D,
- GL_TEXTURE_2D,
- 1,
- GL_RGBA,
- GL_RGBA,
- GL_UNSIGNED_BYTE,
- 1,
- 1);
+ SetupClearTextureExpectations(kServiceTextureId, kServiceTextureId,
+ GL_TEXTURE_2D, GL_TEXTURE_2D, 0, GL_RGBA,
+ GL_RGBA, GL_UNSIGNED_BYTE, 0, 0, 2, 2);
+ SetupClearTextureExpectations(kServiceTextureId, kServiceTextureId,
+ GL_TEXTURE_2D, GL_TEXTURE_2D, 1, GL_RGBA,
+ GL_RGBA, GL_UNSIGNED_BYTE, 0, 0, 1, 1);
SetupExpectationsForApplyingDefaultDirtyState();
EXPECT_CALL(*gl_,
@@ -2107,26 +2079,14 @@ TEST_P(GLES2DecoderManualInitTest, DrawArraysClearsAfterTexImage2DNULLCubemap) {
shm_offset);
}
// Expect 2 levels will be cleared.
- SetupClearTextureExpectations(kServiceTextureId,
- kServiceTextureId,
+ SetupClearTextureExpectations(kServiceTextureId, kServiceTextureId,
GL_TEXTURE_CUBE_MAP,
- GL_TEXTURE_CUBE_MAP_NEGATIVE_Y,
- 0,
- GL_RGBA,
- GL_RGBA,
- GL_UNSIGNED_BYTE,
- 2,
- 2);
- SetupClearTextureExpectations(kServiceTextureId,
- kServiceTextureId,
+ GL_TEXTURE_CUBE_MAP_NEGATIVE_Y, 0, GL_RGBA,
+ GL_RGBA, GL_UNSIGNED_BYTE, 0, 0, 2, 2);
+ SetupClearTextureExpectations(kServiceTextureId, kServiceTextureId,
GL_TEXTURE_CUBE_MAP,
- GL_TEXTURE_CUBE_MAP_NEGATIVE_Y,
- 1,
- GL_RGBA,
- GL_RGBA,
- GL_UNSIGNED_BYTE,
- 1,
- 1);
+ GL_TEXTURE_CUBE_MAP_NEGATIVE_Y, 1, GL_RGBA,
+ GL_RGBA, GL_UNSIGNED_BYTE, 0, 0, 1, 1);
AddExpectationsForSimulatedAttrib0(kNumVertices, 0);
SetupExpectationsForApplyingDefaultDirtyState();
EXPECT_CALL(*gl_, DrawArrays(GL_TRIANGLES, 0, kNumVertices))

Powered by Google App Engine
This is Rietveld 408576698