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

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

Issue 10543125: gpu: Add support for GLX_EXT_texture_from_pixmap extension. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move CreateGLImage below virtual methods. Created 8 years, 2 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/texture_manager_unittest.cc
diff --git a/gpu/command_buffer/service/texture_manager_unittest.cc b/gpu/command_buffer/service/texture_manager_unittest.cc
index dad2cf1e1fa57a11b2d70e2e21e11471a5deb4ae..487bde76348b103d1d4b90c329de5961ba12a518 100644
--- a/gpu/command_buffer/service/texture_manager_unittest.cc
+++ b/gpu/command_buffer/service/texture_manager_unittest.cc
@@ -999,6 +999,26 @@ TEST_F(TextureInfoTest, UseDeletedTexture) {
info = NULL;
}
+TEST_F(TextureInfoTest, GetLevelImage) {
+ manager_.SetInfoTarget(info_, GL_TEXTURE_2D);
+ manager_.SetLevelInfo(info_,
+ GL_TEXTURE_2D, 1, GL_RGBA, 2, 2, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, true);
+ EXPECT_TRUE(info_->GetLevelImage(GL_TEXTURE_2D, 1) == NULL);
+ // Set image.
+ manager_.SetLevelImage(info_,
+ GL_TEXTURE_2D, 1, gfx::GLImage::CreateGLImage(0));
+ EXPECT_FALSE(info_->GetLevelImage(GL_TEXTURE_2D, 1) == NULL);
+ // Remove it.
+ manager_.SetLevelImage(info_, GL_TEXTURE_2D, 1, NULL);
+ EXPECT_TRUE(info_->GetLevelImage(GL_TEXTURE_2D, 1) == NULL);
+ manager_.SetLevelImage(info_,
+ GL_TEXTURE_2D, 1, gfx::GLImage::CreateGLImage(0));
+ // Image should be reset when SetLevelInfo is called.
+ manager_.SetLevelInfo(info_,
+ GL_TEXTURE_2D, 1, GL_RGBA, 2, 2, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, true);
+ EXPECT_TRUE(info_->GetLevelImage(GL_TEXTURE_2D, 1) == NULL);
+}
+
} // namespace gles2
} // namespace gpu

Powered by Google App Engine
This is Rietveld 408576698