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

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

Issue 1143393007: Teach GPU command buffer whether a context is webgl. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 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 b9fd068d8cb1e6f99a04143c4baddc11f56844ee..cfe01c520144741c38d7d849aa4b0347cbb21286 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc
@@ -157,7 +157,8 @@ GLES2DecoderTestBase::InitState::InitState()
request_stencil(false),
bind_generates_resource(false),
lose_context_when_out_of_memory(false),
- use_native_vao(true) {
+ use_native_vao(true),
+ webgl_version(0) {
}
void GLES2DecoderTestBase::InitDecoder(const InitState& init) {
@@ -227,10 +228,13 @@ void GLES2DecoderTestBase::InitDecoderWithCommandLine(
EXPECT_CALL(*mock_decoder_, DoCommands(_, _, _, _)).WillRepeatedly(
Invoke(mock_decoder_.get(), &MockGLES2Decoder::FakeDoCommands));
- EXPECT_TRUE(
- group_->Initialize(mock_decoder_.get(), DisallowedFeatures()));
- if (group_->feature_info()->IsES3Capable()) {
+ EXPECT_TRUE(group_->Initialize(
+ mock_decoder_.get(),
+ ContextGroup::GetContextType(init.webgl_version),
+ DisallowedFeatures()));
+
+ if (init.webgl_version == 2) {
EXPECT_CALL(*gl_, GetIntegerv(GL_MAX_COLOR_ATTACHMENTS, _))
.WillOnce(SetArgumentPointee<1>(kMaxColorAttachments))
.RetiresOnSaturation();
@@ -400,9 +404,7 @@ void GLES2DecoderTestBase::InitDecoderWithCommandLine(
shared_memory_base_ = buffer->memory();
static const int32 kLoseContextWhenOutOfMemory = 0x10002;
- static const int32 kES3ContextRequired = 0x10003;
-
- bool es3_context_required = group_->feature_info()->IsES3Capable();
+ static const int32 kWebGLVersion = 0x10003;
int32 attributes[] = {
EGL_ALPHA_SIZE,
@@ -413,8 +415,8 @@ void GLES2DecoderTestBase::InitDecoderWithCommandLine(
normalized_init.request_stencil ? 8 : 0,
kLoseContextWhenOutOfMemory,
normalized_init.lose_context_when_out_of_memory ? 1 : 0,
- kES3ContextRequired,
- es3_context_required ? 1 : 0
+ kWebGLVersion,
+ init.webgl_version
};
std::vector<int32> attribs(attributes, attributes + arraysize(attributes));

Powered by Google App Engine
This is Rietveld 408576698