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

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

Issue 895853003: Update from https://crrev.com/314320 (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 11 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/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 07d1eaf2a4945b372d030ae4a557880bcb7f42de..807d48853d7fbccbe7cbc92b8a95c819ebb4c670 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc
@@ -57,6 +57,7 @@ void NormalizeInitState(gpu::gles2::GLES2DecoderTestBase::InitState* init) {
break;
}
}
+
if (init->use_native_vao) {
if (contains_vao_extension)
return;
@@ -75,6 +76,10 @@ void NormalizeInitState(gpu::gles2::GLES2DecoderTestBase::InitState* init) {
// Make sure we don't set up an invalid InitState.
CHECK(!contains_vao_extension);
}
+
+ if (!init->extensions.empty())
+ init->extensions += " ";
+ init->extensions += "GL_EXT_framebuffer_object ";
}
} // namespace Anonymous
@@ -118,7 +123,9 @@ GLES2DecoderTestBase::~GLES2DecoderTestBase() {}
void GLES2DecoderTestBase::SetUp() {
InitState init;
- init.gl_version = "3.0";
+ // Autogenerated tests do not overwrite version or extension string,
+ // so we have to pick something that supports everything here.
+ init.gl_version = "4.4";
init.has_alpha = true;
init.has_depth = true;
init.request_alpha = true;
@@ -136,7 +143,9 @@ void GLES2DecoderTestBase::AddExpectationsForVertexAttribManager() {
}
GLES2DecoderTestBase::InitState::InitState()
- : has_alpha(false),
+ : extensions("GL_EXT_framebuffer_object"),
+ gl_version("2.1"),
+ has_alpha(false),
has_depth(false),
has_stencil(false),
request_alpha(false),
@@ -156,6 +165,9 @@ void GLES2DecoderTestBase::InitDecoderWithCommandLine(
const base::CommandLine* command_line) {
InitState normalized_init = init;
NormalizeInitState(&normalized_init);
+ // For easier substring/extension matching
+ DCHECK(normalized_init.extensions.empty() ||
+ *normalized_init.extensions.rbegin() == ' ');
Framebuffer::ClearFramebufferCompleteComboMap();
gfx::SetGLGetProcAddressProc(gfx::MockGLInterface::GetGLProcAddress);
@@ -166,9 +178,6 @@ void GLES2DecoderTestBase::InitDecoderWithCommandLine(
SetupMockGLBehaviors();
- // Only create stream texture manager if extension is requested.
- std::vector<std::string> list;
- base::SplitString(normalized_init.extensions, ' ', &list);
scoped_refptr<FeatureInfo> feature_info;
if (command_line)
feature_info = new FeatureInfo(*command_line);
@@ -423,15 +432,27 @@ void GLES2DecoderTestBase::InitDecoderWithCommandLine(
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_);
- EXPECT_CALL(*gl_, GenTransformFeedbacks(_, _))
- .WillOnce(SetArgumentPointee<1>(kServiceTransformFeedbackId))
- .RetiresOnSaturation();
- GenHelper<cmds::GenTransformFeedbacksImmediate>(client_transformfeedback_id_);
- DoFenceSync(client_sync_id_, kServiceSyncId);
+
+ const gfx::GLVersionInfo* version = context_->GetVersionInfo();
+ if (version->IsAtLeastGL(3, 3) || version->IsAtLeastGLES(3, 0)) {
+ EXPECT_CALL(*gl_, GenSamplers(_, _))
+ .WillOnce(SetArgumentPointee<1>(kServiceSamplerId))
+ .RetiresOnSaturation();
+ GenHelper<cmds::GenSamplersImmediate>(client_sampler_id_);
+ }
+ if (version->IsAtLeastGL(4, 0) || version->IsAtLeastGLES(3, 0)) {
+ EXPECT_CALL(*gl_, GenTransformFeedbacks(_, _))
+ .WillOnce(SetArgumentPointee<1>(kServiceTransformFeedbackId))
+ .RetiresOnSaturation();
+ GenHelper<cmds::GenTransformFeedbacksImmediate>(
+ client_transformfeedback_id_);
+ }
+
+ if (init.extensions.find("GL_ARB_sync ") != std::string::npos ||
+ version->IsAtLeastGL(3, 2) || version->IsAtLeastGLES(3, 0)) {
+ DoFenceSync(client_sync_id_, kServiceSyncId);
+ }
+
if (reset_unsafe_es3_apis_enabled) {
decoder_->set_unsafe_es3_apis_enabled(false);
}

Powered by Google App Engine
This is Rietveld 408576698