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

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

Issue 24152009: Allow rendering from non-stream GL_TEXTURE_EXTERNAL_OES (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@git-svn
Patch Set: 2fea9080 Initial. Created 7 years, 3 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
diff --git a/gpu/command_buffer/service/texture_manager_unittest.cc b/gpu/command_buffer/service/texture_manager_unittest.cc
index 483aaf20fa65c3905bb4352ddb7ce2e8186aacf3..9c661c107c86d120d7f8c5a261c6fd5680c52087 100644
--- a/gpu/command_buffer/service/texture_manager_unittest.cc
+++ b/gpu/command_buffer/service/texture_manager_unittest.cc
@@ -466,11 +466,9 @@ TEST_F(TextureTest, SetTargetTextureExternalOES) {
EXPECT_FALSE(TextureTestHelper::IsCubeComplete(texture));
EXPECT_FALSE(manager_->CanGenerateMipmaps(texture_ref_.get()));
EXPECT_TRUE(TextureTestHelper::IsNPOT(texture));
- EXPECT_FALSE(manager_->CanRender(texture_ref_.get()));
+ EXPECT_TRUE(manager_->CanRender(texture_ref_.get()));
EXPECT_TRUE(texture->SafeToRenderFrom());
EXPECT_TRUE(texture->IsImmutable());
- manager_->SetStreamTexture(texture_ref_.get(), true);
- EXPECT_TRUE(manager_->CanRender(texture_ref_.get()));
}
TEST_F(TextureTest, ZeroSizeCanNotRender) {
@@ -2002,6 +2000,25 @@ TEST_F(ProduceConsumeTextureTest, ProduceConsumeClearRectangle) {
decoder_.get(), restored_texture.get(), GL_TEXTURE_RECTANGLE_ARB, 0));
}
+TEST_F(ProduceConsumeTextureTest, ProduceConsumeExternal) {
+ manager_->SetTarget(texture_ref_.get(), GL_TEXTURE_EXTERNAL_OES);
+ Texture* texture = texture_ref_->texture();
+ EXPECT_EQ(static_cast<GLenum>(GL_TEXTURE_EXTERNAL_OES), texture->target());
+ LevelInfo level0(
+ GL_TEXTURE_EXTERNAL_OES, GL_RGBA, 1, 1, 1, 0, GL_UNSIGNED_BYTE, false);
+ SetLevelInfo(texture_ref_.get(), 0, level0);
+ EXPECT_TRUE(TextureTestHelper::IsTextureComplete(texture));
+ Texture* produced_texture = Produce(texture_ref_.get());
+ EXPECT_EQ(produced_texture, texture);
+
+ GLuint client_id = texture2_->client_id();
+ manager_->RemoveTexture(client_id);
+ Consume(client_id, produced_texture);
+ scoped_refptr<TextureRef> restored_texture = manager_->GetTexture(client_id);
+ EXPECT_EQ(produced_texture, restored_texture->texture());
+ EXPECT_EQ(level0,
+ GetLevelInfo(restored_texture.get(), GL_TEXTURE_EXTERNAL_OES, 0));
+}
piman 2013/09/19 02:20:09 nit: blank line after this.
sheu 2013/09/19 05:34:21 Done.
TEST_F(ProduceConsumeTextureTest, ProduceConsumeStreamTexture) {
manager_->SetTarget(texture_ref_.get(), GL_TEXTURE_EXTERNAL_OES);
Texture* texture = texture_ref_->texture();
« 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