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

Side by Side Diff: gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc

Issue 1135943002: Pull in various gpu/command_buffer fixes from chromium (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h" 5 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 bool use_default_textures = normalized_init.bind_generates_resource; 192 bool use_default_textures = normalized_init.bind_generates_resource;
193 193
194 InSequence sequence; 194 InSequence sequence;
195 195
196 surface_ = new gfx::GLSurfaceStub; 196 surface_ = new gfx::GLSurfaceStub;
197 surface_->SetSize(gfx::Size(kBackBufferWidth, kBackBufferHeight)); 197 surface_->SetSize(gfx::Size(kBackBufferWidth, kBackBufferHeight));
198 198
199 // Context needs to be created before initializing ContextGroup, which will 199 // Context needs to be created before initializing ContextGroup, which will
200 // in turn initialize FeatureInfo, which needs a context to determine 200 // in turn initialize FeatureInfo, which needs a context to determine
201 // extension support. 201 // extension support.
202 context_ = new gfx::GLContextStubWithExtensions; 202 context_ = new StrictMock<GLContextMock>();
203 context_->AddExtensionsString(normalized_init.extensions.c_str()); 203 context_->AddExtensionsString(normalized_init.extensions.c_str());
204 context_->SetGLVersionString(normalized_init.gl_version.c_str()); 204 context_->SetGLVersionString(normalized_init.gl_version.c_str());
205 205
206 context_->MakeCurrent(surface_.get()); 206 context_->GLContextStubWithExtensions::MakeCurrent(surface_.get());
207 gfx::GLSurface::InitializeDynamicMockBindingsForTests(context_.get()); 207 gfx::GLSurface::InitializeDynamicMockBindingsForTests(context_.get());
208 208
209 TestHelper::SetupContextGroupInitExpectations( 209 TestHelper::SetupContextGroupInitExpectations(
210 gl_.get(), 210 gl_.get(),
211 DisallowedFeatures(), 211 DisallowedFeatures(),
212 normalized_init.extensions.c_str(), 212 normalized_init.extensions.c_str(),
213 normalized_init.gl_version.c_str(), 213 normalized_init.gl_version.c_str(),
214 normalized_init.bind_generates_resource); 214 normalized_init.bind_generates_resource);
215 215
216 // We initialize the ContextGroup with a MockGLES2Decoder so that 216 // We initialize the ContextGroup with a MockGLES2Decoder so that
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
391 391
392 decoder_.reset(GLES2Decoder::Create(group_.get())); 392 decoder_.reset(GLES2Decoder::Create(group_.get()));
393 decoder_->SetIgnoreCachedStateForTest(ignore_cached_state_for_test_); 393 decoder_->SetIgnoreCachedStateForTest(ignore_cached_state_for_test_);
394 decoder_->GetLogger()->set_log_synthesized_gl_errors(false); 394 decoder_->GetLogger()->set_log_synthesized_gl_errors(false);
395 decoder_->Initialize(surface_, 395 decoder_->Initialize(surface_,
396 context_, 396 context_,
397 false, 397 false,
398 surface_->GetSize(), 398 surface_->GetSize(),
399 DisallowedFeatures(), 399 DisallowedFeatures(),
400 attribs); 400 attribs);
401 EXPECT_CALL(*context_, MakeCurrent(surface_.get())).WillOnce(Return(true));
402 if (context_->WasAllocatedUsingRobustnessExtension()) {
403 EXPECT_CALL(*gl_, GetGraphicsResetStatusARB())
404 .WillOnce(Return(GL_NO_ERROR));
405 }
401 decoder_->MakeCurrent(); 406 decoder_->MakeCurrent();
402 decoder_->set_engine(engine_.get()); 407 decoder_->set_engine(engine_.get());
403 decoder_->BeginDecoding(); 408 decoder_->BeginDecoding();
404 409
405 EXPECT_CALL(*gl_, GenBuffersARB(_, _)) 410 EXPECT_CALL(*gl_, GenBuffersARB(_, _))
406 .WillOnce(SetArgumentPointee<1>(kServiceBufferId)) 411 .WillOnce(SetArgumentPointee<1>(kServiceBufferId))
407 .RetiresOnSaturation(); 412 .RetiresOnSaturation();
408 GenHelper<cmds::GenBuffersImmediate>(client_buffer_id_); 413 GenHelper<cmds::GenBuffersImmediate>(client_buffer_id_);
409 EXPECT_CALL(*gl_, GenFramebuffersEXT(_, _)) 414 EXPECT_CALL(*gl_, GenFramebuffersEXT(_, _))
410 .WillOnce(SetArgumentPointee<1>(kServiceFramebufferId)) 415 .WillOnce(SetArgumentPointee<1>(kServiceFramebufferId))
(...skipping 1370 matching lines...) Expand 10 before | Expand all | Expand 10 after
1781 SetupDefaultProgram(); 1786 SetupDefaultProgram();
1782 } 1787 }
1783 1788
1784 // Include the auto-generated part of this file. We split this because it means 1789 // Include the auto-generated part of this file. We split this because it means
1785 // we can easily edit the non-auto generated parts right here in this file 1790 // we can easily edit the non-auto generated parts right here in this file
1786 // instead of having to edit some template or the code generator. 1791 // instead of having to edit some template or the code generator.
1787 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_0_autogen.h" 1792 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_0_autogen.h"
1788 1793
1789 } // namespace gles2 1794 } // namespace gles2
1790 } // namespace gpu 1795 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698