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

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

Issue 6670074: GPU process - parent GL context does not delete the textures it shares with c... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 9 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
« no previous file with comments | « gpu/command_buffer/service/texture_manager.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/texture_manager_unittest.cc
===================================================================
--- gpu/command_buffer/service/texture_manager_unittest.cc (revision 78636)
+++ gpu/command_buffer/service/texture_manager_unittest.cc (working copy)
@@ -114,6 +114,28 @@
ASSERT_TRUE(info1 == NULL);
}
+TEST_F(TextureManagerTest, DestroyUnowned) {
+ const GLuint kClient1Id = 1;
+ const GLuint kService1Id = 11;
+ EXPECT_FALSE(manager_.HaveUnrenderableTextures());
+ // Check we can create texture.
+ TextureManager::TextureInfo* created_info =
+ manager_.CreateTextureInfo(&feature_info_, kClient1Id, kService1Id);
+ created_info->SetNotOwned();
+
+ // Check texture got created.
+ TextureManager::TextureInfo* info1 = manager_.GetTextureInfo(kClient1Id);
+ ASSERT_TRUE(info1 != NULL);
+ EXPECT_CALL(*gl_, DeleteTextures(4, _))
+ .Times(1)
+ .RetiresOnSaturation();
+
+ // Check that it is not freed if it is not owned.
+ manager_.Destroy(true);
+ info1 = manager_.GetTextureInfo(kClient1Id);
+ ASSERT_TRUE(info1 == NULL);
+}
+
TEST_F(TextureManagerTest, MaxValues) {
// Check we get the right values for the max sizes.
EXPECT_EQ(kMax2dLevels, manager_.MaxLevelsForTarget(GL_TEXTURE_2D));
« no previous file with comments | « gpu/command_buffer/service/texture_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698