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

Unified Diff: gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.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: Use kBindGeneratesResource in context_group_unittest.cc. 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
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc ('k') | gpu/command_buffer/service/test_helper.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc
index 3e554f1d18317fd9bb4e21589fa579f0546a0dda..eb4eb9c593290171d8e964a5bfe43421e42dfde9 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc
@@ -116,6 +116,7 @@ void GLES2DecoderTestBase::InitDecoderWithCommandLine(
new ShaderTranslatorCache,
feature_info.get(),
init.bind_generates_resource));
+ bool use_default_textures = init.bind_generates_resource;
InSequence sequence;
@@ -135,7 +136,8 @@ void GLES2DecoderTestBase::InitDecoderWithCommandLine(
TestHelper::SetupContextGroupInitExpectations(gl_.get(),
DisallowedFeatures(),
init.extensions.c_str(),
- init.gl_version.c_str());
+ init.gl_version.c_str(),
+ init.bind_generates_resource);
// We initialize the ContextGroup with a MockGLES2Decoder so that
// we can use the ContextGroup to figure out how the real GLES2Decoder
@@ -182,25 +184,36 @@ void GLES2DecoderTestBase::InitDecoderWithCommandLine(
.Times(1)
.RetiresOnSaturation();
if (group_->feature_info()->feature_flags().oes_egl_image_external) {
- EXPECT_CALL(*gl_, BindTexture(
- GL_TEXTURE_EXTERNAL_OES,
- TestHelper::kServiceDefaultExternalTextureId))
+ EXPECT_CALL(*gl_,
+ BindTexture(GL_TEXTURE_EXTERNAL_OES,
+ use_default_textures
+ ? TestHelper::kServiceDefaultExternalTextureId
+ : 0))
.Times(1)
.RetiresOnSaturation();
}
if (group_->feature_info()->feature_flags().arb_texture_rectangle) {
- EXPECT_CALL(*gl_, BindTexture(
- GL_TEXTURE_RECTANGLE_ARB,
- TestHelper::kServiceDefaultRectangleTextureId))
+ EXPECT_CALL(
+ *gl_,
+ BindTexture(GL_TEXTURE_RECTANGLE_ARB,
+ use_default_textures
+ ? TestHelper::kServiceDefaultRectangleTextureId
+ : 0))
.Times(1)
.RetiresOnSaturation();
}
- EXPECT_CALL(*gl_, BindTexture(
- GL_TEXTURE_CUBE_MAP, TestHelper::kServiceDefaultTextureCubemapId))
+ EXPECT_CALL(*gl_,
+ BindTexture(GL_TEXTURE_CUBE_MAP,
+ use_default_textures
+ ? TestHelper::kServiceDefaultTextureCubemapId
+ : 0))
.Times(1)
.RetiresOnSaturation();
- EXPECT_CALL(*gl_, BindTexture(
- GL_TEXTURE_2D, TestHelper::kServiceDefaultTexture2dId))
+ EXPECT_CALL(
+ *gl_,
+ BindTexture(
+ GL_TEXTURE_2D,
+ use_default_textures ? TestHelper::kServiceDefaultTexture2dId : 0))
.Times(1)
.RetiresOnSaturation();
}
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc ('k') | gpu/command_buffer/service/test_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698