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

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

Issue 2208733002: Command buffer: clear rect for a specific layer/level of the uncleared texture for CopyTexSubImage3D (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Do not assign a default value 0 to layer, UpdateMipCleared for all layers for 3D texture Created 4 years, 4 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 0c2a1e0f1e54dad240c81c09fe0857582738bf71..318006d0690aa4b6f9852c9fac4275fb6db90a65 100644
--- a/gpu/command_buffer/service/mailbox_manager_unittest.cc
+++ b/gpu/command_buffer/service/mailbox_manager_unittest.cc
@@ -50,8 +50,11 @@ class MailboxManagerTest : public GpuServiceTest {
return new Texture(1);
}
- void SetTarget(Texture* texture, GLenum target, GLuint max_level) {
- texture->SetTarget(target, max_level);
+ void SetTarget(Texture* texture,
+ GLenum target,
+ GLuint max_level,
+ GLuint layers) {
+ texture->SetTarget(target, max_level, layers);
}
void SetLevelInfo(Texture* texture,
@@ -73,7 +76,7 @@ class MailboxManagerTest : public GpuServiceTest {
GLenum target,
GLint level,
bool cleared) {
- texture->SetLevelCleared(target, level, cleared);
+ texture->SetLevelCleared(target, level, 0, cleared);
}
GLenum SetParameter(Texture* texture, GLenum pname, GLint param) {
@@ -207,7 +210,7 @@ class MailboxManagerSyncTest : public MailboxManagerTest {
Texture* texture = CreateTexture();
const GLsizei levels_needed = TextureManager::ComputeMipMapCount(
GL_TEXTURE_2D, kMaxTextureWidth, kMaxTextureHeight, kMaxTextureDepth);
- SetTarget(texture, GL_TEXTURE_2D, levels_needed);
+ SetTarget(texture, GL_TEXTURE_2D, levels_needed, kMaxTextureDepth);
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);
@@ -340,7 +343,7 @@ TEST_F(MailboxManagerSyncTest, ProduceConsumeResize) {
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);
+ EXPECT_TRUE(texture->GetLevelImage(GL_TEXTURE_2D, 0, 0) == NULL);
// Synchronize again
manager_->PushTextureUpdates(g_sync_token);
@@ -353,7 +356,7 @@ TEST_F(MailboxManagerSyncTest, ProduceConsumeResize) {
EXPECT_EQ(32, height);
// Should have gotten a new attachment
- EXPECT_TRUE(texture->GetLevelImage(GL_TEXTURE_2D, 0) != NULL);
+ EXPECT_TRUE(texture->GetLevelImage(GL_TEXTURE_2D, 0, 0) != NULL);
// Resize original texture again....
SetLevelInfo(texture, GL_TEXTURE_2D, 0, GL_RGBA, 64, 64, 1, 0, GL_RGBA,
GL_UNSIGNED_BYTE, gfx::Rect(64, 64));
@@ -567,7 +570,7 @@ TEST_F(MailboxManagerSyncTest, SyncIncompleteTexture) {
// Create but not define texture.
Texture* texture = CreateTexture();
- SetTarget(texture, GL_TEXTURE_2D, 1);
+ SetTarget(texture, GL_TEXTURE_2D, 1, kMaxTextureDepth);
EXPECT_FALSE(texture->IsDefined());
Mailbox name = Mailbox::Generate();
« no previous file with comments | « gpu/command_buffer/service/mailbox_manager_sync.cc ('k') | gpu/command_buffer/service/texture_definition.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698