summaryrefslogtreecommitdiffstats
path: root/gpu/command_buffer/service/texture_manager_unittest.cc
diff options
context:
space:
mode:
authorsievers@chromium.org <sievers@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-28 22:04:42 +0000
committersievers@chromium.org <sievers@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-28 22:04:42 +0000
commitb0af4f572f1e082a876a1e87eb2933c5876e0ba0 (patch)
treedfa113ede64291cf4fd1604d992e64fb901fef79 /gpu/command_buffer/service/texture_manager_unittest.cc
parenta09ef7e5fade0f4f62157aae616f3929b8cbba53 (diff)
downloadchromium_src-b0af4f572f1e082a876a1e87eb2933c5876e0ba0.zip
chromium_src-b0af4f572f1e082a876a1e87eb2933c5876e0ba0.tar.gz
chromium_src-b0af4f572f1e082a876a1e87eb2933c5876e0ba0.tar.bz2
External stream texture support.
This adds a GL_CHROMIUM_stream_texture extension with an abstract interface that can be used to allow a consumer to render from a stream of textures being produced externally. It adds the following functionality: * GLuint glCreateStreamTextureCHROMIUM(GLuint texture) This API takes a texture id and creates a StreamTexture object associated with the texture in the GPU process that can be implemented in a platform-specific way. The returned handle is supposed to identify the stream endpoint. Connecting this to a producer is outside the scope of this change. * GLvoid glDestroyStreamTextureCHROMIUM(GLuint texture) Deletes the StreamTexture object associated with the texture and marks the texture as not special anymore. * BindTexture() will invoke method StreamTexture::Update() if the target is GL_TEXTURE_EXTERNAL_OES and the texture is marked as 'stream texture'. TEST=added unit tests Review URL: http://codereview.chromium.org/7754033 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@103191 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu/command_buffer/service/texture_manager_unittest.cc')
-rw-r--r--gpu/command_buffer/service/texture_manager_unittest.cc26
1 files changed, 13 insertions, 13 deletions
diff --git a/gpu/command_buffer/service/texture_manager_unittest.cc b/gpu/command_buffer/service/texture_manager_unittest.cc
index cf33e72..38d1969 100644
--- a/gpu/command_buffer/service/texture_manager_unittest.cc
+++ b/gpu/command_buffer/service/texture_manager_unittest.cc
@@ -338,7 +338,7 @@ TEST_F(TextureInfoTest, Basic) {
}
TEST_F(TextureInfoTest, POT2D) {
- manager_.SetInfoTarget(info_, GL_TEXTURE_2D);
+ manager_.SetInfoTarget(&feature_info_, info_, GL_TEXTURE_2D);
EXPECT_EQ(static_cast<GLenum>(GL_TEXTURE_2D), info_->target());
// Check Setting level 0 to POT
manager_.SetLevelInfo(&feature_info_, info_,
@@ -383,7 +383,7 @@ TEST_F(TextureInfoTest, POT2D) {
}
TEST_F(TextureInfoTest, UnusedMips) {
- manager_.SetInfoTarget(info_, GL_TEXTURE_2D);
+ manager_.SetInfoTarget(&feature_info_, info_, GL_TEXTURE_2D);
EXPECT_EQ(static_cast<GLenum>(GL_TEXTURE_2D), info_->target());
// Set level zero to large size.
manager_.SetLevelInfo(&feature_info_, info_,
@@ -411,7 +411,7 @@ TEST_F(TextureInfoTest, UnusedMips) {
}
TEST_F(TextureInfoTest, NPOT2D) {
- manager_.SetInfoTarget(info_, GL_TEXTURE_2D);
+ manager_.SetInfoTarget(&feature_info_, info_, GL_TEXTURE_2D);
EXPECT_EQ(static_cast<GLenum>(GL_TEXTURE_2D), info_->target());
// Check Setting level 0 to NPOT
manager_.SetLevelInfo(&feature_info_, info_,
@@ -452,7 +452,7 @@ TEST_F(TextureInfoTest, NPOT2DNPOTOK) {
TextureManager::TextureInfo* info = manager_.GetTextureInfo(kClient1Id);
ASSERT_TRUE(info_ != NULL);
- manager.SetInfoTarget(info, GL_TEXTURE_2D);
+ manager.SetInfoTarget(&feature_info_, info, GL_TEXTURE_2D);
EXPECT_EQ(static_cast<GLenum>(GL_TEXTURE_2D), info->target());
// Check Setting level 0 to NPOT
manager.SetLevelInfo(&feature_info, info,
@@ -470,7 +470,7 @@ TEST_F(TextureInfoTest, NPOT2DNPOTOK) {
}
TEST_F(TextureInfoTest, POTCubeMap) {
- manager_.SetInfoTarget(info_, GL_TEXTURE_CUBE_MAP);
+ manager_.SetInfoTarget(&feature_info_, info_, GL_TEXTURE_CUBE_MAP);
EXPECT_EQ(static_cast<GLenum>(GL_TEXTURE_CUBE_MAP), info_->target());
// Check Setting level 0 each face to POT
manager_.SetLevelInfo(&feature_info_, info_,
@@ -555,7 +555,7 @@ TEST_F(TextureInfoTest, POTCubeMap) {
}
TEST_F(TextureInfoTest, GetLevelSize) {
- manager_.SetInfoTarget(info_, GL_TEXTURE_2D);
+ manager_.SetInfoTarget(&feature_info_, info_, GL_TEXTURE_2D);
manager_.SetLevelInfo(&feature_info_, info_,
GL_TEXTURE_2D, 1, GL_RGBA, 4, 5, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE);
GLsizei width = -1;
@@ -571,7 +571,7 @@ TEST_F(TextureInfoTest, GetLevelSize) {
}
TEST_F(TextureInfoTest, GetLevelType) {
- manager_.SetInfoTarget(info_, GL_TEXTURE_2D);
+ manager_.SetInfoTarget(&feature_info_, info_, GL_TEXTURE_2D);
manager_.SetLevelInfo(&feature_info_, info_,
GL_TEXTURE_2D, 1, GL_RGBA, 4, 5, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE);
GLenum type = -1;
@@ -587,7 +587,7 @@ TEST_F(TextureInfoTest, GetLevelType) {
}
TEST_F(TextureInfoTest, ValidForTexture) {
- manager_.SetInfoTarget(info_, GL_TEXTURE_2D);
+ manager_.SetInfoTarget(&feature_info_, info_, GL_TEXTURE_2D);
manager_.SetLevelInfo(&feature_info_, info_,
GL_TEXTURE_2D, 1, GL_RGBA, 4, 5, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE);
// Check bad face.
@@ -641,7 +641,7 @@ TEST_F(TextureInfoTest, FloatNotLinear) {
manager.CreateTextureInfo(&feature_info, kClient1Id, kService1Id);
TextureManager::TextureInfo* info = manager_.GetTextureInfo(kClient1Id);
ASSERT_TRUE(info != NULL);
- manager.SetInfoTarget(info, GL_TEXTURE_2D);
+ manager.SetInfoTarget(&feature_info_, info, GL_TEXTURE_2D);
EXPECT_EQ(static_cast<GLenum>(GL_TEXTURE_2D), info->target());
manager.SetLevelInfo(&feature_info, info,
GL_TEXTURE_2D, 0, GL_RGBA, 1, 1, 1, 0, GL_RGBA, GL_FLOAT);
@@ -663,7 +663,7 @@ TEST_F(TextureInfoTest, FloatLinear) {
manager.CreateTextureInfo(&feature_info, kClient1Id, kService1Id);
TextureManager::TextureInfo* info = manager_.GetTextureInfo(kClient1Id);
ASSERT_TRUE(info != NULL);
- manager.SetInfoTarget(info, GL_TEXTURE_2D);
+ manager.SetInfoTarget(&feature_info_, info, GL_TEXTURE_2D);
EXPECT_EQ(static_cast<GLenum>(GL_TEXTURE_2D), info->target());
manager.SetLevelInfo(&feature_info, info,
GL_TEXTURE_2D, 0, GL_RGBA, 1, 1, 1, 0, GL_RGBA, GL_FLOAT);
@@ -680,7 +680,7 @@ TEST_F(TextureInfoTest, HalfFloatNotLinear) {
manager.CreateTextureInfo(&feature_info, kClient1Id, kService1Id);
TextureManager::TextureInfo* info = manager_.GetTextureInfo(kClient1Id);
ASSERT_TRUE(info != NULL);
- manager.SetInfoTarget(info, GL_TEXTURE_2D);
+ manager.SetInfoTarget(&feature_info_, info, GL_TEXTURE_2D);
EXPECT_EQ(static_cast<GLenum>(GL_TEXTURE_2D), info->target());
manager.SetLevelInfo(&feature_info, info,
GL_TEXTURE_2D, 0, GL_RGBA, 1, 1, 1, 0, GL_RGBA, GL_HALF_FLOAT_OES);
@@ -702,7 +702,7 @@ TEST_F(TextureInfoTest, HalfFloatLinear) {
manager.CreateTextureInfo(&feature_info, kClient1Id, kService1Id);
TextureManager::TextureInfo* info = manager_.GetTextureInfo(kClient1Id);
ASSERT_TRUE(info != NULL);
- manager.SetInfoTarget(info, GL_TEXTURE_2D);
+ manager.SetInfoTarget(&feature_info_, info, GL_TEXTURE_2D);
EXPECT_EQ(static_cast<GLenum>(GL_TEXTURE_2D), info->target());
manager.SetLevelInfo(&feature_info, info,
GL_TEXTURE_2D, 0, GL_RGBA, 1, 1, 1, 0, GL_RGBA, GL_HALF_FLOAT_OES);
@@ -719,7 +719,7 @@ TEST_F(TextureInfoTest, EGLImageExternal) {
manager.CreateTextureInfo(&feature_info, kClient1Id, kService1Id);
TextureManager::TextureInfo* info = manager_.GetTextureInfo(kClient1Id);
ASSERT_TRUE(info != NULL);
- manager.SetInfoTarget(info, GL_TEXTURE_EXTERNAL_OES);
+ manager.SetInfoTarget(&feature_info_, info, GL_TEXTURE_EXTERNAL_OES);
EXPECT_EQ(static_cast<GLenum>(GL_TEXTURE_EXTERNAL_OES), info->target());
EXPECT_FALSE(info->CanGenerateMipmaps(&feature_info));
manager.Destroy(false);