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

Side by Side Diff: gpu/command_buffer/service/texture_manager_unittest.cc

Issue 10441087: Plum through ANGLE_depth_texture (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "gpu/command_buffer/service/texture_manager.h" 5 #include "gpu/command_buffer/service/texture_manager.h"
6 6
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "gpu/command_buffer/common/gl_mock.h" 8 #include "gpu/command_buffer/common/gl_mock.h"
9 #include "gpu/command_buffer/service/feature_info.h" 9 #include "gpu/command_buffer/service/feature_info.h"
10 #include "gpu/command_buffer/service/gles2_cmd_decoder_mock.h" 10 #include "gpu/command_buffer/service/gles2_cmd_decoder_mock.h"
(...skipping 749 matching lines...) Expand 10 before | Expand all | Expand 10 after
760 feature_info.get(), kMaxTextureSize, kMaxCubeMapTextureSize); 760 feature_info.get(), kMaxTextureSize, kMaxCubeMapTextureSize);
761 manager.CreateTextureInfo(kClient1Id, kService1Id); 761 manager.CreateTextureInfo(kClient1Id, kService1Id);
762 TextureManager::TextureInfo* info = manager.GetTextureInfo(kClient1Id); 762 TextureManager::TextureInfo* info = manager.GetTextureInfo(kClient1Id);
763 ASSERT_TRUE(info != NULL); 763 ASSERT_TRUE(info != NULL);
764 manager.SetInfoTarget(info, GL_TEXTURE_EXTERNAL_OES); 764 manager.SetInfoTarget(info, GL_TEXTURE_EXTERNAL_OES);
765 EXPECT_EQ(static_cast<GLenum>(GL_TEXTURE_EXTERNAL_OES), info->target()); 765 EXPECT_EQ(static_cast<GLenum>(GL_TEXTURE_EXTERNAL_OES), info->target());
766 EXPECT_FALSE(manager.CanGenerateMipmaps(info)); 766 EXPECT_FALSE(manager.CanGenerateMipmaps(info));
767 manager.Destroy(false); 767 manager.Destroy(false);
768 } 768 }
769 769
770 TEST_F(TextureInfoTest, DepthTexture) {
771 TestHelper::SetupFeatureInfoInitExpectations(
772 gl_.get(), "GL_ANGLE_depth_texture");
773 FeatureInfo::Ref feature_info(new FeatureInfo());
774 feature_info->Initialize(NULL);
775 TextureManager manager(
776 feature_info.get(), kMaxTextureSize, kMaxCubeMapTextureSize);
777 manager.CreateTextureInfo(kClient1Id, kService1Id);
778 TextureManager::TextureInfo* info = manager.GetTextureInfo(kClient1Id);
779 ASSERT_TRUE(info != NULL);
780 manager.SetInfoTarget(info, GL_TEXTURE_2D);
781 manager.SetLevelInfo(
782 info, GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT, 4, 4, 1, 0,
783 GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, false);
784 EXPECT_FALSE(manager.CanGenerateMipmaps(info));
785 manager.Destroy(false);
786 }
787
770 TEST_F(TextureInfoTest, SafeUnsafe) { 788 TEST_F(TextureInfoTest, SafeUnsafe) {
771 static const GLuint kClient2Id = 2; 789 static const GLuint kClient2Id = 2;
772 static const GLuint kService2Id = 12; 790 static const GLuint kService2Id = 12;
773 static const GLuint kClient3Id = 3; 791 static const GLuint kClient3Id = 3;
774 static const GLuint kService3Id = 13; 792 static const GLuint kService3Id = 13;
775 EXPECT_FALSE(manager_.HaveUnclearedMips()); 793 EXPECT_FALSE(manager_.HaveUnclearedMips());
776 EXPECT_EQ(0, info_->num_uncleared_mips()); 794 EXPECT_EQ(0, info_->num_uncleared_mips());
777 manager_.SetInfoTarget(info_, GL_TEXTURE_2D); 795 manager_.SetInfoTarget(info_, GL_TEXTURE_2D);
778 manager_.SetLevelInfo(info_, 796 manager_.SetLevelInfo(info_,
779 GL_TEXTURE_2D, 0, GL_RGBA, 4, 4, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, false); 797 GL_TEXTURE_2D, 0, GL_RGBA, 4, 4, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, false);
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
955 EXPECT_CALL(*gl_, DeleteTextures(1, ::testing::Pointee(kService2Id))) 973 EXPECT_CALL(*gl_, DeleteTextures(1, ::testing::Pointee(kService2Id)))
956 .Times(1) 974 .Times(1)
957 .RetiresOnSaturation(); 975 .RetiresOnSaturation();
958 info = NULL; 976 info = NULL;
959 } 977 }
960 978
961 } // namespace gles2 979 } // namespace gles2
962 } // namespace gpu 980 } // namespace gpu
963 981
964 982
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/texture_manager.cc ('k') | gpu/command_buffer/tests/gl_depth_texture_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698