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

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

Issue 788123002: Add sampler related ES3 APIs to command buffer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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/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 017f36c1395a0a0c2d172d9509c2e163f8e46f94..0b0982871eb557d37d179a17f92e7051e1775f4d 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc
@@ -90,7 +90,8 @@ GLES2DecoderTestBase::GLES2DecoderTestBase()
client_framebuffer_id_(101),
client_program_id_(102),
client_renderbuffer_id_(103),
- client_shader_id_(104),
+ client_sampler_id_(104),
+ client_shader_id_(105),
client_texture_id_(106),
client_element_buffer_id_(107),
client_vertex_shader_id_(121),
@@ -413,6 +414,20 @@ void GLES2DecoderTestBase::InitDecoderWithCommandLine(
DoCreateProgram(client_program_id_, kServiceProgramId);
DoCreateShader(GL_VERTEX_SHADER, client_shader_id_, kServiceShaderId);
+ // Unsafe commands.
+ bool reset_unsafe_es3_apis_enabled = false;
+ if (!decoder_->unsafe_es3_apis_enabled()) {
+ decoder_->set_unsafe_es3_apis_enabled(true);
+ reset_unsafe_es3_apis_enabled = true;
+ }
+ EXPECT_CALL(*gl_, GenSamplers(_, _))
+ .WillOnce(SetArgumentPointee<1>(kServiceSamplerId))
+ .RetiresOnSaturation();
+ GenHelper<cmds::GenSamplersImmediate>(client_sampler_id_);
+ if (reset_unsafe_es3_apis_enabled) {
+ decoder_->set_unsafe_es3_apis_enabled(false);
+ }
+
EXPECT_EQ(GL_NO_ERROR, GetGLError());
}
@@ -1245,6 +1260,7 @@ const GLuint GLES2DecoderTestBase::kServiceFixedAttribBufferId;
const GLuint GLES2DecoderTestBase::kServiceBufferId;
const GLuint GLES2DecoderTestBase::kServiceFramebufferId;
const GLuint GLES2DecoderTestBase::kServiceRenderbufferId;
+const GLuint GLES2DecoderTestBase::kServiceSamplerId;
const GLuint GLES2DecoderTestBase::kServiceTextureId;
const GLuint GLES2DecoderTestBase::kServiceProgramId;
const GLuint GLES2DecoderTestBase::kServiceShaderId;

Powered by Google App Engine
This is Rietveld 408576698