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

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

Issue 245923008: Optimize GLES2DecoderImpl::ApplyDirtyState. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase on refactored gles2_cmd_decoder_unittest.cc Created 6 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.h" 5 #include "gpu/command_buffer/service/gles2_cmd_decoder.h"
6 6
7 #include "gpu/command_buffer/common/gles2_cmd_format.h" 7 #include "gpu/command_buffer/common/gles2_cmd_format.h"
8 #include "gpu/command_buffer/common/gles2_cmd_utils.h" 8 #include "gpu/command_buffer/common/gles2_cmd_utils.h"
9 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h" 9 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h"
10 #include "gpu/command_buffer/service/cmd_buffer_engine.h" 10 #include "gpu/command_buffer/service/cmd_buffer_engine.h"
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 valid_uniform = accepts_apis & Program::kUniformMatrix4f; 218 valid_uniform = accepts_apis & Program::kUniformMatrix4f;
219 cmds::UniformMatrix4fv cmd; 219 cmds::UniformMatrix4fv cmd;
220 cmd.Init(1, 2, false, shared_memory_id_, shared_memory_offset_); 220 cmd.Init(1, 2, false, shared_memory_id_, shared_memory_offset_);
221 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 221 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
222 EXPECT_EQ(valid_uniform ? GL_NO_ERROR : GL_INVALID_OPERATION, 222 EXPECT_EQ(valid_uniform ? GL_NO_ERROR : GL_INVALID_OPERATION,
223 GetGLError()); 223 GetGLError());
224 } 224 }
225 } 225 }
226 }; 226 };
227 227
228 INSTANTIATE_TEST_CASE_P(Service, GLES2DecoderTest2, ::testing::Bool());
229
228 template <> 230 template <>
229 void GLES2DecoderTestBase::SpecializedSetup<cmds::GenQueriesEXT, 0>( 231 void GLES2DecoderTestBase::SpecializedSetup<cmds::GenQueriesEXT, 0>(
230 bool valid) { 232 bool valid) {
231 if (!valid) { 233 if (!valid) {
232 // Make the client_query_id_ so that trying to make it again 234 // Make the client_query_id_ so that trying to make it again
233 // will fail. 235 // will fail.
234 GetSharedMemoryAs<GLuint*>()[0] = client_query_id_; 236 GetSharedMemoryAs<GLuint*>()[0] = client_query_id_;
235 cmds::GenQueriesEXT cmd; 237 cmds::GenQueriesEXT cmd;
236 cmd.Init(1, shared_memory_id_, shared_memory_offset_); 238 cmd.Init(1, shared_memory_id_, shared_memory_offset_);
237 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 239 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
585 }; 587 };
586 588
587 template <> 589 template <>
588 void GLES2DecoderTestBase::SpecializedSetup<cmds::TexParameterivImmediate, 0>( 590 void GLES2DecoderTestBase::SpecializedSetup<cmds::TexParameterivImmediate, 0>(
589 bool /* valid */) { 591 bool /* valid */) {
590 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); 592 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId);
591 }; 593 };
592 594
593 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_2_autogen.h" 595 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_2_autogen.h"
594 596
595 TEST_F(GLES2DecoderTest2, AcceptsUniform_GL_INT) { 597 TEST_P(GLES2DecoderTest2, AcceptsUniform_GL_INT) {
596 TestAcceptedUniform(GL_INT, Program::kUniform1i); 598 TestAcceptedUniform(GL_INT, Program::kUniform1i);
597 } 599 }
598 600
599 TEST_F(GLES2DecoderTest2, AcceptsUniform_GL_INT_VEC2) { 601 TEST_P(GLES2DecoderTest2, AcceptsUniform_GL_INT_VEC2) {
600 TestAcceptedUniform(GL_INT_VEC2, Program::kUniform2i); 602 TestAcceptedUniform(GL_INT_VEC2, Program::kUniform2i);
601 } 603 }
602 604
603 TEST_F(GLES2DecoderTest2, AcceptsUniform_GL_INT_VEC3) { 605 TEST_P(GLES2DecoderTest2, AcceptsUniform_GL_INT_VEC3) {
604 TestAcceptedUniform(GL_INT_VEC3, Program::kUniform3i); 606 TestAcceptedUniform(GL_INT_VEC3, Program::kUniform3i);
605 } 607 }
606 608
607 TEST_F(GLES2DecoderTest2, AcceptsUniform_GL_INT_VEC4) { 609 TEST_P(GLES2DecoderTest2, AcceptsUniform_GL_INT_VEC4) {
608 TestAcceptedUniform(GL_INT_VEC4, Program::kUniform4i); 610 TestAcceptedUniform(GL_INT_VEC4, Program::kUniform4i);
609 } 611 }
610 612
611 TEST_F(GLES2DecoderTest2, AcceptsUniform_GL_BOOL) { 613 TEST_P(GLES2DecoderTest2, AcceptsUniform_GL_BOOL) {
612 TestAcceptedUniform(GL_BOOL, Program::kUniform1i | Program::kUniform1f); 614 TestAcceptedUniform(GL_BOOL, Program::kUniform1i | Program::kUniform1f);
613 } 615 }
614 616
615 TEST_F(GLES2DecoderTest2, AcceptsUniform_GL_BOOL_VEC2) { 617 TEST_P(GLES2DecoderTest2, AcceptsUniform_GL_BOOL_VEC2) {
616 TestAcceptedUniform(GL_BOOL_VEC2, Program::kUniform2i | Program::kUniform2f); 618 TestAcceptedUniform(GL_BOOL_VEC2, Program::kUniform2i | Program::kUniform2f);
617 } 619 }
618 620
619 TEST_F(GLES2DecoderTest2, AcceptsUniform_GL_BOOL_VEC3) { 621 TEST_P(GLES2DecoderTest2, AcceptsUniform_GL_BOOL_VEC3) {
620 TestAcceptedUniform(GL_BOOL_VEC3, Program::kUniform3i | Program::kUniform3f); 622 TestAcceptedUniform(GL_BOOL_VEC3, Program::kUniform3i | Program::kUniform3f);
621 } 623 }
622 624
623 TEST_F(GLES2DecoderTest2, AcceptsUniform_GL_BOOL_VEC4) { 625 TEST_P(GLES2DecoderTest2, AcceptsUniform_GL_BOOL_VEC4) {
624 TestAcceptedUniform(GL_BOOL_VEC4, Program::kUniform4i | Program::kUniform4f); 626 TestAcceptedUniform(GL_BOOL_VEC4, Program::kUniform4i | Program::kUniform4f);
625 } 627 }
626 628
627 TEST_F(GLES2DecoderTest2, AcceptsUniformTypeFLOAT) { 629 TEST_P(GLES2DecoderTest2, AcceptsUniformTypeFLOAT) {
628 TestAcceptedUniform(GL_FLOAT, Program::kUniform1f); 630 TestAcceptedUniform(GL_FLOAT, Program::kUniform1f);
629 } 631 }
630 632
631 TEST_F(GLES2DecoderTest2, AcceptsUniform_GL_FLOAT_VEC2) { 633 TEST_P(GLES2DecoderTest2, AcceptsUniform_GL_FLOAT_VEC2) {
632 TestAcceptedUniform(GL_FLOAT_VEC2, Program::kUniform2f); 634 TestAcceptedUniform(GL_FLOAT_VEC2, Program::kUniform2f);
633 } 635 }
634 636
635 TEST_F(GLES2DecoderTest2, AcceptsUniform_GL_FLOAT_VEC3) { 637 TEST_P(GLES2DecoderTest2, AcceptsUniform_GL_FLOAT_VEC3) {
636 TestAcceptedUniform(GL_FLOAT_VEC3, Program::kUniform3f); 638 TestAcceptedUniform(GL_FLOAT_VEC3, Program::kUniform3f);
637 } 639 }
638 640
639 TEST_F(GLES2DecoderTest2, AcceptsUniform_GL_FLOAT_VEC4) { 641 TEST_P(GLES2DecoderTest2, AcceptsUniform_GL_FLOAT_VEC4) {
640 TestAcceptedUniform(GL_FLOAT_VEC4, Program::kUniform4f); 642 TestAcceptedUniform(GL_FLOAT_VEC4, Program::kUniform4f);
641 } 643 }
642 644
643 TEST_F(GLES2DecoderTest2, AcceptsUniform_GL_FLOAT_MAT2) { 645 TEST_P(GLES2DecoderTest2, AcceptsUniform_GL_FLOAT_MAT2) {
644 TestAcceptedUniform(GL_FLOAT_MAT2, Program::kUniformMatrix2f); 646 TestAcceptedUniform(GL_FLOAT_MAT2, Program::kUniformMatrix2f);
645 } 647 }
646 648
647 TEST_F(GLES2DecoderTest2, AcceptsUniform_GL_FLOAT_MAT3) { 649 TEST_P(GLES2DecoderTest2, AcceptsUniform_GL_FLOAT_MAT3) {
648 TestAcceptedUniform(GL_FLOAT_MAT3, Program::kUniformMatrix3f); 650 TestAcceptedUniform(GL_FLOAT_MAT3, Program::kUniformMatrix3f);
649 } 651 }
650 652
651 TEST_F(GLES2DecoderTest2, AcceptsUniform_GL_FLOAT_MAT4) { 653 TEST_P(GLES2DecoderTest2, AcceptsUniform_GL_FLOAT_MAT4) {
652 TestAcceptedUniform(GL_FLOAT_MAT4, Program::kUniformMatrix4f); 654 TestAcceptedUniform(GL_FLOAT_MAT4, Program::kUniformMatrix4f);
653 } 655 }
654 656
655 } // namespace gles2 657 } // namespace gles2
656 } // namespace gpu 658 } // namespace gpu
657 659
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698