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

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

Issue 12326146: Refactor/Rename a bunch of GPU stuff (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 79
80 void GLES2DecoderTestBase::InitDecoder( 80 void GLES2DecoderTestBase::InitDecoder(
81 const char* extensions, 81 const char* extensions,
82 bool has_alpha, 82 bool has_alpha,
83 bool has_depth, 83 bool has_depth,
84 bool has_stencil, 84 bool has_stencil,
85 bool request_alpha, 85 bool request_alpha,
86 bool request_depth, 86 bool request_depth,
87 bool request_stencil, 87 bool request_stencil,
88 bool bind_generates_resource) { 88 bool bind_generates_resource) {
89 FramebufferManager::FramebufferInfo::ClearFramebufferCompleteComboMap(); 89 Framebuffer::ClearFramebufferCompleteComboMap();
90 gl_.reset(new StrictMock<MockGLInterface>()); 90 gl_.reset(new StrictMock<MockGLInterface>());
91 ::gfx::GLInterface::SetGLInterface(gl_.get()); 91 ::gfx::GLInterface::SetGLInterface(gl_.get());
92 group_ = ContextGroup::Ref(new ContextGroup(NULL, 92 group_ = scoped_refptr<ContextGroup>(new ContextGroup(
93 NULL, 93 NULL,
94 memory_tracker_, 94 NULL,
95 bind_generates_resource)); 95 memory_tracker_,
96 bind_generates_resource));
96 97
97 InSequence sequence; 98 InSequence sequence;
98 99
99 TestHelper::SetupContextGroupInitExpectations(gl_.get(), 100 TestHelper::SetupContextGroupInitExpectations(gl_.get(),
100 DisallowedFeatures(), extensions); 101 DisallowedFeatures(), extensions);
101 102
102 // We initialize the ContextGroup with a MockGLES2Decoder so that 103 // We initialize the ContextGroup with a MockGLES2Decoder so that
103 // we can use the ContextGroup to figure out how the real GLES2Decoder 104 // we can use the ContextGroup to figure out how the real GLES2Decoder
104 // will initialize itself. 105 // will initialize itself.
105 mock_decoder_.reset(new MockGLES2Decoder()); 106 mock_decoder_.reset(new MockGLES2Decoder());
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 decoder_->set_log_synthesized_gl_errors(false); 257 decoder_->set_log_synthesized_gl_errors(false);
257 decoder_->Initialize( 258 decoder_->Initialize(
258 surface_, context_, false, surface_->GetSize(), DisallowedFeatures(), 259 surface_, context_, false, surface_->GetSize(), DisallowedFeatures(),
259 NULL, attribs); 260 NULL, attribs);
260 decoder_->MakeCurrent(); 261 decoder_->MakeCurrent();
261 decoder_->set_engine(engine_.get()); 262 decoder_->set_engine(engine_.get());
262 263
263 EXPECT_CALL(*gl_, GenBuffersARB(_, _)) 264 EXPECT_CALL(*gl_, GenBuffersARB(_, _))
264 .WillOnce(SetArgumentPointee<1>(kServiceBufferId)) 265 .WillOnce(SetArgumentPointee<1>(kServiceBufferId))
265 .RetiresOnSaturation(); 266 .RetiresOnSaturation();
266 GenHelper<GenBuffersImmediate>(client_buffer_id_); 267 GenHelper<cmds::GenBuffersImmediate>(client_buffer_id_);
267 EXPECT_CALL(*gl_, GenFramebuffersEXT(_, _)) 268 EXPECT_CALL(*gl_, GenFramebuffersEXT(_, _))
268 .WillOnce(SetArgumentPointee<1>(kServiceFramebufferId)) 269 .WillOnce(SetArgumentPointee<1>(kServiceFramebufferId))
269 .RetiresOnSaturation(); 270 .RetiresOnSaturation();
270 GenHelper<GenFramebuffersImmediate>(client_framebuffer_id_); 271 GenHelper<cmds::GenFramebuffersImmediate>(client_framebuffer_id_);
271 EXPECT_CALL(*gl_, GenRenderbuffersEXT(_, _)) 272 EXPECT_CALL(*gl_, GenRenderbuffersEXT(_, _))
272 .WillOnce(SetArgumentPointee<1>(kServiceRenderbufferId)) 273 .WillOnce(SetArgumentPointee<1>(kServiceRenderbufferId))
273 .RetiresOnSaturation(); 274 .RetiresOnSaturation();
274 GenHelper<GenRenderbuffersImmediate>(client_renderbuffer_id_); 275 GenHelper<cmds::GenRenderbuffersImmediate>(client_renderbuffer_id_);
275 EXPECT_CALL(*gl_, GenTextures(_, _)) 276 EXPECT_CALL(*gl_, GenTextures(_, _))
276 .WillOnce(SetArgumentPointee<1>(kServiceTextureId)) 277 .WillOnce(SetArgumentPointee<1>(kServiceTextureId))
277 .RetiresOnSaturation(); 278 .RetiresOnSaturation();
278 GenHelper<GenTexturesImmediate>(client_texture_id_); 279 GenHelper<cmds::GenTexturesImmediate>(client_texture_id_);
279 EXPECT_CALL(*gl_, GenBuffersARB(_, _)) 280 EXPECT_CALL(*gl_, GenBuffersARB(_, _))
280 .WillOnce(SetArgumentPointee<1>(kServiceElementBufferId)) 281 .WillOnce(SetArgumentPointee<1>(kServiceElementBufferId))
281 .RetiresOnSaturation(); 282 .RetiresOnSaturation();
282 GenHelper<GenBuffersImmediate>(client_element_buffer_id_); 283 GenHelper<cmds::GenBuffersImmediate>(client_element_buffer_id_);
283 284
284 DoCreateProgram(client_program_id_, kServiceProgramId); 285 DoCreateProgram(client_program_id_, kServiceProgramId);
285 DoCreateShader(GL_VERTEX_SHADER, client_shader_id_, kServiceShaderId); 286 DoCreateShader(GL_VERTEX_SHADER, client_shader_id_, kServiceShaderId);
286 287
287 EXPECT_EQ(GL_NO_ERROR, GetGLError()); 288 EXPECT_EQ(GL_NO_ERROR, GetGLError());
288 } 289 }
289 290
290 void GLES2DecoderTestBase::TearDown() { 291 void GLES2DecoderTestBase::TearDown() {
291 // All Tests should have read all their GLErrors before getting here. 292 // All Tests should have read all their GLErrors before getting here.
292 EXPECT_EQ(GL_NO_ERROR, GetGLError()); 293 EXPECT_EQ(GL_NO_ERROR, GetGLError());
(...skipping 20 matching lines...) Expand all
313 .Times(1) 314 .Times(1)
314 .RetiresOnSaturation(); 315 .RetiresOnSaturation();
315 } 316 }
316 } 317 }
317 318
318 319
319 GLint GLES2DecoderTestBase::GetGLError() { 320 GLint GLES2DecoderTestBase::GetGLError() {
320 EXPECT_CALL(*gl_, GetError()) 321 EXPECT_CALL(*gl_, GetError())
321 .WillOnce(Return(GL_NO_ERROR)) 322 .WillOnce(Return(GL_NO_ERROR))
322 .RetiresOnSaturation(); 323 .RetiresOnSaturation();
323 GetError cmd; 324 cmds::GetError cmd;
324 cmd.Init(shared_memory_id_, shared_memory_offset_); 325 cmd.Init(shared_memory_id_, shared_memory_offset_);
325 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 326 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
326 return static_cast<GLint>(*GetSharedMemoryAs<GLenum*>()); 327 return static_cast<GLint>(*GetSharedMemoryAs<GLenum*>());
327 } 328 }
328 329
329 void GLES2DecoderTestBase::DoCreateShader( 330 void GLES2DecoderTestBase::DoCreateShader(
330 GLenum shader_type, GLuint client_id, GLuint service_id) { 331 GLenum shader_type, GLuint client_id, GLuint service_id) {
331 EXPECT_CALL(*gl_, CreateShader(shader_type)) 332 EXPECT_CALL(*gl_, CreateShader(shader_type))
332 .Times(1) 333 .Times(1)
333 .WillOnce(Return(service_id)) 334 .WillOnce(Return(service_id))
334 .RetiresOnSaturation(); 335 .RetiresOnSaturation();
335 CreateShader cmd; 336 cmds::CreateShader cmd;
336 cmd.Init(shader_type, client_id); 337 cmd.Init(shader_type, client_id);
337 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 338 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
338 } 339 }
339 340
340 bool GLES2DecoderTestBase::DoIsShader(GLuint client_id) { 341 bool GLES2DecoderTestBase::DoIsShader(GLuint client_id) {
341 return IsObjectHelper<IsShader, IsShader::Result>(client_id); 342 return IsObjectHelper<cmds::IsShader, cmds::IsShader::Result>(client_id);
342 } 343 }
343 344
344 void GLES2DecoderTestBase::DoDeleteShader( 345 void GLES2DecoderTestBase::DoDeleteShader(
345 GLuint client_id, GLuint service_id) { 346 GLuint client_id, GLuint service_id) {
346 EXPECT_CALL(*gl_, DeleteShader(service_id)) 347 EXPECT_CALL(*gl_, DeleteShader(service_id))
347 .Times(1) 348 .Times(1)
348 .RetiresOnSaturation(); 349 .RetiresOnSaturation();
349 DeleteShader cmd; 350 cmds::DeleteShader cmd;
350 cmd.Init(client_id); 351 cmd.Init(client_id);
351 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 352 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
352 } 353 }
353 354
354 void GLES2DecoderTestBase::DoCreateProgram( 355 void GLES2DecoderTestBase::DoCreateProgram(
355 GLuint client_id, GLuint service_id) { 356 GLuint client_id, GLuint service_id) {
356 EXPECT_CALL(*gl_, CreateProgram()) 357 EXPECT_CALL(*gl_, CreateProgram())
357 .Times(1) 358 .Times(1)
358 .WillOnce(Return(service_id)) 359 .WillOnce(Return(service_id))
359 .RetiresOnSaturation(); 360 .RetiresOnSaturation();
360 CreateProgram cmd; 361 cmds::CreateProgram cmd;
361 cmd.Init(client_id); 362 cmd.Init(client_id);
362 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 363 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
363 } 364 }
364 365
365 bool GLES2DecoderTestBase::DoIsProgram(GLuint client_id) { 366 bool GLES2DecoderTestBase::DoIsProgram(GLuint client_id) {
366 return IsObjectHelper<IsProgram, IsProgram::Result>(client_id); 367 return IsObjectHelper<cmds::IsProgram, cmds::IsProgram::Result>(client_id);
367 } 368 }
368 369
369 void GLES2DecoderTestBase::DoDeleteProgram( 370 void GLES2DecoderTestBase::DoDeleteProgram(
370 GLuint client_id, GLuint /* service_id */) { 371 GLuint client_id, GLuint /* service_id */) {
371 DeleteProgram cmd; 372 cmds::DeleteProgram cmd;
372 cmd.Init(client_id); 373 cmd.Init(client_id);
373 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 374 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
374 } 375 }
375 376
376 void GLES2DecoderTestBase::SetBucketAsCString( 377 void GLES2DecoderTestBase::SetBucketAsCString(
377 uint32 bucket_id, const char* str) { 378 uint32 bucket_id, const char* str) {
378 uint32 size = str ? (strlen(str) + 1) : 0; 379 uint32 size = str ? (strlen(str) + 1) : 0;
379 cmd::SetBucketSize cmd1; 380 cmd::SetBucketSize cmd1;
380 cmd1.Init(bucket_id, size); 381 cmd1.Init(bucket_id, size);
381 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd1)); 382 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd1));
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
544 const GLuint kClientFragmentShaderId = 5002; 545 const GLuint kClientFragmentShaderId = 5002;
545 const GLuint kServiceFragmentShaderId = 6002; 546 const GLuint kServiceFragmentShaderId = 6002;
546 SetupShader(attribs, arraysize(attribs), uniforms, arraysize(uniforms), 547 SetupShader(attribs, arraysize(attribs), uniforms, arraysize(uniforms),
547 client_program_id_, kServiceProgramId, 548 client_program_id_, kServiceProgramId,
548 kClientVertexShaderId, kServiceVertexShaderId, 549 kClientVertexShaderId, kServiceVertexShaderId,
549 kClientFragmentShaderId, kServiceFragmentShaderId); 550 kClientFragmentShaderId, kServiceFragmentShaderId);
550 551
551 EXPECT_CALL(*gl_, UseProgram(kServiceProgramId)) 552 EXPECT_CALL(*gl_, UseProgram(kServiceProgramId))
552 .Times(1) 553 .Times(1)
553 .RetiresOnSaturation(); 554 .RetiresOnSaturation();
554 UseProgram cmd; 555 cmds::UseProgram cmd;
555 cmd.Init(client_program_id_); 556 cmd.Init(client_program_id_);
556 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 557 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
557 } 558 }
558 559
559 void GLES2DecoderTestBase::DoBindBuffer( 560 void GLES2DecoderTestBase::DoBindBuffer(
560 GLenum target, GLuint client_id, GLuint service_id) { 561 GLenum target, GLuint client_id, GLuint service_id) {
561 EXPECT_CALL(*gl_, BindBuffer(target, service_id)) 562 EXPECT_CALL(*gl_, BindBuffer(target, service_id))
562 .Times(1) 563 .Times(1)
563 .RetiresOnSaturation(); 564 .RetiresOnSaturation();
564 BindBuffer cmd; 565 cmds::BindBuffer cmd;
565 cmd.Init(target, client_id); 566 cmd.Init(target, client_id);
566 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 567 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
567 } 568 }
568 569
569 bool GLES2DecoderTestBase::DoIsBuffer(GLuint client_id) { 570 bool GLES2DecoderTestBase::DoIsBuffer(GLuint client_id) {
570 return IsObjectHelper<IsBuffer, IsBuffer::Result>(client_id); 571 return IsObjectHelper<cmds::IsBuffer, cmds::IsBuffer::Result>(client_id);
571 } 572 }
572 573
573 void GLES2DecoderTestBase::DoDeleteBuffer( 574 void GLES2DecoderTestBase::DoDeleteBuffer(
574 GLuint client_id, GLuint service_id) { 575 GLuint client_id, GLuint service_id) {
575 EXPECT_CALL(*gl_, DeleteBuffersARB(1, Pointee(service_id))) 576 EXPECT_CALL(*gl_, DeleteBuffersARB(1, Pointee(service_id)))
576 .Times(1) 577 .Times(1)
577 .RetiresOnSaturation(); 578 .RetiresOnSaturation();
578 DeleteBuffers cmd; 579 cmds::DeleteBuffers cmd;
579 cmd.Init(1, shared_memory_id_, shared_memory_offset_); 580 cmd.Init(1, shared_memory_id_, shared_memory_offset_);
580 memcpy(shared_memory_address_, &client_id, sizeof(client_id)); 581 memcpy(shared_memory_address_, &client_id, sizeof(client_id));
581 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 582 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
582 } 583 }
583 584
584 void GLES2DecoderTestBase::SetupExpectationsForApplyingDirtyState( 585 void GLES2DecoderTestBase::SetupExpectationsForApplyingDirtyState(
585 bool framebuffer_is_rgb, 586 bool framebuffer_is_rgb,
586 bool framebuffer_has_depth, 587 bool framebuffer_has_depth,
587 bool framebuffer_has_stencil, 588 bool framebuffer_has_stencil,
588 GLuint color_bits, 589 GLuint color_bits,
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
671 false, // cull_face_enabled 672 false, // cull_face_enabled
672 false, // scissor_test_enabled 673 false, // scissor_test_enabled
673 false); // blend_enabled 674 false); // blend_enabled
674 } 675 }
675 676
676 void GLES2DecoderTestBase::DoBindFramebuffer( 677 void GLES2DecoderTestBase::DoBindFramebuffer(
677 GLenum target, GLuint client_id, GLuint service_id) { 678 GLenum target, GLuint client_id, GLuint service_id) {
678 EXPECT_CALL(*gl_, BindFramebufferEXT(target, service_id)) 679 EXPECT_CALL(*gl_, BindFramebufferEXT(target, service_id))
679 .Times(1) 680 .Times(1)
680 .RetiresOnSaturation(); 681 .RetiresOnSaturation();
681 BindFramebuffer cmd; 682 cmds::BindFramebuffer cmd;
682 cmd.Init(target, client_id); 683 cmd.Init(target, client_id);
683 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 684 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
684 } 685 }
685 686
686 bool GLES2DecoderTestBase::DoIsFramebuffer(GLuint client_id) { 687 bool GLES2DecoderTestBase::DoIsFramebuffer(GLuint client_id) {
687 return IsObjectHelper<IsFramebuffer, IsFramebuffer::Result>(client_id); 688 return IsObjectHelper<cmds::IsFramebuffer, cmds::IsFramebuffer::Result>(
689 client_id);
688 } 690 }
689 691
690 void GLES2DecoderTestBase::DoDeleteFramebuffer( 692 void GLES2DecoderTestBase::DoDeleteFramebuffer(
691 GLuint client_id, GLuint service_id, 693 GLuint client_id, GLuint service_id,
692 bool reset_draw, GLenum draw_target, GLuint draw_id, 694 bool reset_draw, GLenum draw_target, GLuint draw_id,
693 bool reset_read, GLenum read_target, GLuint read_id) { 695 bool reset_read, GLenum read_target, GLuint read_id) {
694 if (reset_draw) { 696 if (reset_draw) {
695 EXPECT_CALL(*gl_, BindFramebufferEXT(draw_target, draw_id)) 697 EXPECT_CALL(*gl_, BindFramebufferEXT(draw_target, draw_id))
696 .Times(1) 698 .Times(1)
697 .RetiresOnSaturation(); 699 .RetiresOnSaturation();
698 } 700 }
699 if (reset_read) { 701 if (reset_read) {
700 EXPECT_CALL(*gl_, BindFramebufferEXT(read_target, read_id)) 702 EXPECT_CALL(*gl_, BindFramebufferEXT(read_target, read_id))
701 .Times(1) 703 .Times(1)
702 .RetiresOnSaturation(); 704 .RetiresOnSaturation();
703 } 705 }
704 EXPECT_CALL(*gl_, DeleteFramebuffersEXT(1, Pointee(service_id))) 706 EXPECT_CALL(*gl_, DeleteFramebuffersEXT(1, Pointee(service_id)))
705 .Times(1) 707 .Times(1)
706 .RetiresOnSaturation(); 708 .RetiresOnSaturation();
707 DeleteFramebuffers cmd; 709 cmds::DeleteFramebuffers cmd;
708 cmd.Init(1, shared_memory_id_, shared_memory_offset_); 710 cmd.Init(1, shared_memory_id_, shared_memory_offset_);
709 memcpy(shared_memory_address_, &client_id, sizeof(client_id)); 711 memcpy(shared_memory_address_, &client_id, sizeof(client_id));
710 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 712 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
711 } 713 }
712 714
713 void GLES2DecoderTestBase::DoBindRenderbuffer( 715 void GLES2DecoderTestBase::DoBindRenderbuffer(
714 GLenum target, GLuint client_id, GLuint service_id) { 716 GLenum target, GLuint client_id, GLuint service_id) {
715 EXPECT_CALL(*gl_, BindRenderbufferEXT(target, service_id)) 717 EXPECT_CALL(*gl_, BindRenderbufferEXT(target, service_id))
716 .Times(1) 718 .Times(1)
717 .RetiresOnSaturation(); 719 .RetiresOnSaturation();
718 BindRenderbuffer cmd; 720 cmds::BindRenderbuffer cmd;
719 cmd.Init(target, client_id); 721 cmd.Init(target, client_id);
720 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 722 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
721 } 723 }
722 724
723 bool GLES2DecoderTestBase::DoIsRenderbuffer(GLuint client_id) { 725 bool GLES2DecoderTestBase::DoIsRenderbuffer(GLuint client_id) {
724 return IsObjectHelper<IsRenderbuffer, IsRenderbuffer::Result>(client_id); 726 return IsObjectHelper<cmds::IsRenderbuffer, cmds::IsRenderbuffer::Result>(
727 client_id);
725 } 728 }
726 729
727 void GLES2DecoderTestBase::DoDeleteRenderbuffer( 730 void GLES2DecoderTestBase::DoDeleteRenderbuffer(
728 GLuint client_id, GLuint service_id) { 731 GLuint client_id, GLuint service_id) {
729 EXPECT_CALL(*gl_, DeleteRenderbuffersEXT(1, Pointee(service_id))) 732 EXPECT_CALL(*gl_, DeleteRenderbuffersEXT(1, Pointee(service_id)))
730 .Times(1) 733 .Times(1)
731 .RetiresOnSaturation(); 734 .RetiresOnSaturation();
732 DeleteRenderbuffers cmd; 735 cmds::DeleteRenderbuffers cmd;
733 cmd.Init(1, shared_memory_id_, shared_memory_offset_); 736 cmd.Init(1, shared_memory_id_, shared_memory_offset_);
734 memcpy(shared_memory_address_, &client_id, sizeof(client_id)); 737 memcpy(shared_memory_address_, &client_id, sizeof(client_id));
735 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 738 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
736 } 739 }
737 740
738 void GLES2DecoderTestBase::DoBindTexture( 741 void GLES2DecoderTestBase::DoBindTexture(
739 GLenum target, GLuint client_id, GLuint service_id) { 742 GLenum target, GLuint client_id, GLuint service_id) {
740 EXPECT_CALL(*gl_, BindTexture(target, service_id)) 743 EXPECT_CALL(*gl_, BindTexture(target, service_id))
741 .Times(1) 744 .Times(1)
742 .RetiresOnSaturation(); 745 .RetiresOnSaturation();
743 BindTexture cmd; 746 cmds::BindTexture cmd;
744 cmd.Init(target, client_id); 747 cmd.Init(target, client_id);
745 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 748 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
746 } 749 }
747 750
748 bool GLES2DecoderTestBase::DoIsTexture(GLuint client_id) { 751 bool GLES2DecoderTestBase::DoIsTexture(GLuint client_id) {
749 return IsObjectHelper<IsTexture, IsTexture::Result>(client_id); 752 return IsObjectHelper<cmds::IsTexture, cmds::IsTexture::Result>(client_id);
750 } 753 }
751 754
752 void GLES2DecoderTestBase::DoDeleteTexture( 755 void GLES2DecoderTestBase::DoDeleteTexture(
753 GLuint client_id, GLuint service_id) { 756 GLuint client_id, GLuint service_id) {
754 EXPECT_CALL(*gl_, DeleteTextures(1, Pointee(service_id))) 757 EXPECT_CALL(*gl_, DeleteTextures(1, Pointee(service_id)))
755 .Times(1) 758 .Times(1)
756 .RetiresOnSaturation(); 759 .RetiresOnSaturation();
757 DeleteTextures cmd; 760 cmds::DeleteTextures cmd;
758 cmd.Init(1, shared_memory_id_, shared_memory_offset_); 761 cmd.Init(1, shared_memory_id_, shared_memory_offset_);
759 memcpy(shared_memory_address_, &client_id, sizeof(client_id)); 762 memcpy(shared_memory_address_, &client_id, sizeof(client_id));
760 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 763 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
761 } 764 }
762 765
763 void GLES2DecoderTestBase::DoTexImage2D( 766 void GLES2DecoderTestBase::DoTexImage2D(
764 GLenum target, GLint level, GLenum internal_format, 767 GLenum target, GLint level, GLenum internal_format,
765 GLsizei width, GLsizei height, GLint border, 768 GLsizei width, GLsizei height, GLint border,
766 GLenum format, GLenum type, 769 GLenum format, GLenum type,
767 uint32 shared_memory_id, uint32 shared_memory_offset) { 770 uint32 shared_memory_id, uint32 shared_memory_offset) {
768 EXPECT_CALL(*gl_, GetError()) 771 EXPECT_CALL(*gl_, GetError())
769 .WillOnce(Return(GL_NO_ERROR)) 772 .WillOnce(Return(GL_NO_ERROR))
770 .RetiresOnSaturation(); 773 .RetiresOnSaturation();
771 EXPECT_CALL(*gl_, TexImage2D(target, level, internal_format, 774 EXPECT_CALL(*gl_, TexImage2D(target, level, internal_format,
772 width, height, border, format, type, _)) 775 width, height, border, format, type, _))
773 .Times(1) 776 .Times(1)
774 .RetiresOnSaturation(); 777 .RetiresOnSaturation();
775 EXPECT_CALL(*gl_, GetError()) 778 EXPECT_CALL(*gl_, GetError())
776 .WillOnce(Return(GL_NO_ERROR)) 779 .WillOnce(Return(GL_NO_ERROR))
777 .RetiresOnSaturation(); 780 .RetiresOnSaturation();
778 TexImage2D cmd; 781 cmds::TexImage2D cmd;
779 cmd.Init(target, level, internal_format, width, height, border, format, 782 cmd.Init(target, level, internal_format, width, height, border, format,
780 type, shared_memory_id, shared_memory_offset); 783 type, shared_memory_id, shared_memory_offset);
781 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 784 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
782 } 785 }
783 786
784 void GLES2DecoderTestBase::DoCompressedTexImage2D( 787 void GLES2DecoderTestBase::DoCompressedTexImage2D(
785 GLenum target, GLint level, GLenum format, 788 GLenum target, GLint level, GLenum format,
786 GLsizei width, GLsizei height, GLint border, 789 GLsizei width, GLsizei height, GLint border,
787 GLsizei size, uint32 bucket_id) { 790 GLsizei size, uint32 bucket_id) {
788 EXPECT_CALL(*gl_, GetError()) 791 EXPECT_CALL(*gl_, GetError())
789 .WillOnce(Return(GL_NO_ERROR)) 792 .WillOnce(Return(GL_NO_ERROR))
790 .RetiresOnSaturation(); 793 .RetiresOnSaturation();
791 EXPECT_CALL(*gl_, CompressedTexImage2D( 794 EXPECT_CALL(*gl_, CompressedTexImage2D(
792 target, level, format, width, height, border, size, _)) 795 target, level, format, width, height, border, size, _))
793 .Times(1) 796 .Times(1)
794 .RetiresOnSaturation(); 797 .RetiresOnSaturation();
795 EXPECT_CALL(*gl_, GetError()) 798 EXPECT_CALL(*gl_, GetError())
796 .WillOnce(Return(GL_NO_ERROR)) 799 .WillOnce(Return(GL_NO_ERROR))
797 .RetiresOnSaturation(); 800 .RetiresOnSaturation();
798 CommonDecoder::Bucket* bucket = decoder_->CreateBucket(bucket_id); 801 CommonDecoder::Bucket* bucket = decoder_->CreateBucket(bucket_id);
799 bucket->SetSize(size); 802 bucket->SetSize(size);
800 CompressedTexImage2DBucket cmd; 803 cmds::CompressedTexImage2DBucket cmd;
801 cmd.Init( 804 cmd.Init(
802 target, level, format, width, height, border, 805 target, level, format, width, height, border,
803 bucket_id); 806 bucket_id);
804 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 807 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
805 } 808 }
806 809
807 void GLES2DecoderTestBase::DoTexImage2DSameSize( 810 void GLES2DecoderTestBase::DoTexImage2DSameSize(
808 GLenum target, GLint level, GLenum internal_format, 811 GLenum target, GLint level, GLenum internal_format,
809 GLsizei width, GLsizei height, GLint border, 812 GLsizei width, GLsizei height, GLint border,
810 GLenum format, GLenum type, 813 GLenum format, GLenum type,
811 uint32 shared_memory_id, uint32 shared_memory_offset) { 814 uint32 shared_memory_id, uint32 shared_memory_offset) {
812 if (GLES2Decoder::IsAngle()) { 815 if (GLES2Decoder::IsAngle()) {
813 EXPECT_CALL(*gl_, TexSubImage2D( 816 EXPECT_CALL(*gl_, TexSubImage2D(
814 target, level, 0, 0, width, height, format, type, _)) 817 target, level, 0, 0, width, height, format, type, _))
815 .Times(1) 818 .Times(1)
816 .RetiresOnSaturation(); 819 .RetiresOnSaturation();
817 } else { 820 } else {
818 EXPECT_CALL(*gl_, GetError()) 821 EXPECT_CALL(*gl_, GetError())
819 .WillOnce(Return(GL_NO_ERROR)) 822 .WillOnce(Return(GL_NO_ERROR))
820 .RetiresOnSaturation(); 823 .RetiresOnSaturation();
821 EXPECT_CALL(*gl_, TexImage2D(target, level, internal_format, 824 EXPECT_CALL(*gl_, TexImage2D(target, level, internal_format,
822 width, height, border, format, type, _)) 825 width, height, border, format, type, _))
823 .Times(1) 826 .Times(1)
824 .RetiresOnSaturation(); 827 .RetiresOnSaturation();
825 EXPECT_CALL(*gl_, GetError()) 828 EXPECT_CALL(*gl_, GetError())
826 .WillOnce(Return(GL_NO_ERROR)) 829 .WillOnce(Return(GL_NO_ERROR))
827 .RetiresOnSaturation(); 830 .RetiresOnSaturation();
828 } 831 }
829 TexImage2D cmd; 832 cmds::TexImage2D cmd;
830 cmd.Init(target, level, internal_format, width, height, border, format, 833 cmd.Init(target, level, internal_format, width, height, border, format,
831 type, shared_memory_id, shared_memory_offset); 834 type, shared_memory_id, shared_memory_offset);
832 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 835 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
833 } 836 }
834 837
835 void GLES2DecoderTestBase::DoRenderbufferStorage( 838 void GLES2DecoderTestBase::DoRenderbufferStorage(
836 GLenum target, GLenum internal_format, GLenum actual_format, 839 GLenum target, GLenum internal_format, GLenum actual_format,
837 GLsizei width, GLsizei height, GLenum error) { 840 GLsizei width, GLsizei height, GLenum error) {
838 EXPECT_CALL(*gl_, GetError()) 841 EXPECT_CALL(*gl_, GetError())
839 .WillOnce(Return(GL_NO_ERROR)) 842 .WillOnce(Return(GL_NO_ERROR))
840 .RetiresOnSaturation(); 843 .RetiresOnSaturation();
841 EXPECT_CALL(*gl_, RenderbufferStorageEXT( 844 EXPECT_CALL(*gl_, RenderbufferStorageEXT(
842 target, actual_format, width, height)) 845 target, actual_format, width, height))
843 .Times(1) 846 .Times(1)
844 .RetiresOnSaturation(); 847 .RetiresOnSaturation();
845 EXPECT_CALL(*gl_, GetError()) 848 EXPECT_CALL(*gl_, GetError())
846 .WillOnce(Return(error)) 849 .WillOnce(Return(error))
847 .RetiresOnSaturation(); 850 .RetiresOnSaturation();
848 RenderbufferStorage cmd; 851 cmds::RenderbufferStorage cmd;
849 cmd.Init(target, internal_format, width, height); 852 cmd.Init(target, internal_format, width, height);
850 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 853 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
851 } 854 }
852 855
853 void GLES2DecoderTestBase::DoFramebufferTexture2D( 856 void GLES2DecoderTestBase::DoFramebufferTexture2D(
854 GLenum target, GLenum attachment, GLenum textarget, 857 GLenum target, GLenum attachment, GLenum textarget,
855 GLuint texture_client_id, GLuint texture_service_id, GLint level, 858 GLuint texture_client_id, GLuint texture_service_id, GLint level,
856 GLenum error) { 859 GLenum error) {
857 EXPECT_CALL(*gl_, GetError()) 860 EXPECT_CALL(*gl_, GetError())
858 .WillOnce(Return(GL_NO_ERROR)) 861 .WillOnce(Return(GL_NO_ERROR))
859 .RetiresOnSaturation(); 862 .RetiresOnSaturation();
860 EXPECT_CALL(*gl_, FramebufferTexture2DEXT( 863 EXPECT_CALL(*gl_, FramebufferTexture2DEXT(
861 target, attachment, textarget, texture_service_id, level)) 864 target, attachment, textarget, texture_service_id, level))
862 .Times(1) 865 .Times(1)
863 .RetiresOnSaturation(); 866 .RetiresOnSaturation();
864 EXPECT_CALL(*gl_, GetError()) 867 EXPECT_CALL(*gl_, GetError())
865 .WillOnce(Return(error)) 868 .WillOnce(Return(error))
866 .RetiresOnSaturation(); 869 .RetiresOnSaturation();
867 FramebufferTexture2D cmd; 870 cmds::FramebufferTexture2D cmd;
868 cmd.Init(target, attachment, textarget, texture_client_id, level); 871 cmd.Init(target, attachment, textarget, texture_client_id, level);
869 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 872 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
870 } 873 }
871 874
872 void GLES2DecoderTestBase::DoFramebufferRenderbuffer( 875 void GLES2DecoderTestBase::DoFramebufferRenderbuffer(
873 GLenum target, 876 GLenum target,
874 GLenum attachment, 877 GLenum attachment,
875 GLenum renderbuffer_target, 878 GLenum renderbuffer_target,
876 GLuint renderbuffer_client_id, 879 GLuint renderbuffer_client_id,
877 GLuint renderbuffer_service_id, 880 GLuint renderbuffer_service_id,
878 GLenum error) { 881 GLenum error) {
879 EXPECT_CALL(*gl_, GetError()) 882 EXPECT_CALL(*gl_, GetError())
880 .WillOnce(Return(GL_NO_ERROR)) 883 .WillOnce(Return(GL_NO_ERROR))
881 .RetiresOnSaturation(); 884 .RetiresOnSaturation();
882 EXPECT_CALL(*gl_, FramebufferRenderbufferEXT( 885 EXPECT_CALL(*gl_, FramebufferRenderbufferEXT(
883 target, attachment, renderbuffer_target, renderbuffer_service_id)) 886 target, attachment, renderbuffer_target, renderbuffer_service_id))
884 .Times(1) 887 .Times(1)
885 .RetiresOnSaturation(); 888 .RetiresOnSaturation();
886 EXPECT_CALL(*gl_, GetError()) 889 EXPECT_CALL(*gl_, GetError())
887 .WillOnce(Return(error)) 890 .WillOnce(Return(error))
888 .RetiresOnSaturation(); 891 .RetiresOnSaturation();
889 FramebufferRenderbuffer cmd; 892 cmds::FramebufferRenderbuffer cmd;
890 cmd.Init(target, attachment, renderbuffer_target, renderbuffer_client_id); 893 cmd.Init(target, attachment, renderbuffer_target, renderbuffer_client_id);
891 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 894 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
892 } 895 }
893 896
894 void GLES2DecoderTestBase::DoVertexAttribPointer( 897 void GLES2DecoderTestBase::DoVertexAttribPointer(
895 GLuint index, GLint size, GLenum type, GLsizei stride, GLuint offset) { 898 GLuint index, GLint size, GLenum type, GLsizei stride, GLuint offset) {
896 EXPECT_CALL(*gl_, 899 EXPECT_CALL(*gl_,
897 VertexAttribPointer(index, size, type, GL_FALSE, stride, 900 VertexAttribPointer(index, size, type, GL_FALSE, stride,
898 BufferOffset(offset))) 901 BufferOffset(offset)))
899 .Times(1) 902 .Times(1)
900 .RetiresOnSaturation(); 903 .RetiresOnSaturation();
901 VertexAttribPointer cmd; 904 cmds::VertexAttribPointer cmd;
902 cmd.Init(index, size, GL_FLOAT, GL_FALSE, stride, offset); 905 cmd.Init(index, size, GL_FLOAT, GL_FALSE, stride, offset);
903 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 906 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
904 } 907 }
905 908
906 void GLES2DecoderTestBase::DoVertexAttribDivisorANGLE( 909 void GLES2DecoderTestBase::DoVertexAttribDivisorANGLE(
907 GLuint index, GLuint divisor) { 910 GLuint index, GLuint divisor) {
908 EXPECT_CALL(*gl_, 911 EXPECT_CALL(*gl_,
909 VertexAttribDivisorANGLE(index, divisor)) 912 VertexAttribDivisorANGLE(index, divisor))
910 .Times(1) 913 .Times(1)
911 .RetiresOnSaturation(); 914 .RetiresOnSaturation();
912 VertexAttribDivisorANGLE cmd; 915 cmds::VertexAttribDivisorANGLE cmd;
913 cmd.Init(index, divisor); 916 cmd.Init(index, divisor);
914 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 917 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
915 } 918 }
916 919
917 void GLES2DecoderTestBase::AddExpectationsForGenVertexArraysOES(){ 920 void GLES2DecoderTestBase::AddExpectationsForGenVertexArraysOES(){
918 if (group_->feature_info()->feature_flags().native_vertex_array_object) { 921 if (group_->feature_info()->feature_flags().native_vertex_array_object) {
919 EXPECT_CALL(*gl_, GenVertexArraysOES(1, _)) 922 EXPECT_CALL(*gl_, GenVertexArraysOES(1, _))
920 .WillOnce(SetArgumentPointee<1>(kServiceVertexArrayId)) 923 .WillOnce(SetArgumentPointee<1>(kServiceVertexArrayId))
921 .RetiresOnSaturation(); 924 .RetiresOnSaturation();
922 } 925 }
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
1111 SetupShader(attribs, arraysize(attribs), uniforms, arraysize(uniforms), 1114 SetupShader(attribs, arraysize(attribs), uniforms, arraysize(uniforms),
1112 client_program_id_, kServiceProgramId, 1115 client_program_id_, kServiceProgramId,
1113 client_vertex_shader_id_, kServiceVertexShaderId, 1116 client_vertex_shader_id_, kServiceVertexShaderId,
1114 client_fragment_shader_id_, kServiceFragmentShaderId); 1117 client_fragment_shader_id_, kServiceFragmentShaderId);
1115 } 1118 }
1116 1119
1117 { 1120 {
1118 EXPECT_CALL(*gl_, UseProgram(kServiceProgramId)) 1121 EXPECT_CALL(*gl_, UseProgram(kServiceProgramId))
1119 .Times(1) 1122 .Times(1)
1120 .RetiresOnSaturation(); 1123 .RetiresOnSaturation();
1121 UseProgram cmd; 1124 cmds::UseProgram cmd;
1122 cmd.Init(client_program_id_); 1125 cmd.Init(client_program_id_);
1123 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 1126 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
1124 } 1127 }
1125 } 1128 }
1126 1129
1127 void GLES2DecoderTestBase::SetupCubemapProgram() { 1130 void GLES2DecoderTestBase::SetupCubemapProgram() {
1128 { 1131 {
1129 static AttribInfo attribs[] = { 1132 static AttribInfo attribs[] = {
1130 { kAttrib1Name, kAttrib1Size, kAttrib1Type, kAttrib1Location, }, 1133 { kAttrib1Name, kAttrib1Size, kAttrib1Type, kAttrib1Location, },
1131 { kAttrib2Name, kAttrib2Size, kAttrib2Type, kAttrib2Location, }, 1134 { kAttrib2Name, kAttrib2Size, kAttrib2Type, kAttrib2Location, },
(...skipping 13 matching lines...) Expand all
1145 SetupShader(attribs, arraysize(attribs), uniforms, arraysize(uniforms), 1148 SetupShader(attribs, arraysize(attribs), uniforms, arraysize(uniforms),
1146 client_program_id_, kServiceProgramId, 1149 client_program_id_, kServiceProgramId,
1147 client_vertex_shader_id_, kServiceVertexShaderId, 1150 client_vertex_shader_id_, kServiceVertexShaderId,
1148 client_fragment_shader_id_, kServiceFragmentShaderId); 1151 client_fragment_shader_id_, kServiceFragmentShaderId);
1149 } 1152 }
1150 1153
1151 { 1154 {
1152 EXPECT_CALL(*gl_, UseProgram(kServiceProgramId)) 1155 EXPECT_CALL(*gl_, UseProgram(kServiceProgramId))
1153 .Times(1) 1156 .Times(1)
1154 .RetiresOnSaturation(); 1157 .RetiresOnSaturation();
1155 UseProgram cmd; 1158 cmds::UseProgram cmd;
1156 cmd.Init(client_program_id_); 1159 cmd.Init(client_program_id_);
1157 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 1160 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
1158 } 1161 }
1159 } 1162 }
1160 1163
1161 void GLES2DecoderWithShaderTestBase::TearDown() { 1164 void GLES2DecoderWithShaderTestBase::TearDown() {
1162 GLES2DecoderTestBase::TearDown(); 1165 GLES2DecoderTestBase::TearDown();
1163 } 1166 }
1164 1167
1165 void GLES2DecoderTestBase::SetupShader( 1168 void GLES2DecoderTestBase::SetupShader(
(...skipping 17 matching lines...) Expand all
1183 gl_.get(), attribs, num_attribs, uniforms, num_uniforms, 1186 gl_.get(), attribs, num_attribs, uniforms, num_uniforms,
1184 program_service_id); 1187 program_service_id);
1185 } 1188 }
1186 1189
1187 DoCreateShader( 1190 DoCreateShader(
1188 GL_VERTEX_SHADER, vertex_shader_client_id, vertex_shader_service_id); 1191 GL_VERTEX_SHADER, vertex_shader_client_id, vertex_shader_service_id);
1189 DoCreateShader( 1192 DoCreateShader(
1190 GL_FRAGMENT_SHADER, fragment_shader_client_id, 1193 GL_FRAGMENT_SHADER, fragment_shader_client_id,
1191 fragment_shader_service_id); 1194 fragment_shader_service_id);
1192 1195
1193 GetShaderInfo(vertex_shader_client_id)->SetStatus(true, "", NULL); 1196 GetShader(vertex_shader_client_id)->SetStatus(true, "", NULL);
1194 GetShaderInfo(fragment_shader_client_id)->SetStatus(true, "", NULL); 1197 GetShader(fragment_shader_client_id)->SetStatus(true, "", NULL);
1195 1198
1196 AttachShader attach_cmd; 1199 cmds::AttachShader attach_cmd;
1197 attach_cmd.Init(program_client_id, vertex_shader_client_id); 1200 attach_cmd.Init(program_client_id, vertex_shader_client_id);
1198 EXPECT_EQ(error::kNoError, ExecuteCmd(attach_cmd)); 1201 EXPECT_EQ(error::kNoError, ExecuteCmd(attach_cmd));
1199 1202
1200 attach_cmd.Init(program_client_id, fragment_shader_client_id); 1203 attach_cmd.Init(program_client_id, fragment_shader_client_id);
1201 EXPECT_EQ(error::kNoError, ExecuteCmd(attach_cmd)); 1204 EXPECT_EQ(error::kNoError, ExecuteCmd(attach_cmd));
1202 1205
1203 LinkProgram link_cmd; 1206 cmds::LinkProgram link_cmd;
1204 link_cmd.Init(program_client_id); 1207 link_cmd.Init(program_client_id);
1205 1208
1206 EXPECT_EQ(error::kNoError, ExecuteCmd(link_cmd)); 1209 EXPECT_EQ(error::kNoError, ExecuteCmd(link_cmd));
1207 1210
1208 // Assume the next command will be UseProgram. 1211 // Assume the next command will be UseProgram.
1209 SetupExpectationsForClearingUniforms(uniforms, num_uniforms); 1212 SetupExpectationsForClearingUniforms(uniforms, num_uniforms);
1210 } 1213 }
1211 1214
1212 void GLES2DecoderTestBase::DoEnableVertexAttribArray(GLint index) { 1215 void GLES2DecoderTestBase::DoEnableVertexAttribArray(GLint index) {
1213 EXPECT_CALL(*gl_, EnableVertexAttribArray(index)) 1216 EXPECT_CALL(*gl_, EnableVertexAttribArray(index))
1214 .Times(1) 1217 .Times(1)
1215 .RetiresOnSaturation(); 1218 .RetiresOnSaturation();
1216 EnableVertexAttribArray cmd; 1219 cmds::EnableVertexAttribArray cmd;
1217 cmd.Init(index); 1220 cmd.Init(index);
1218 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 1221 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
1219 } 1222 }
1220 1223
1221 void GLES2DecoderTestBase::DoBufferData(GLenum target, GLsizei size) { 1224 void GLES2DecoderTestBase::DoBufferData(GLenum target, GLsizei size) {
1222 EXPECT_CALL(*gl_, GetError()) 1225 EXPECT_CALL(*gl_, GetError())
1223 .WillOnce(Return(GL_NO_ERROR)) 1226 .WillOnce(Return(GL_NO_ERROR))
1224 .RetiresOnSaturation(); 1227 .RetiresOnSaturation();
1225 EXPECT_CALL(*gl_, BufferData(target, size, _, GL_STREAM_DRAW)) 1228 EXPECT_CALL(*gl_, BufferData(target, size, _, GL_STREAM_DRAW))
1226 .Times(1) 1229 .Times(1)
1227 .RetiresOnSaturation(); 1230 .RetiresOnSaturation();
1228 EXPECT_CALL(*gl_, GetError()) 1231 EXPECT_CALL(*gl_, GetError())
1229 .WillOnce(Return(GL_NO_ERROR)) 1232 .WillOnce(Return(GL_NO_ERROR))
1230 .RetiresOnSaturation(); 1233 .RetiresOnSaturation();
1231 BufferData cmd; 1234 cmds::BufferData cmd;
1232 cmd.Init(target, size, 0, 0, GL_STREAM_DRAW); 1235 cmd.Init(target, size, 0, 0, GL_STREAM_DRAW);
1233 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 1236 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
1234 } 1237 }
1235 1238
1236 void GLES2DecoderTestBase::DoBufferSubData( 1239 void GLES2DecoderTestBase::DoBufferSubData(
1237 GLenum target, GLint offset, GLsizei size, const void* data) { 1240 GLenum target, GLint offset, GLsizei size, const void* data) {
1238 EXPECT_CALL(*gl_, BufferSubData(target, offset, size, 1241 EXPECT_CALL(*gl_, BufferSubData(target, offset, size,
1239 shared_memory_address_)) 1242 shared_memory_address_))
1240 .Times(1) 1243 .Times(1)
1241 .RetiresOnSaturation(); 1244 .RetiresOnSaturation();
1242 memcpy(shared_memory_address_, data, size); 1245 memcpy(shared_memory_address_, data, size);
1243 BufferSubData cmd; 1246 cmds::BufferSubData cmd;
1244 cmd.Init(target, offset, size, shared_memory_id_, shared_memory_offset_); 1247 cmd.Init(target, offset, size, shared_memory_id_, shared_memory_offset_);
1245 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 1248 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
1246 } 1249 }
1247 1250
1248 void GLES2DecoderTestBase::SetupVertexBuffer() { 1251 void GLES2DecoderTestBase::SetupVertexBuffer() {
1249 DoEnableVertexAttribArray(1); 1252 DoEnableVertexAttribArray(1);
1250 DoBindBuffer(GL_ARRAY_BUFFER, client_buffer_id_, kServiceBufferId); 1253 DoBindBuffer(GL_ARRAY_BUFFER, client_buffer_id_, kServiceBufferId);
1251 GLfloat f = 0; 1254 GLfloat f = 0;
1252 DoBufferData(GL_ARRAY_BUFFER, kNumVertices * 2 * sizeof(f)); 1255 DoBufferData(GL_ARRAY_BUFFER, kNumVertices * 2 * sizeof(f));
1253 } 1256 }
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
1376 SetupDefaultProgram(); 1379 SetupDefaultProgram();
1377 } 1380 }
1378 1381
1379 // Include the auto-generated part of this file. We split this because it means 1382 // Include the auto-generated part of this file. We split this because it means
1380 // we can easily edit the non-auto generated parts right here in this file 1383 // we can easily edit the non-auto generated parts right here in this file
1381 // instead of having to edit some template or the code generator. 1384 // instead of having to edit some template or the code generator.
1382 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_0_autogen.h" 1385 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_0_autogen.h"
1383 1386
1384 } // namespace gles2 1387 } // namespace gles2
1385 } // namespace gpu 1388 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h ('k') | gpu/command_buffer/service/memory_program_cache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698