OLD | NEW |
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 627 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
638 | 638 |
639 bool GLES2DecoderTestBase::DoIsBuffer(GLuint client_id) { | 639 bool GLES2DecoderTestBase::DoIsBuffer(GLuint client_id) { |
640 return IsObjectHelper<cmds::IsBuffer, cmds::IsBuffer::Result>(client_id); | 640 return IsObjectHelper<cmds::IsBuffer, cmds::IsBuffer::Result>(client_id); |
641 } | 641 } |
642 | 642 |
643 void GLES2DecoderTestBase::DoDeleteBuffer( | 643 void GLES2DecoderTestBase::DoDeleteBuffer( |
644 GLuint client_id, GLuint service_id) { | 644 GLuint client_id, GLuint service_id) { |
645 EXPECT_CALL(*gl_, DeleteBuffersARB(1, Pointee(service_id))) | 645 EXPECT_CALL(*gl_, DeleteBuffersARB(1, Pointee(service_id))) |
646 .Times(1) | 646 .Times(1) |
647 .RetiresOnSaturation(); | 647 .RetiresOnSaturation(); |
648 cmds::DeleteBuffers cmd; | 648 GenHelper<cmds::DeleteBuffersImmediate>(client_id); |
649 cmd.Init(1, shared_memory_id_, shared_memory_offset_); | |
650 memcpy(shared_memory_address_, &client_id, sizeof(client_id)); | |
651 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | |
652 } | 649 } |
653 | 650 |
654 void GLES2DecoderTestBase::SetupExpectationsForColorMask(bool red, | 651 void GLES2DecoderTestBase::SetupExpectationsForColorMask(bool red, |
655 bool green, | 652 bool green, |
656 bool blue, | 653 bool blue, |
657 bool alpha) { | 654 bool alpha) { |
658 if (ignore_cached_state_for_test_ || cached_color_mask_red_ != red || | 655 if (ignore_cached_state_for_test_ || cached_color_mask_red_ != red || |
659 cached_color_mask_green_ != green || cached_color_mask_blue_ != blue || | 656 cached_color_mask_green_ != green || cached_color_mask_blue_ != blue || |
660 cached_color_mask_alpha_ != alpha) { | 657 cached_color_mask_alpha_ != alpha) { |
661 cached_color_mask_red_ = red; | 658 cached_color_mask_red_ = red; |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
833 .RetiresOnSaturation(); | 830 .RetiresOnSaturation(); |
834 } | 831 } |
835 if (reset_read) { | 832 if (reset_read) { |
836 EXPECT_CALL(*gl_, BindFramebufferEXT(read_target, read_id)) | 833 EXPECT_CALL(*gl_, BindFramebufferEXT(read_target, read_id)) |
837 .Times(1) | 834 .Times(1) |
838 .RetiresOnSaturation(); | 835 .RetiresOnSaturation(); |
839 } | 836 } |
840 EXPECT_CALL(*gl_, DeleteFramebuffersEXT(1, Pointee(service_id))) | 837 EXPECT_CALL(*gl_, DeleteFramebuffersEXT(1, Pointee(service_id))) |
841 .Times(1) | 838 .Times(1) |
842 .RetiresOnSaturation(); | 839 .RetiresOnSaturation(); |
843 cmds::DeleteFramebuffers cmd; | 840 GenHelper<cmds::DeleteFramebuffersImmediate>(client_id); |
844 cmd.Init(1, shared_memory_id_, shared_memory_offset_); | |
845 memcpy(shared_memory_address_, &client_id, sizeof(client_id)); | |
846 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | |
847 } | 841 } |
848 | 842 |
849 void GLES2DecoderTestBase::DoBindRenderbuffer( | 843 void GLES2DecoderTestBase::DoBindRenderbuffer( |
850 GLenum target, GLuint client_id, GLuint service_id) { | 844 GLenum target, GLuint client_id, GLuint service_id) { |
851 EXPECT_CALL(*gl_, BindRenderbufferEXT(target, service_id)) | 845 EXPECT_CALL(*gl_, BindRenderbufferEXT(target, service_id)) |
852 .Times(1) | 846 .Times(1) |
853 .RetiresOnSaturation(); | 847 .RetiresOnSaturation(); |
854 cmds::BindRenderbuffer cmd; | 848 cmds::BindRenderbuffer cmd; |
855 cmd.Init(target, client_id); | 849 cmd.Init(target, client_id); |
856 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 850 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
857 } | 851 } |
858 | 852 |
859 bool GLES2DecoderTestBase::DoIsRenderbuffer(GLuint client_id) { | 853 bool GLES2DecoderTestBase::DoIsRenderbuffer(GLuint client_id) { |
860 return IsObjectHelper<cmds::IsRenderbuffer, cmds::IsRenderbuffer::Result>( | 854 return IsObjectHelper<cmds::IsRenderbuffer, cmds::IsRenderbuffer::Result>( |
861 client_id); | 855 client_id); |
862 } | 856 } |
863 | 857 |
864 void GLES2DecoderTestBase::DoDeleteRenderbuffer( | 858 void GLES2DecoderTestBase::DoDeleteRenderbuffer( |
865 GLuint client_id, GLuint service_id) { | 859 GLuint client_id, GLuint service_id) { |
866 EXPECT_CALL(*gl_, DeleteRenderbuffersEXT(1, Pointee(service_id))) | 860 EXPECT_CALL(*gl_, DeleteRenderbuffersEXT(1, Pointee(service_id))) |
867 .Times(1) | 861 .Times(1) |
868 .RetiresOnSaturation(); | 862 .RetiresOnSaturation(); |
869 cmds::DeleteRenderbuffers cmd; | 863 GenHelper<cmds::DeleteRenderbuffersImmediate>(client_id); |
870 cmd.Init(1, shared_memory_id_, shared_memory_offset_); | |
871 memcpy(shared_memory_address_, &client_id, sizeof(client_id)); | |
872 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | |
873 } | 864 } |
874 | 865 |
875 void GLES2DecoderTestBase::DoBindTexture( | 866 void GLES2DecoderTestBase::DoBindTexture( |
876 GLenum target, GLuint client_id, GLuint service_id) { | 867 GLenum target, GLuint client_id, GLuint service_id) { |
877 EXPECT_CALL(*gl_, BindTexture(target, service_id)) | 868 EXPECT_CALL(*gl_, BindTexture(target, service_id)) |
878 .Times(1) | 869 .Times(1) |
879 .RetiresOnSaturation(); | 870 .RetiresOnSaturation(); |
880 cmds::BindTexture cmd; | 871 cmds::BindTexture cmd; |
881 cmd.Init(target, client_id); | 872 cmd.Init(target, client_id); |
882 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 873 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
883 } | 874 } |
884 | 875 |
885 bool GLES2DecoderTestBase::DoIsTexture(GLuint client_id) { | 876 bool GLES2DecoderTestBase::DoIsTexture(GLuint client_id) { |
886 return IsObjectHelper<cmds::IsTexture, cmds::IsTexture::Result>(client_id); | 877 return IsObjectHelper<cmds::IsTexture, cmds::IsTexture::Result>(client_id); |
887 } | 878 } |
888 | 879 |
889 void GLES2DecoderTestBase::DoDeleteTexture( | 880 void GLES2DecoderTestBase::DoDeleteTexture( |
890 GLuint client_id, GLuint service_id) { | 881 GLuint client_id, GLuint service_id) { |
891 EXPECT_CALL(*gl_, DeleteTextures(1, Pointee(service_id))) | 882 EXPECT_CALL(*gl_, DeleteTextures(1, Pointee(service_id))) |
892 .Times(1) | 883 .Times(1) |
893 .RetiresOnSaturation(); | 884 .RetiresOnSaturation(); |
894 cmds::DeleteTextures cmd; | 885 GenHelper<cmds::DeleteTexturesImmediate>(client_id); |
895 cmd.Init(1, shared_memory_id_, shared_memory_offset_); | |
896 memcpy(shared_memory_address_, &client_id, sizeof(client_id)); | |
897 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | |
898 } | 886 } |
899 | 887 |
900 void GLES2DecoderTestBase::DoTexImage2D( | 888 void GLES2DecoderTestBase::DoTexImage2D( |
901 GLenum target, GLint level, GLenum internal_format, | 889 GLenum target, GLint level, GLenum internal_format, |
902 GLsizei width, GLsizei height, GLint border, | 890 GLsizei width, GLsizei height, GLint border, |
903 GLenum format, GLenum type, | 891 GLenum format, GLenum type, |
904 uint32 shared_memory_id, uint32 shared_memory_offset) { | 892 uint32 shared_memory_id, uint32 shared_memory_offset) { |
905 EXPECT_CALL(*gl_, GetError()) | 893 EXPECT_CALL(*gl_, GetError()) |
906 .WillOnce(Return(GL_NO_ERROR)) | 894 .WillOnce(Return(GL_NO_ERROR)) |
907 .RetiresOnSaturation(); | 895 .RetiresOnSaturation(); |
(...skipping 651 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1559 SetupDefaultProgram(); | 1547 SetupDefaultProgram(); |
1560 } | 1548 } |
1561 | 1549 |
1562 // Include the auto-generated part of this file. We split this because it means | 1550 // Include the auto-generated part of this file. We split this because it means |
1563 // we can easily edit the non-auto generated parts right here in this file | 1551 // we can easily edit the non-auto generated parts right here in this file |
1564 // instead of having to edit some template or the code generator. | 1552 // instead of having to edit some template or the code generator. |
1565 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_0_autogen.h" | 1553 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_0_autogen.h" |
1566 | 1554 |
1567 } // namespace gles2 | 1555 } // namespace gles2 |
1568 } // namespace gpu | 1556 } // namespace gpu |
OLD | NEW |