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

Unified Diff: gpu/command_buffer/service/mailbox_manager_unittest.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: restore scissor state in GLES2DecoderImpl::ClearLevel and update GLES2DecoderManualInitTest.DrawCle… 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/mailbox_manager_unittest.cc
diff --git a/gpu/command_buffer/service/mailbox_manager_unittest.cc b/gpu/command_buffer/service/mailbox_manager_unittest.cc
index 0e064d4b488ac813106fa58f29d29c26b24e8bbf..3e14b76dc71827c975316e914cea350bc69b2f7d 100644
--- a/gpu/command_buffer/service/mailbox_manager_unittest.cc
+++ b/gpu/command_buffer/service/mailbox_manager_unittest.cc
@@ -47,29 +47,19 @@ class MailboxManagerTest : public GpuServiceTest {
texture->SetTarget(NULL, target, max_level);
}
- void SetLevelInfo(
- Texture* texture,
- GLenum target,
- GLint level,
- GLenum internal_format,
- GLsizei width,
- GLsizei height,
- GLsizei depth,
- GLint border,
- GLenum format,
- GLenum type,
- bool cleared) {
- texture->SetLevelInfo(NULL,
- target,
- level,
- internal_format,
- width,
- height,
- depth,
- border,
- format,
- type,
- cleared);
+ void SetLevelInfo(Texture* texture,
+ GLenum target,
+ GLint level,
+ GLenum internal_format,
+ GLsizei width,
+ GLsizei height,
+ GLsizei depth,
+ GLint border,
+ GLenum format,
+ GLenum type,
+ const gfx::Rect& cleared_rect) {
+ texture->SetLevelInfo(NULL, target, level, internal_format, width, height,
+ depth, border, format, type, cleared_rect);
}
void SetLevelCleared(Texture* texture,
@@ -211,17 +201,8 @@ class MailboxManagerSyncTest : public MailboxManagerTest {
const GLsizei levels_needed = TextureManager::ComputeMipMapCount(
GL_TEXTURE_2D, kMaxTextureWidth, kMaxTextureHeight, kMaxTextureDepth);
SetTarget(texture, GL_TEXTURE_2D, levels_needed);
- SetLevelInfo(texture,
- GL_TEXTURE_2D,
- 0,
- GL_RGBA,
- 1,
- 1,
- 1,
- 0,
- GL_RGBA,
- GL_UNSIGNED_BYTE,
- true);
+ SetLevelInfo(texture, GL_TEXTURE_2D, 0, GL_RGBA, 1, 1, 1, 0, GL_RGBA,
+ GL_UNSIGNED_BYTE, gfx::Rect(1, 1));
SetParameter(texture, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
SetParameter(texture, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
return texture;
@@ -352,17 +333,8 @@ TEST_F(MailboxManagerSyncTest, ProduceConsumeResize) {
EXPECT_EQ(kNewTextureId, new_texture->service_id());
// Resize original texture
- SetLevelInfo(texture,
- GL_TEXTURE_2D,
- 0,
- GL_RGBA,
- 16,
- 32,
- 1,
- 0,
- GL_RGBA,
- GL_UNSIGNED_BYTE,
- true);
+ SetLevelInfo(texture, GL_TEXTURE_2D, 0, GL_RGBA, 16, 32, 1, 0, GL_RGBA,
+ GL_UNSIGNED_BYTE, gfx::Rect(16, 32));
// Should have been orphaned
EXPECT_TRUE(texture->GetLevelImage(GL_TEXTURE_2D, 0) == NULL);
@@ -379,17 +351,8 @@ TEST_F(MailboxManagerSyncTest, ProduceConsumeResize) {
// Should have gotten a new attachment
EXPECT_TRUE(texture->GetLevelImage(GL_TEXTURE_2D, 0) != NULL);
// Resize original texture again....
- SetLevelInfo(texture,
- GL_TEXTURE_2D,
- 0,
- GL_RGBA,
- 64,
- 64,
- 1,
- 0,
- GL_RGBA,
- GL_UNSIGNED_BYTE,
- true);
+ SetLevelInfo(texture, GL_TEXTURE_2D, 0, GL_RGBA, 64, 64, 1, 0, GL_RGBA,
+ GL_UNSIGNED_BYTE, gfx::Rect(64, 64));
// ...and immediately delete the texture which should save the changes.
SetupUpdateTexParamExpectations(
kNewTextureId, GL_LINEAR, GL_LINEAR, GL_REPEAT, GL_REPEAT);
@@ -624,17 +587,8 @@ TEST_F(MailboxManagerSyncTest, SyncIncompleteTexture) {
EXPECT_FALSE(new_texture->IsDefined());
// Change cleared to false.
- SetLevelInfo(texture,
- GL_TEXTURE_2D,
- 0,
- GL_RGBA,
- 1,
- 1,
- 1,
- 0,
- GL_RGBA,
- GL_UNSIGNED_BYTE,
- true);
+ SetLevelInfo(texture, GL_TEXTURE_2D, 0, GL_RGBA, 1, 1, 1, 0, GL_RGBA,
+ GL_UNSIGNED_BYTE, gfx::Rect(1, 1));
SetParameter(texture, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
SetParameter(texture, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
EXPECT_TRUE(texture->IsDefined());

Powered by Google App Engine
This is Rietveld 408576698