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

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

Issue 224763002: Remove default textures in (!bind_generates_resource) context groups. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
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 ae88a99d02647f2b54c4435b178ccd54a5778625..883897a00accd4cadb5e6572340ca622e42fd2c0 100644
--- a/gpu/command_buffer/service/texture_manager_unittest.cc
+++ b/gpu/command_buffer/service/texture_manager_unittest.cc
@@ -49,8 +49,7 @@ class TextureManagerTest : public testing::Test {
static const GLint kMaxExternalLevels = 1;
TextureManagerTest()
- : feature_info_(new FeatureInfo()) {
- }
+ : feature_info_(new FeatureInfo()), use_default_textures_(false) {}
virtual ~TextureManagerTest() {
}
@@ -63,7 +62,9 @@ class TextureManagerTest : public testing::Test {
manager_.reset(new TextureManager(
NULL, feature_info_.get(),
kMaxTextureSize, kMaxCubeMapTextureSize));
- TestHelper::SetupTextureManagerInitExpectations(gl_.get(), "");
+ TestHelper::SetupTextureManagerInitExpectations(
+ gl_.get(), "", use_default_textures_);
+ manager_->set_use_default_textures(use_default_textures_);
manager_->Initialize();
error_state_.reset(new ::testing::StrictMock<gles2::MockErrorState>());
}
@@ -87,6 +88,7 @@ class TextureManagerTest : public testing::Test {
scoped_refptr<FeatureInfo> feature_info_;
scoped_ptr<TextureManager> manager_;
scoped_ptr<MockErrorState> error_state_;
+ bool use_default_textures_;
piman 2014/04/04 02:50:28 Same here, is there anything that sets this?
vmiura 2014/04/04 18:32:57 Changed to kUseDefaultTextures.
};
// GCC requires these declarations, but MSVC requires they not be present
@@ -163,8 +165,9 @@ TEST_F(TextureManagerTest, SetParameter) {
}
TEST_F(TextureManagerTest, TextureUsageExt) {
- TestHelper::SetupTextureManagerInitExpectations(gl_.get(),
- "GL_ANGLE_texture_usage");
+ bool use_default_textures = false;
+ TestHelper::SetupTextureManagerInitExpectations(
+ gl_.get(), "GL_ANGLE_texture_usage", use_default_textures);
TextureManager manager(
NULL, feature_info_.get(), kMaxTextureSize, kMaxCubeMapTextureSize);
manager.Initialize();
@@ -186,7 +189,9 @@ TEST_F(TextureManagerTest, TextureUsageExt) {
TEST_F(TextureManagerTest, Destroy) {
const GLuint kClient1Id = 1;
const GLuint kService1Id = 11;
- TestHelper::SetupTextureManagerInitExpectations(gl_.get(), "");
+ bool use_default_textures = false;
+ TestHelper::SetupTextureManagerInitExpectations(
+ gl_.get(), "", use_default_textures);
TextureManager manager(
NULL, feature_info_.get(), kMaxTextureSize, kMaxCubeMapTextureSize);
manager.Initialize();
@@ -198,7 +203,8 @@ TEST_F(TextureManagerTest, Destroy) {
EXPECT_CALL(*gl_, DeleteTextures(1, ::testing::Pointee(kService1Id)))
.Times(1)
.RetiresOnSaturation();
- TestHelper::SetupTextureManagerDestructionExpectations(gl_.get(), "");
+ TestHelper::SetupTextureManagerDestructionExpectations(
+ gl_.get(), "", use_default_textures);
manager.Destroy(true);
// Check that resources got freed.
texture = manager.GetTexture(kClient1Id);
@@ -2127,8 +2133,7 @@ class CountingMemoryTracker : public MemoryTracker {
class SharedTextureTest : public testing::Test {
public:
SharedTextureTest()
- : feature_info_(new FeatureInfo()) {
- }
+ : feature_info_(new FeatureInfo()), use_default_textures_(false) {}
virtual ~SharedTextureTest() {
}
@@ -2149,9 +2154,13 @@ class SharedTextureTest : public testing::Test {
feature_info_.get(),
TextureManagerTest::kMaxTextureSize,
TextureManagerTest::kMaxCubeMapTextureSize));
- TestHelper::SetupTextureManagerInitExpectations(gl_.get(), "");
+ TestHelper::SetupTextureManagerInitExpectations(
+ gl_.get(), "", use_default_textures_);
+ texture_manager1_->set_use_default_textures(use_default_textures_);
texture_manager1_->Initialize();
- TestHelper::SetupTextureManagerInitExpectations(gl_.get(), "");
+ TestHelper::SetupTextureManagerInitExpectations(
+ gl_.get(), "", use_default_textures_);
+ texture_manager2_->set_use_default_textures(use_default_textures_);
texture_manager2_->Initialize();
}
@@ -2171,6 +2180,7 @@ class SharedTextureTest : public testing::Test {
scoped_ptr<TextureManager> texture_manager1_;
scoped_refptr<CountingMemoryTracker> memory_tracker2_;
scoped_ptr<TextureManager> texture_manager2_;
+ bool use_default_textures_;
};
TEST_F(SharedTextureTest, DeleteTextures) {

Powered by Google App Engine
This is Rietveld 408576698