| 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.h" | 5 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
| 9 #include "gpu/command_buffer/common/gles2_cmd_format.h" | 9 #include "gpu/command_buffer/common/gles2_cmd_format.h" |
| 10 #include "gpu/command_buffer/common/gles2_cmd_utils.h" | 10 #include "gpu/command_buffer/common/gles2_cmd_utils.h" |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 public: | 58 public: |
| 59 GLES2DecoderTest() { } | 59 GLES2DecoderTest() { } |
| 60 | 60 |
| 61 protected: | 61 protected: |
| 62 void CheckReadPixelsOutOfRange( | 62 void CheckReadPixelsOutOfRange( |
| 63 GLint in_read_x, GLint in_read_y, | 63 GLint in_read_x, GLint in_read_y, |
| 64 GLsizei in_read_width, GLsizei in_read_height, | 64 GLsizei in_read_width, GLsizei in_read_height, |
| 65 bool init); | 65 bool init); |
| 66 }; | 66 }; |
| 67 | 67 |
| 68 class GLES2DecoderTestWithExtensions | 68 class GLES2DecoderTestWithExtensionsOnGLES2 |
| 69 : public GLES2DecoderTest, | 69 : public GLES2DecoderTest, |
| 70 public ::testing::WithParamInterface<const char*> { | 70 public ::testing::WithParamInterface<const char*> { |
| 71 public: | 71 public: |
| 72 GLES2DecoderTestWithExtensions() {} | 72 GLES2DecoderTestWithExtensionsOnGLES2() {} |
| 73 | 73 |
| 74 virtual void SetUp() { | 74 virtual void SetUp() { |
| 75 InitDecoder(GetParam(), // extensions | 75 InitDecoder(GetParam(), // extensions |
| 76 true, // has alpha | 76 "opengl es 2.0", // gl version |
| 77 true, // has depth | 77 true, // has alpha |
| 78 false, // has stencil | 78 true, // has depth |
| 79 true, // request alpha | 79 false, // has stencil |
| 80 true, // request depth | 80 true, // request alpha |
| 81 false, // request stencil | 81 true, // request depth |
| 82 false); // bind generates resource | 82 false, // request stencil |
| 83 false); // bind generates resource |
| 83 } | 84 } |
| 84 }; | 85 }; |
| 85 | 86 |
| 86 class GLES2DecoderWithShaderTest : public GLES2DecoderWithShaderTestBase { | 87 class GLES2DecoderWithShaderTest : public GLES2DecoderWithShaderTestBase { |
| 87 public: | 88 public: |
| 88 GLES2DecoderWithShaderTest() | 89 GLES2DecoderWithShaderTest() |
| 89 : GLES2DecoderWithShaderTestBase() { | 90 : GLES2DecoderWithShaderTestBase() { |
| 90 } | 91 } |
| 91 | 92 |
| 92 void CheckTextureChangesMarkFBOAsNotComplete(bool bound_fbo); | 93 void CheckTextureChangesMarkFBOAsNotComplete(bool bound_fbo); |
| 93 void CheckRenderbufferChangesMarkFBOAsNotComplete(bool bound_fbo); | 94 void CheckRenderbufferChangesMarkFBOAsNotComplete(bool bound_fbo); |
| 94 }; | 95 }; |
| 95 | 96 |
| 96 class GLES2DecoderGeometryInstancingTest : public GLES2DecoderWithShaderTest { | 97 class GLES2DecoderGeometryInstancingTest : public GLES2DecoderWithShaderTest { |
| 97 public: | 98 public: |
| 98 GLES2DecoderGeometryInstancingTest() | 99 GLES2DecoderGeometryInstancingTest() |
| 99 : GLES2DecoderWithShaderTest() { | 100 : GLES2DecoderWithShaderTest() { |
| 100 } | 101 } |
| 101 | 102 |
| 102 virtual void SetUp() { | 103 virtual void SetUp() { |
| 103 InitDecoder( | 104 InitDecoder( |
| 104 "GL_ANGLE_instanced_arrays", // extensions | 105 "GL_ANGLE_instanced_arrays", // extensions |
| 106 "opengl es 2.0", // gl version |
| 105 true, // has alpha | 107 true, // has alpha |
| 106 true, // has depth | 108 true, // has depth |
| 107 false, // has stencil | 109 false, // has stencil |
| 108 true, // request alpha | 110 true, // request alpha |
| 109 true, // request depth | 111 true, // request depth |
| 110 false, // request stencil | 112 false, // request stencil |
| 111 true); // bind generates resource | 113 true); // bind generates resource |
| 112 SetupDefaultProgram(); | 114 SetupDefaultProgram(); |
| 113 } | 115 } |
| 114 }; | 116 }; |
| 115 | 117 |
| 116 class GLES2DecoderRGBBackbufferTest : public GLES2DecoderWithShaderTest { | 118 class GLES2DecoderRGBBackbufferTest : public GLES2DecoderWithShaderTest { |
| 117 public: | 119 public: |
| 118 GLES2DecoderRGBBackbufferTest() { } | 120 GLES2DecoderRGBBackbufferTest() { } |
| 119 | 121 |
| 120 virtual void SetUp() { | 122 virtual void SetUp() { |
| 121 InitDecoder( | 123 InitDecoder( |
| 122 "", // extensions | 124 "", // extensions |
| 125 "3.0", // gl version |
| 123 false, // has alpha | 126 false, // has alpha |
| 124 false, // has depth | 127 false, // has depth |
| 125 false, // has stencil | 128 false, // has stencil |
| 126 false, // request alpha | 129 false, // request alpha |
| 127 false, // request depth | 130 false, // request depth |
| 128 false, // request stencil | 131 false, // request stencil |
| 129 true); // bind generates resource | 132 true); // bind generates resource |
| 130 SetupDefaultProgram(); | 133 SetupDefaultProgram(); |
| 131 } | 134 } |
| 132 }; | 135 }; |
| (...skipping 3593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3726 EXPECT_CALL(*gl_, DrawArrays(GL_TRIANGLES, 0, kNumVertices)) | 3729 EXPECT_CALL(*gl_, DrawArrays(GL_TRIANGLES, 0, kNumVertices)) |
| 3727 .Times(1) | 3730 .Times(1) |
| 3728 .RetiresOnSaturation(); | 3731 .RetiresOnSaturation(); |
| 3729 EXPECT_EQ(error::kNoError, ExecuteCmd(draw_cmd)); | 3732 EXPECT_EQ(error::kNoError, ExecuteCmd(draw_cmd)); |
| 3730 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 3733 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 3731 } | 3734 } |
| 3732 | 3735 |
| 3733 TEST_F(GLES2DecoderManualInitTest, ActualAlphaMatchesRequestedAlpha) { | 3736 TEST_F(GLES2DecoderManualInitTest, ActualAlphaMatchesRequestedAlpha) { |
| 3734 InitDecoder( | 3737 InitDecoder( |
| 3735 "", // extensions | 3738 "", // extensions |
| 3739 "3.0", // gl version |
| 3736 true, // has alpha | 3740 true, // has alpha |
| 3737 false, // has depth | 3741 false, // has depth |
| 3738 false, // has stencil | 3742 false, // has stencil |
| 3739 true, // request alpha | 3743 true, // request alpha |
| 3740 false, // request depth | 3744 false, // request depth |
| 3741 false, // request stencil | 3745 false, // request stencil |
| 3742 true); // bind generates resource | 3746 true); // bind generates resource |
| 3743 | 3747 |
| 3744 EXPECT_CALL(*gl_, GetError()) | 3748 EXPECT_CALL(*gl_, GetError()) |
| 3745 .WillOnce(Return(GL_NO_ERROR)) | 3749 .WillOnce(Return(GL_NO_ERROR)) |
| (...skipping 11 matching lines...) Expand all Loading... |
| 3757 EXPECT_EQ( | 3761 EXPECT_EQ( |
| 3758 decoder_->GetGLES2Util()->GLGetNumValuesReturned(GL_ALPHA_BITS), | 3762 decoder_->GetGLES2Util()->GLGetNumValuesReturned(GL_ALPHA_BITS), |
| 3759 result->GetNumResults()); | 3763 result->GetNumResults()); |
| 3760 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 3764 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 3761 EXPECT_EQ(8, result->GetData()[0]); | 3765 EXPECT_EQ(8, result->GetData()[0]); |
| 3762 } | 3766 } |
| 3763 | 3767 |
| 3764 TEST_F(GLES2DecoderManualInitTest, ActualAlphaDoesNotMatchRequestedAlpha) { | 3768 TEST_F(GLES2DecoderManualInitTest, ActualAlphaDoesNotMatchRequestedAlpha) { |
| 3765 InitDecoder( | 3769 InitDecoder( |
| 3766 "", // extensions | 3770 "", // extensions |
| 3771 "3.0", // gl version |
| 3767 true, // has alpha | 3772 true, // has alpha |
| 3768 false, // has depth | 3773 false, // has depth |
| 3769 false, // has stencil | 3774 false, // has stencil |
| 3770 false, // request alpha | 3775 false, // request alpha |
| 3771 false, // request depth | 3776 false, // request depth |
| 3772 false, // request stencil | 3777 false, // request stencil |
| 3773 true); // bind generates resource | 3778 true); // bind generates resource |
| 3774 | 3779 |
| 3775 EXPECT_CALL(*gl_, GetError()) | 3780 EXPECT_CALL(*gl_, GetError()) |
| 3776 .WillOnce(Return(GL_NO_ERROR)) | 3781 .WillOnce(Return(GL_NO_ERROR)) |
| (...skipping 11 matching lines...) Expand all Loading... |
| 3788 EXPECT_EQ( | 3793 EXPECT_EQ( |
| 3789 decoder_->GetGLES2Util()->GLGetNumValuesReturned(GL_ALPHA_BITS), | 3794 decoder_->GetGLES2Util()->GLGetNumValuesReturned(GL_ALPHA_BITS), |
| 3790 result->GetNumResults()); | 3795 result->GetNumResults()); |
| 3791 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 3796 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 3792 EXPECT_EQ(0, result->GetData()[0]); | 3797 EXPECT_EQ(0, result->GetData()[0]); |
| 3793 } | 3798 } |
| 3794 | 3799 |
| 3795 TEST_F(GLES2DecoderManualInitTest, ActualDepthMatchesRequestedDepth) { | 3800 TEST_F(GLES2DecoderManualInitTest, ActualDepthMatchesRequestedDepth) { |
| 3796 InitDecoder( | 3801 InitDecoder( |
| 3797 "", // extensions | 3802 "", // extensions |
| 3803 "3.0", // gl version |
| 3798 false, // has alpha | 3804 false, // has alpha |
| 3799 true, // has depth | 3805 true, // has depth |
| 3800 false, // has stencil | 3806 false, // has stencil |
| 3801 false, // request alpha | 3807 false, // request alpha |
| 3802 true, // request depth | 3808 true, // request depth |
| 3803 false, // request stencil | 3809 false, // request stencil |
| 3804 true); // bind generates resource | 3810 true); // bind generates resource |
| 3805 | 3811 |
| 3806 EXPECT_CALL(*gl_, GetError()) | 3812 EXPECT_CALL(*gl_, GetError()) |
| 3807 .WillOnce(Return(GL_NO_ERROR)) | 3813 .WillOnce(Return(GL_NO_ERROR)) |
| (...skipping 11 matching lines...) Expand all Loading... |
| 3819 EXPECT_EQ( | 3825 EXPECT_EQ( |
| 3820 decoder_->GetGLES2Util()->GLGetNumValuesReturned(GL_DEPTH_BITS), | 3826 decoder_->GetGLES2Util()->GLGetNumValuesReturned(GL_DEPTH_BITS), |
| 3821 result->GetNumResults()); | 3827 result->GetNumResults()); |
| 3822 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 3828 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 3823 EXPECT_EQ(24, result->GetData()[0]); | 3829 EXPECT_EQ(24, result->GetData()[0]); |
| 3824 } | 3830 } |
| 3825 | 3831 |
| 3826 TEST_F(GLES2DecoderManualInitTest, ActualDepthDoesNotMatchRequestedDepth) { | 3832 TEST_F(GLES2DecoderManualInitTest, ActualDepthDoesNotMatchRequestedDepth) { |
| 3827 InitDecoder( | 3833 InitDecoder( |
| 3828 "", // extensions | 3834 "", // extensions |
| 3835 "3.0", // gl version |
| 3829 false, // has alpha | 3836 false, // has alpha |
| 3830 true, // has depth | 3837 true, // has depth |
| 3831 false, // has stencil | 3838 false, // has stencil |
| 3832 false, // request alpha | 3839 false, // request alpha |
| 3833 false, // request depth | 3840 false, // request depth |
| 3834 false, // request stencil | 3841 false, // request stencil |
| 3835 true); // bind generates resource | 3842 true); // bind generates resource |
| 3836 | 3843 |
| 3837 EXPECT_CALL(*gl_, GetError()) | 3844 EXPECT_CALL(*gl_, GetError()) |
| 3838 .WillOnce(Return(GL_NO_ERROR)) | 3845 .WillOnce(Return(GL_NO_ERROR)) |
| (...skipping 11 matching lines...) Expand all Loading... |
| 3850 EXPECT_EQ( | 3857 EXPECT_EQ( |
| 3851 decoder_->GetGLES2Util()->GLGetNumValuesReturned(GL_DEPTH_BITS), | 3858 decoder_->GetGLES2Util()->GLGetNumValuesReturned(GL_DEPTH_BITS), |
| 3852 result->GetNumResults()); | 3859 result->GetNumResults()); |
| 3853 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 3860 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 3854 EXPECT_EQ(0, result->GetData()[0]); | 3861 EXPECT_EQ(0, result->GetData()[0]); |
| 3855 } | 3862 } |
| 3856 | 3863 |
| 3857 TEST_F(GLES2DecoderManualInitTest, ActualStencilMatchesRequestedStencil) { | 3864 TEST_F(GLES2DecoderManualInitTest, ActualStencilMatchesRequestedStencil) { |
| 3858 InitDecoder( | 3865 InitDecoder( |
| 3859 "", // extensions | 3866 "", // extensions |
| 3867 "3.0", // gl version |
| 3860 false, // has alpha | 3868 false, // has alpha |
| 3861 false, // has depth | 3869 false, // has depth |
| 3862 true, // has stencil | 3870 true, // has stencil |
| 3863 false, // request alpha | 3871 false, // request alpha |
| 3864 false, // request depth | 3872 false, // request depth |
| 3865 true, // request stencil | 3873 true, // request stencil |
| 3866 true); // bind generates resource | 3874 true); // bind generates resource |
| 3867 | 3875 |
| 3868 EXPECT_CALL(*gl_, GetError()) | 3876 EXPECT_CALL(*gl_, GetError()) |
| 3869 .WillOnce(Return(GL_NO_ERROR)) | 3877 .WillOnce(Return(GL_NO_ERROR)) |
| (...skipping 11 matching lines...) Expand all Loading... |
| 3881 EXPECT_EQ( | 3889 EXPECT_EQ( |
| 3882 decoder_->GetGLES2Util()->GLGetNumValuesReturned(GL_STENCIL_BITS), | 3890 decoder_->GetGLES2Util()->GLGetNumValuesReturned(GL_STENCIL_BITS), |
| 3883 result->GetNumResults()); | 3891 result->GetNumResults()); |
| 3884 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 3892 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 3885 EXPECT_EQ(8, result->GetData()[0]); | 3893 EXPECT_EQ(8, result->GetData()[0]); |
| 3886 } | 3894 } |
| 3887 | 3895 |
| 3888 TEST_F(GLES2DecoderManualInitTest, ActualStencilDoesNotMatchRequestedStencil) { | 3896 TEST_F(GLES2DecoderManualInitTest, ActualStencilDoesNotMatchRequestedStencil) { |
| 3889 InitDecoder( | 3897 InitDecoder( |
| 3890 "", // extensions | 3898 "", // extensions |
| 3899 "3.0", // gl version |
| 3891 false, // has alpha | 3900 false, // has alpha |
| 3892 false, // has depth | 3901 false, // has depth |
| 3893 true, // has stencil | 3902 true, // has stencil |
| 3894 false, // request alpha | 3903 false, // request alpha |
| 3895 false, // request depth | 3904 false, // request depth |
| 3896 false, // request stencil | 3905 false, // request stencil |
| 3897 true); // bind generates resource | 3906 true); // bind generates resource |
| 3898 | 3907 |
| 3899 EXPECT_CALL(*gl_, GetError()) | 3908 EXPECT_CALL(*gl_, GetError()) |
| 3900 .WillOnce(Return(GL_NO_ERROR)) | 3909 .WillOnce(Return(GL_NO_ERROR)) |
| (...skipping 11 matching lines...) Expand all Loading... |
| 3912 EXPECT_EQ( | 3921 EXPECT_EQ( |
| 3913 decoder_->GetGLES2Util()->GLGetNumValuesReturned(GL_STENCIL_BITS), | 3922 decoder_->GetGLES2Util()->GLGetNumValuesReturned(GL_STENCIL_BITS), |
| 3914 result->GetNumResults()); | 3923 result->GetNumResults()); |
| 3915 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 3924 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 3916 EXPECT_EQ(0, result->GetData()[0]); | 3925 EXPECT_EQ(0, result->GetData()[0]); |
| 3917 } | 3926 } |
| 3918 | 3927 |
| 3919 TEST_F(GLES2DecoderManualInitTest, DepthEnableWithDepth) { | 3928 TEST_F(GLES2DecoderManualInitTest, DepthEnableWithDepth) { |
| 3920 InitDecoder( | 3929 InitDecoder( |
| 3921 "", // extensions | 3930 "", // extensions |
| 3931 "3.0", // gl version |
| 3922 false, // has alpha | 3932 false, // has alpha |
| 3923 true, // has depth | 3933 true, // has depth |
| 3924 false, // has stencil | 3934 false, // has stencil |
| 3925 false, // request alpha | 3935 false, // request alpha |
| 3926 true, // request depth | 3936 true, // request depth |
| 3927 false, // request stencil | 3937 false, // request stencil |
| 3928 true); // bind generates resource | 3938 true); // bind generates resource |
| 3929 | 3939 |
| 3930 Enable cmd; | 3940 Enable cmd; |
| 3931 cmd.Init(GL_DEPTH_TEST); | 3941 cmd.Init(GL_DEPTH_TEST); |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3974 EXPECT_EQ( | 3984 EXPECT_EQ( |
| 3975 decoder_->GetGLES2Util()->GLGetNumValuesReturned(GL_DEPTH_TEST), | 3985 decoder_->GetGLES2Util()->GLGetNumValuesReturned(GL_DEPTH_TEST), |
| 3976 result->GetNumResults()); | 3986 result->GetNumResults()); |
| 3977 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 3987 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 3978 EXPECT_EQ(1, result->GetData()[0]); | 3988 EXPECT_EQ(1, result->GetData()[0]); |
| 3979 } | 3989 } |
| 3980 | 3990 |
| 3981 TEST_F(GLES2DecoderManualInitTest, DepthEnableWithoutRequestedDepth) { | 3991 TEST_F(GLES2DecoderManualInitTest, DepthEnableWithoutRequestedDepth) { |
| 3982 InitDecoder( | 3992 InitDecoder( |
| 3983 "", // extensions | 3993 "", // extensions |
| 3994 "3.0", // gl version |
| 3984 false, // has alpha | 3995 false, // has alpha |
| 3985 true, // has depth | 3996 true, // has depth |
| 3986 false, // has stencil | 3997 false, // has stencil |
| 3987 false, // request alpha | 3998 false, // request alpha |
| 3988 false, // request depth | 3999 false, // request depth |
| 3989 false, // request stencil | 4000 false, // request stencil |
| 3990 true); // bind generates resource | 4001 true); // bind generates resource |
| 3991 | 4002 |
| 3992 Enable cmd; | 4003 Enable cmd; |
| 3993 cmd.Init(GL_DEPTH_TEST); | 4004 cmd.Init(GL_DEPTH_TEST); |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4035 EXPECT_EQ( | 4046 EXPECT_EQ( |
| 4036 decoder_->GetGLES2Util()->GLGetNumValuesReturned(GL_DEPTH_TEST), | 4047 decoder_->GetGLES2Util()->GLGetNumValuesReturned(GL_DEPTH_TEST), |
| 4037 result->GetNumResults()); | 4048 result->GetNumResults()); |
| 4038 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 4049 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 4039 EXPECT_EQ(1, result->GetData()[0]); | 4050 EXPECT_EQ(1, result->GetData()[0]); |
| 4040 } | 4051 } |
| 4041 | 4052 |
| 4042 TEST_F(GLES2DecoderManualInitTest, StencilEnableWithStencil) { | 4053 TEST_F(GLES2DecoderManualInitTest, StencilEnableWithStencil) { |
| 4043 InitDecoder( | 4054 InitDecoder( |
| 4044 "", // extensions | 4055 "", // extensions |
| 4056 "3.0", // gl version |
| 4045 false, // has alpha | 4057 false, // has alpha |
| 4046 false, // has depth | 4058 false, // has depth |
| 4047 true, // has stencil | 4059 true, // has stencil |
| 4048 false, // request alpha | 4060 false, // request alpha |
| 4049 false, // request depth | 4061 false, // request depth |
| 4050 true, // request stencil | 4062 true, // request stencil |
| 4051 true); // bind generates resource | 4063 true); // bind generates resource |
| 4052 | 4064 |
| 4053 Enable cmd; | 4065 Enable cmd; |
| 4054 cmd.Init(GL_STENCIL_TEST); | 4066 cmd.Init(GL_STENCIL_TEST); |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4096 EXPECT_EQ( | 4108 EXPECT_EQ( |
| 4097 decoder_->GetGLES2Util()->GLGetNumValuesReturned(GL_STENCIL_TEST), | 4109 decoder_->GetGLES2Util()->GLGetNumValuesReturned(GL_STENCIL_TEST), |
| 4098 result->GetNumResults()); | 4110 result->GetNumResults()); |
| 4099 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 4111 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 4100 EXPECT_EQ(1, result->GetData()[0]); | 4112 EXPECT_EQ(1, result->GetData()[0]); |
| 4101 } | 4113 } |
| 4102 | 4114 |
| 4103 TEST_F(GLES2DecoderManualInitTest, StencilEnableWithoutRequestedStencil) { | 4115 TEST_F(GLES2DecoderManualInitTest, StencilEnableWithoutRequestedStencil) { |
| 4104 InitDecoder( | 4116 InitDecoder( |
| 4105 "", // extensions | 4117 "", // extensions |
| 4118 "3.0", // gl version |
| 4106 false, // has alpha | 4119 false, // has alpha |
| 4107 false, // has depth | 4120 false, // has depth |
| 4108 true, // has stencil | 4121 true, // has stencil |
| 4109 false, // request alpha | 4122 false, // request alpha |
| 4110 false, // request depth | 4123 false, // request depth |
| 4111 false, // request stencil | 4124 false, // request stencil |
| 4112 true); // bind generates resource | 4125 true); // bind generates resource |
| 4113 | 4126 |
| 4114 Enable cmd; | 4127 Enable cmd; |
| 4115 cmd.Init(GL_STENCIL_TEST); | 4128 cmd.Init(GL_STENCIL_TEST); |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4157 EXPECT_EQ( | 4170 EXPECT_EQ( |
| 4158 decoder_->GetGLES2Util()->GLGetNumValuesReturned(GL_STENCIL_TEST), | 4171 decoder_->GetGLES2Util()->GLGetNumValuesReturned(GL_STENCIL_TEST), |
| 4159 result->GetNumResults()); | 4172 result->GetNumResults()); |
| 4160 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 4173 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 4161 EXPECT_EQ(1, result->GetData()[0]); | 4174 EXPECT_EQ(1, result->GetData()[0]); |
| 4162 } | 4175 } |
| 4163 | 4176 |
| 4164 TEST_F(GLES2DecoderManualInitTest, PackedDepthStencilReportsCorrectValues) { | 4177 TEST_F(GLES2DecoderManualInitTest, PackedDepthStencilReportsCorrectValues) { |
| 4165 InitDecoder( | 4178 InitDecoder( |
| 4166 "GL_OES_packed_depth_stencil", // extensions | 4179 "GL_OES_packed_depth_stencil", // extensions |
| 4180 "opengl es 2.0", // gl version |
| 4167 false, // has alpha | 4181 false, // has alpha |
| 4168 true, // has depth | 4182 true, // has depth |
| 4169 true, // has stencil | 4183 true, // has stencil |
| 4170 false, // request alpha | 4184 false, // request alpha |
| 4171 true, // request depth | 4185 true, // request depth |
| 4172 true, // request stencil | 4186 true, // request stencil |
| 4173 true); // bind generates resource | 4187 true); // bind generates resource |
| 4174 | 4188 |
| 4175 EXPECT_CALL(*gl_, GetError()) | 4189 EXPECT_CALL(*gl_, GetError()) |
| 4176 .WillOnce(Return(GL_NO_ERROR)) | 4190 .WillOnce(Return(GL_NO_ERROR)) |
| (...skipping 24 matching lines...) Expand all Loading... |
| 4201 EXPECT_EQ( | 4215 EXPECT_EQ( |
| 4202 decoder_->GetGLES2Util()->GLGetNumValuesReturned(GL_DEPTH_BITS), | 4216 decoder_->GetGLES2Util()->GLGetNumValuesReturned(GL_DEPTH_BITS), |
| 4203 result->GetNumResults()); | 4217 result->GetNumResults()); |
| 4204 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 4218 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 4205 EXPECT_EQ(24, result->GetData()[0]); | 4219 EXPECT_EQ(24, result->GetData()[0]); |
| 4206 } | 4220 } |
| 4207 | 4221 |
| 4208 TEST_F(GLES2DecoderManualInitTest, PackedDepthStencilNoRequestedStencil) { | 4222 TEST_F(GLES2DecoderManualInitTest, PackedDepthStencilNoRequestedStencil) { |
| 4209 InitDecoder( | 4223 InitDecoder( |
| 4210 "GL_OES_packed_depth_stencil", // extensions | 4224 "GL_OES_packed_depth_stencil", // extensions |
| 4225 "opengl es 2.0", // gl version |
| 4211 false, // has alpha | 4226 false, // has alpha |
| 4212 true, // has depth | 4227 true, // has depth |
| 4213 true, // has stencil | 4228 true, // has stencil |
| 4214 false, // request alpha | 4229 false, // request alpha |
| 4215 true, // request depth | 4230 true, // request depth |
| 4216 false, // request stencil | 4231 false, // request stencil |
| 4217 true); // bind generates resource | 4232 true); // bind generates resource |
| 4218 | 4233 |
| 4219 EXPECT_CALL(*gl_, GetError()) | 4234 EXPECT_CALL(*gl_, GetError()) |
| 4220 .WillOnce(Return(GL_NO_ERROR)) | 4235 .WillOnce(Return(GL_NO_ERROR)) |
| (...skipping 24 matching lines...) Expand all Loading... |
| 4245 EXPECT_EQ( | 4260 EXPECT_EQ( |
| 4246 decoder_->GetGLES2Util()->GLGetNumValuesReturned(GL_DEPTH_BITS), | 4261 decoder_->GetGLES2Util()->GLGetNumValuesReturned(GL_DEPTH_BITS), |
| 4247 result->GetNumResults()); | 4262 result->GetNumResults()); |
| 4248 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 4263 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 4249 EXPECT_EQ(24, result->GetData()[0]); | 4264 EXPECT_EQ(24, result->GetData()[0]); |
| 4250 } | 4265 } |
| 4251 | 4266 |
| 4252 TEST_F(GLES2DecoderManualInitTest, PackedDepthStencilRenderbufferDepth) { | 4267 TEST_F(GLES2DecoderManualInitTest, PackedDepthStencilRenderbufferDepth) { |
| 4253 InitDecoder( | 4268 InitDecoder( |
| 4254 "GL_OES_packed_depth_stencil", // extensions | 4269 "GL_OES_packed_depth_stencil", // extensions |
| 4270 "opengl es 2.0", // gl version |
| 4255 false, // has alpha | 4271 false, // has alpha |
| 4256 false, // has depth | 4272 false, // has depth |
| 4257 false, // has stencil | 4273 false, // has stencil |
| 4258 false, // request alpha | 4274 false, // request alpha |
| 4259 false, // request depth | 4275 false, // request depth |
| 4260 false, // request stencil | 4276 false, // request stencil |
| 4261 true); // bind generates resource | 4277 true); // bind generates resource |
| 4262 DoBindRenderbuffer(GL_RENDERBUFFER, client_renderbuffer_id_, | 4278 DoBindRenderbuffer(GL_RENDERBUFFER, client_renderbuffer_id_, |
| 4263 kServiceRenderbufferId); | 4279 kServiceRenderbufferId); |
| 4264 DoBindFramebuffer(GL_FRAMEBUFFER, client_framebuffer_id_, | 4280 DoBindFramebuffer(GL_FRAMEBUFFER, client_framebuffer_id_, |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4316 EXPECT_EQ( | 4332 EXPECT_EQ( |
| 4317 decoder_->GetGLES2Util()->GLGetNumValuesReturned(GL_DEPTH_BITS), | 4333 decoder_->GetGLES2Util()->GLGetNumValuesReturned(GL_DEPTH_BITS), |
| 4318 result->GetNumResults()); | 4334 result->GetNumResults()); |
| 4319 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 4335 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 4320 EXPECT_EQ(24, result->GetData()[0]); | 4336 EXPECT_EQ(24, result->GetData()[0]); |
| 4321 } | 4337 } |
| 4322 | 4338 |
| 4323 TEST_F(GLES2DecoderManualInitTest, PackedDepthStencilRenderbufferStencil) { | 4339 TEST_F(GLES2DecoderManualInitTest, PackedDepthStencilRenderbufferStencil) { |
| 4324 InitDecoder( | 4340 InitDecoder( |
| 4325 "GL_OES_packed_depth_stencil", // extensions | 4341 "GL_OES_packed_depth_stencil", // extensions |
| 4342 "opengl es 2.0", // gl version |
| 4326 false, // has alpha | 4343 false, // has alpha |
| 4327 false, // has depth | 4344 false, // has depth |
| 4328 false, // has stencil | 4345 false, // has stencil |
| 4329 false, // request alpha | 4346 false, // request alpha |
| 4330 false, // request depth | 4347 false, // request depth |
| 4331 false, // request stencil | 4348 false, // request stencil |
| 4332 true); // bind generates resource | 4349 true); // bind generates resource |
| 4333 DoBindRenderbuffer(GL_RENDERBUFFER, client_renderbuffer_id_, | 4350 DoBindRenderbuffer(GL_RENDERBUFFER, client_renderbuffer_id_, |
| 4334 kServiceRenderbufferId); | 4351 kServiceRenderbufferId); |
| 4335 DoBindFramebuffer(GL_FRAMEBUFFER, client_framebuffer_id_, | 4352 DoBindFramebuffer(GL_FRAMEBUFFER, client_framebuffer_id_, |
| (...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4719 EXPECT_EQ(GL_INVALID_VALUE, GetGLError()); | 4736 EXPECT_EQ(GL_INVALID_VALUE, GetGLError()); |
| 4720 cmd.Init(GL_RENDERBUFFER, GL_RGBA4, 1, TestHelper::kMaxRenderbufferSize + 1); | 4737 cmd.Init(GL_RENDERBUFFER, GL_RGBA4, 1, TestHelper::kMaxRenderbufferSize + 1); |
| 4721 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 4738 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 4722 EXPECT_EQ(GL_INVALID_VALUE, GetGLError()); | 4739 EXPECT_EQ(GL_INVALID_VALUE, GetGLError()); |
| 4723 } | 4740 } |
| 4724 | 4741 |
| 4725 TEST_F(GLES2DecoderManualInitTest, | 4742 TEST_F(GLES2DecoderManualInitTest, |
| 4726 RenderbufferStorageMultisampleCHROMIUMGLError) { | 4743 RenderbufferStorageMultisampleCHROMIUMGLError) { |
| 4727 InitDecoder( | 4744 InitDecoder( |
| 4728 "GL_EXT_framebuffer_multisample", // extensions | 4745 "GL_EXT_framebuffer_multisample", // extensions |
| 4746 "2.1", // gl version |
| 4729 false, // has alpha | 4747 false, // has alpha |
| 4730 false, // has depth | 4748 false, // has depth |
| 4731 false, // has stencil | 4749 false, // has stencil |
| 4732 false, // request alpha | 4750 false, // request alpha |
| 4733 false, // request depth | 4751 false, // request depth |
| 4734 false, // request stencil | 4752 false, // request stencil |
| 4735 true); // bind generates resource | 4753 true); // bind generates resource |
| 4736 DoBindRenderbuffer(GL_RENDERBUFFER, client_renderbuffer_id_, | 4754 DoBindRenderbuffer(GL_RENDERBUFFER, client_renderbuffer_id_, |
| 4737 kServiceRenderbufferId); | 4755 kServiceRenderbufferId); |
| 4738 EXPECT_CALL(*gl_, GetError()) | 4756 EXPECT_CALL(*gl_, GetError()) |
| 4739 .WillOnce(Return(GL_NO_ERROR)) | 4757 .WillOnce(Return(GL_NO_ERROR)) |
| 4740 .WillOnce(Return(GL_OUT_OF_MEMORY)) | 4758 .WillOnce(Return(GL_OUT_OF_MEMORY)) |
| 4741 .RetiresOnSaturation(); | 4759 .RetiresOnSaturation(); |
| 4742 EXPECT_CALL(*gl_, RenderbufferStorageMultisampleEXT( | 4760 EXPECT_CALL(*gl_, RenderbufferStorageMultisampleEXT( |
| 4743 GL_RENDERBUFFER, 1, GL_RGBA, 100, 50)) | 4761 GL_RENDERBUFFER, 1, GL_RGBA, 100, 50)) |
| 4744 .Times(1) | 4762 .Times(1) |
| 4745 .RetiresOnSaturation(); | 4763 .RetiresOnSaturation(); |
| 4746 RenderbufferStorageMultisampleCHROMIUM cmd; | 4764 RenderbufferStorageMultisampleCHROMIUM cmd; |
| 4747 cmd.Init(GL_RENDERBUFFER, 1, GL_RGBA4, 100, 50); | 4765 cmd.Init(GL_RENDERBUFFER, 1, GL_RGBA4, 100, 50); |
| 4748 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 4766 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 4749 EXPECT_EQ(GL_OUT_OF_MEMORY, GetGLError()); | 4767 EXPECT_EQ(GL_OUT_OF_MEMORY, GetGLError()); |
| 4750 } | 4768 } |
| 4751 | 4769 |
| 4752 TEST_F(GLES2DecoderManualInitTest, | 4770 TEST_F(GLES2DecoderManualInitTest, |
| 4753 RenderbufferStorageMultisampleCHROMIUMBadArgs) { | 4771 RenderbufferStorageMultisampleCHROMIUMBadArgs) { |
| 4754 InitDecoder( | 4772 InitDecoder( |
| 4755 "GL_EXT_framebuffer_multisample", // extensions | 4773 "GL_EXT_framebuffer_multisample", // extensions |
| 4774 "2.1", // gl version |
| 4756 false, // has alpha | 4775 false, // has alpha |
| 4757 false, // has depth | 4776 false, // has depth |
| 4758 false, // has stencil | 4777 false, // has stencil |
| 4759 false, // request alpha | 4778 false, // request alpha |
| 4760 false, // request depth | 4779 false, // request depth |
| 4761 false, // request stencil | 4780 false, // request stencil |
| 4762 true); // bind generates resource | 4781 true); // bind generates resource |
| 4763 DoBindRenderbuffer(GL_RENDERBUFFER, client_renderbuffer_id_, | 4782 DoBindRenderbuffer(GL_RENDERBUFFER, client_renderbuffer_id_, |
| 4764 kServiceRenderbufferId); | 4783 kServiceRenderbufferId); |
| 4765 EXPECT_CALL(*gl_, RenderbufferStorageMultisampleEXT(_, _, _, _, _)) | 4784 EXPECT_CALL(*gl_, RenderbufferStorageMultisampleEXT(_, _, _, _, _)) |
| (...skipping 10 matching lines...) Expand all Loading... |
| 4776 EXPECT_EQ(GL_INVALID_VALUE, GetGLError()); | 4795 EXPECT_EQ(GL_INVALID_VALUE, GetGLError()); |
| 4777 cmd.Init(GL_RENDERBUFFER, TestHelper::kMaxSamples, | 4796 cmd.Init(GL_RENDERBUFFER, TestHelper::kMaxSamples, |
| 4778 GL_RGBA4, 1, TestHelper::kMaxRenderbufferSize + 1); | 4797 GL_RGBA4, 1, TestHelper::kMaxRenderbufferSize + 1); |
| 4779 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 4798 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 4780 EXPECT_EQ(GL_INVALID_VALUE, GetGLError()); | 4799 EXPECT_EQ(GL_INVALID_VALUE, GetGLError()); |
| 4781 } | 4800 } |
| 4782 | 4801 |
| 4783 TEST_F(GLES2DecoderManualInitTest, RenderbufferStorageMultisampleCHROMIUM) { | 4802 TEST_F(GLES2DecoderManualInitTest, RenderbufferStorageMultisampleCHROMIUM) { |
| 4784 InitDecoder( | 4803 InitDecoder( |
| 4785 "GL_EXT_framebuffer_multisample", // extensions | 4804 "GL_EXT_framebuffer_multisample", // extensions |
| 4805 "2.1", // gl version |
| 4786 false, // has alpha | 4806 false, // has alpha |
| 4787 false, // has depth | 4807 false, // has depth |
| 4788 false, // has stencil | 4808 false, // has stencil |
| 4789 false, // request alpha | 4809 false, // request alpha |
| 4790 false, // request depth | 4810 false, // request depth |
| 4791 false, // request stencil | 4811 false, // request stencil |
| 4792 false); // bind generates resource | 4812 false); // bind generates resource |
| 4793 DoBindRenderbuffer(GL_RENDERBUFFER, client_renderbuffer_id_, | 4813 DoBindRenderbuffer(GL_RENDERBUFFER, client_renderbuffer_id_, |
| 4794 kServiceRenderbufferId); | 4814 kServiceRenderbufferId); |
| 4795 InSequence sequence; | 4815 InSequence sequence; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 4812 cmd.Init(GL_RENDERBUFFER, TestHelper::kMaxSamples, | 4832 cmd.Init(GL_RENDERBUFFER, TestHelper::kMaxSamples, |
| 4813 GL_RGBA4, TestHelper::kMaxRenderbufferSize, 1); | 4833 GL_RGBA4, TestHelper::kMaxRenderbufferSize, 1); |
| 4814 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 4834 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 4815 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 4835 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 4816 } | 4836 } |
| 4817 | 4837 |
| 4818 TEST_F(GLES2DecoderManualInitTest, | 4838 TEST_F(GLES2DecoderManualInitTest, |
| 4819 RenderbufferStorageMultisampleEXTNotSupported) { | 4839 RenderbufferStorageMultisampleEXTNotSupported) { |
| 4820 InitDecoder( | 4840 InitDecoder( |
| 4821 "GL_EXT_framebuffer_multisample", // extensions | 4841 "GL_EXT_framebuffer_multisample", // extensions |
| 4842 "2.1", // gl version |
| 4822 false, // has alpha | 4843 false, // has alpha |
| 4823 false, // has depth | 4844 false, // has depth |
| 4824 false, // has stencil | 4845 false, // has stencil |
| 4825 false, // request alpha | 4846 false, // request alpha |
| 4826 false, // request depth | 4847 false, // request depth |
| 4827 false, // request stencil | 4848 false, // request stencil |
| 4828 false); // bind generates resource | 4849 false); // bind generates resource |
| 4829 DoBindRenderbuffer(GL_RENDERBUFFER, client_renderbuffer_id_, | 4850 DoBindRenderbuffer(GL_RENDERBUFFER, client_renderbuffer_id_, |
| 4830 kServiceRenderbufferId); | 4851 kServiceRenderbufferId); |
| 4831 InSequence sequence; | 4852 InSequence sequence; |
| 4832 // GL_EXT_framebuffer_multisample uses RenderbufferStorageMultisampleCHROMIUM. | 4853 // GL_EXT_framebuffer_multisample uses RenderbufferStorageMultisampleCHROMIUM. |
| 4833 RenderbufferStorageMultisampleEXT cmd; | 4854 RenderbufferStorageMultisampleEXT cmd; |
| 4834 cmd.Init(GL_RENDERBUFFER, TestHelper::kMaxSamples, | 4855 cmd.Init(GL_RENDERBUFFER, TestHelper::kMaxSamples, |
| 4835 GL_RGBA4, TestHelper::kMaxRenderbufferSize, 1); | 4856 GL_RGBA4, TestHelper::kMaxRenderbufferSize, 1); |
| 4836 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 4857 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 4837 EXPECT_EQ(GL_INVALID_OPERATION, GetGLError()); | 4858 EXPECT_EQ(GL_INVALID_OPERATION, GetGLError()); |
| 4838 } | 4859 } |
| 4839 | 4860 |
| 4840 class GLES2DecoderMultisampledRenderToTextureTest | 4861 class GLES2DecoderMultisampledRenderToTextureTest |
| 4841 : public GLES2DecoderTestWithExtensions {}; | 4862 : public GLES2DecoderTestWithExtensionsOnGLES2 {}; |
| 4842 | 4863 |
| 4843 TEST_P(GLES2DecoderMultisampledRenderToTextureTest, | 4864 TEST_P(GLES2DecoderMultisampledRenderToTextureTest, |
| 4844 NotCompatibleWithRenderbufferStorageMultisampleCHROMIUM) { | 4865 NotCompatibleWithRenderbufferStorageMultisampleCHROMIUM) { |
| 4845 DoBindRenderbuffer(GL_RENDERBUFFER, client_renderbuffer_id_, | 4866 DoBindRenderbuffer(GL_RENDERBUFFER, client_renderbuffer_id_, |
| 4846 kServiceRenderbufferId); | 4867 kServiceRenderbufferId); |
| 4847 RenderbufferStorageMultisampleCHROMIUM cmd; | 4868 RenderbufferStorageMultisampleCHROMIUM cmd; |
| 4848 cmd.Init(GL_RENDERBUFFER, TestHelper::kMaxSamples, | 4869 cmd.Init(GL_RENDERBUFFER, TestHelper::kMaxSamples, |
| 4849 GL_RGBA4, TestHelper::kMaxRenderbufferSize, 1); | 4870 GL_RGBA4, TestHelper::kMaxRenderbufferSize, 1); |
| 4850 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 4871 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 4851 EXPECT_EQ(GL_INVALID_OPERATION, GetGLError()); | 4872 EXPECT_EQ(GL_INVALID_OPERATION, GetGLError()); |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4930 if (array[ii] == value) { | 4951 if (array[ii] == value) { |
| 4931 return true; | 4952 return true; |
| 4932 } | 4953 } |
| 4933 } | 4954 } |
| 4934 return false; | 4955 return false; |
| 4935 } | 4956 } |
| 4936 | 4957 |
| 4937 TEST_F(GLES2DecoderManualInitTest, GetCompressedTextureFormats) { | 4958 TEST_F(GLES2DecoderManualInitTest, GetCompressedTextureFormats) { |
| 4938 InitDecoder( | 4959 InitDecoder( |
| 4939 "GL_EXT_texture_compression_s3tc", // extensions | 4960 "GL_EXT_texture_compression_s3tc", // extensions |
| 4961 "3.0", // gl version |
| 4940 false, // has alpha | 4962 false, // has alpha |
| 4941 false, // has depth | 4963 false, // has depth |
| 4942 false, // has stencil | 4964 false, // has stencil |
| 4943 false, // request alpha | 4965 false, // request alpha |
| 4944 false, // request depth | 4966 false, // request depth |
| 4945 false, // request stencil | 4967 false, // request stencil |
| 4946 true); // bind generates resource | 4968 true); // bind generates resource |
| 4947 | 4969 |
| 4948 EXPECT_CALL(*gl_, GetError()) | 4970 EXPECT_CALL(*gl_, GetError()) |
| 4949 .WillOnce(Return(GL_NO_ERROR)) | 4971 .WillOnce(Return(GL_NO_ERROR)) |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4987 EXPECT_TRUE(ValueInArray( | 5009 EXPECT_TRUE(ValueInArray( |
| 4988 GL_COMPRESSED_RGBA_S3TC_DXT5_EXT, | 5010 GL_COMPRESSED_RGBA_S3TC_DXT5_EXT, |
| 4989 result->GetData(), result->GetNumResults())); | 5011 result->GetData(), result->GetNumResults())); |
| 4990 | 5012 |
| 4991 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 5013 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 4992 } | 5014 } |
| 4993 | 5015 |
| 4994 TEST_F(GLES2DecoderManualInitTest, GetNoCompressedTextureFormats) { | 5016 TEST_F(GLES2DecoderManualInitTest, GetNoCompressedTextureFormats) { |
| 4995 InitDecoder( | 5017 InitDecoder( |
| 4996 "", // extensions | 5018 "", // extensions |
| 5019 "3.0", // gl version |
| 4997 false, // has alpha | 5020 false, // has alpha |
| 4998 false, // has depth | 5021 false, // has depth |
| 4999 false, // has stencil | 5022 false, // has stencil |
| 5000 false, // request alpha | 5023 false, // request alpha |
| 5001 false, // request depth | 5024 false, // request depth |
| 5002 false, // request stencil | 5025 false, // request stencil |
| 5003 true); // bind generates resource | 5026 true); // bind generates resource |
| 5004 | 5027 |
| 5005 EXPECT_CALL(*gl_, GetError()) | 5028 EXPECT_CALL(*gl_, GetError()) |
| 5006 .WillOnce(Return(GL_NO_ERROR)) | 5029 .WillOnce(Return(GL_NO_ERROR)) |
| (...skipping 24 matching lines...) Expand all Loading... |
| 5031 shared_memory_id_, shared_memory_offset_); | 5054 shared_memory_id_, shared_memory_offset_); |
| 5032 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 5055 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 5033 EXPECT_EQ(num_formats, result->GetNumResults()); | 5056 EXPECT_EQ(num_formats, result->GetNumResults()); |
| 5034 | 5057 |
| 5035 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 5058 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 5036 } | 5059 } |
| 5037 | 5060 |
| 5038 TEST_F(GLES2DecoderManualInitTest, CompressedTexImage2DBucketBadBucket) { | 5061 TEST_F(GLES2DecoderManualInitTest, CompressedTexImage2DBucketBadBucket) { |
| 5039 InitDecoder( | 5062 InitDecoder( |
| 5040 "GL_EXT_texture_compression_s3tc", // extensions | 5063 "GL_EXT_texture_compression_s3tc", // extensions |
| 5064 "3.0", // gl version |
| 5041 false, // has alpha | 5065 false, // has alpha |
| 5042 false, // has depth | 5066 false, // has depth |
| 5043 false, // has stencil | 5067 false, // has stencil |
| 5044 false, // request alpha | 5068 false, // request alpha |
| 5045 false, // request depth | 5069 false, // request depth |
| 5046 false, // request stencil | 5070 false, // request stencil |
| 5047 true); // bind generates resource | 5071 true); // bind generates resource |
| 5048 | 5072 |
| 5049 const uint32 kBadBucketId = 123; | 5073 const uint32 kBadBucketId = 123; |
| 5050 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); | 5074 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 5065 struct S3TCTestData { | 5089 struct S3TCTestData { |
| 5066 GLenum format; | 5090 GLenum format; |
| 5067 size_t block_size; | 5091 size_t block_size; |
| 5068 }; | 5092 }; |
| 5069 | 5093 |
| 5070 } // anonymous namespace. | 5094 } // anonymous namespace. |
| 5071 | 5095 |
| 5072 TEST_F(GLES2DecoderManualInitTest, CompressedTexImage2DS3TC) { | 5096 TEST_F(GLES2DecoderManualInitTest, CompressedTexImage2DS3TC) { |
| 5073 InitDecoder( | 5097 InitDecoder( |
| 5074 "GL_EXT_texture_compression_s3tc", // extensions | 5098 "GL_EXT_texture_compression_s3tc", // extensions |
| 5099 "3.0", // gl version |
| 5075 false, // has alpha | 5100 false, // has alpha |
| 5076 false, // has depth | 5101 false, // has depth |
| 5077 false, // has stencil | 5102 false, // has stencil |
| 5078 false, // request alpha | 5103 false, // request alpha |
| 5079 false, // request depth | 5104 false, // request depth |
| 5080 false, // request stencil | 5105 false, // request stencil |
| 5081 true); // bind generates resource | 5106 true); // bind generates resource |
| 5082 const uint32 kBucketId = 123; | 5107 const uint32 kBucketId = 123; |
| 5083 CommonDecoder::Bucket* bucket = decoder_->CreateBucket(kBucketId); | 5108 CommonDecoder::Bucket* bucket = decoder_->CreateBucket(kBucketId); |
| 5084 ASSERT_TRUE(bucket != NULL); | 5109 ASSERT_TRUE(bucket != NULL); |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5219 } | 5244 } |
| 5220 } | 5245 } |
| 5221 } | 5246 } |
| 5222 } | 5247 } |
| 5223 } | 5248 } |
| 5224 } | 5249 } |
| 5225 | 5250 |
| 5226 TEST_F(GLES2DecoderManualInitTest, CompressedTexImage2DETC1) { | 5251 TEST_F(GLES2DecoderManualInitTest, CompressedTexImage2DETC1) { |
| 5227 InitDecoder( | 5252 InitDecoder( |
| 5228 "GL_OES_compressed_ETC1_RGB8_texture", // extensions | 5253 "GL_OES_compressed_ETC1_RGB8_texture", // extensions |
| 5254 "opengl es 2.0", // gl version |
| 5229 false, // has alpha | 5255 false, // has alpha |
| 5230 false, // has depth | 5256 false, // has depth |
| 5231 false, // has stencil | 5257 false, // has stencil |
| 5232 false, // request alpha | 5258 false, // request alpha |
| 5233 false, // request depth | 5259 false, // request depth |
| 5234 false, // request stencil | 5260 false, // request stencil |
| 5235 true); // bind generates resource | 5261 true); // bind generates resource |
| 5236 const uint32 kBucketId = 123; | 5262 const uint32 kBucketId = 123; |
| 5237 CommonDecoder::Bucket* bucket = decoder_->CreateBucket(kBucketId); | 5263 CommonDecoder::Bucket* bucket = decoder_->CreateBucket(kBucketId); |
| 5238 ASSERT_TRUE(bucket != NULL); | 5264 ASSERT_TRUE(bucket != NULL); |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5291 // Test CopyTexSubImage not allowed for ETC1 compressed texture | 5317 // Test CopyTexSubImage not allowed for ETC1 compressed texture |
| 5292 CopyTexSubImage2D copy_cmd; | 5318 CopyTexSubImage2D copy_cmd; |
| 5293 copy_cmd.Init(GL_TEXTURE_2D, 0, 0, 0, 0, 0, 4, 4); | 5319 copy_cmd.Init(GL_TEXTURE_2D, 0, 0, 0, 0, 0, 4, 4); |
| 5294 EXPECT_EQ(error::kNoError, ExecuteCmd(copy_cmd)); | 5320 EXPECT_EQ(error::kNoError, ExecuteCmd(copy_cmd)); |
| 5295 EXPECT_EQ(GL_INVALID_OPERATION, GetGLError()); | 5321 EXPECT_EQ(GL_INVALID_OPERATION, GetGLError()); |
| 5296 } | 5322 } |
| 5297 | 5323 |
| 5298 TEST_F(GLES2DecoderManualInitTest, GetCompressedTextureFormatsETC1) { | 5324 TEST_F(GLES2DecoderManualInitTest, GetCompressedTextureFormatsETC1) { |
| 5299 InitDecoder( | 5325 InitDecoder( |
| 5300 "GL_OES_compressed_ETC1_RGB8_texture", // extensions | 5326 "GL_OES_compressed_ETC1_RGB8_texture", // extensions |
| 5327 "opengl es 2.0", // gl version |
| 5301 false, // has alpha | 5328 false, // has alpha |
| 5302 false, // has depth | 5329 false, // has depth |
| 5303 false, // has stencil | 5330 false, // has stencil |
| 5304 false, // request alpha | 5331 false, // request alpha |
| 5305 false, // request depth | 5332 false, // request depth |
| 5306 false, // request stencil | 5333 false, // request stencil |
| 5307 true); // bind generates resource | 5334 true); // bind generates resource |
| 5308 | 5335 |
| 5309 EXPECT_CALL(*gl_, GetError()) | 5336 EXPECT_CALL(*gl_, GetError()) |
| 5310 .WillOnce(Return(GL_NO_ERROR)) | 5337 .WillOnce(Return(GL_NO_ERROR)) |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5366 0, sizeof(ProgramInfoHeader)); | 5393 0, sizeof(ProgramInfoHeader)); |
| 5367 ASSERT_TRUE(info != 0); | 5394 ASSERT_TRUE(info != 0); |
| 5368 EXPECT_EQ(0u, info->link_status); | 5395 EXPECT_EQ(0u, info->link_status); |
| 5369 EXPECT_EQ(0u, info->num_attribs); | 5396 EXPECT_EQ(0u, info->num_attribs); |
| 5370 EXPECT_EQ(0u, info->num_uniforms); | 5397 EXPECT_EQ(0u, info->num_uniforms); |
| 5371 } | 5398 } |
| 5372 | 5399 |
| 5373 TEST_F(GLES2DecoderManualInitTest, EGLImageExternalBindTexture) { | 5400 TEST_F(GLES2DecoderManualInitTest, EGLImageExternalBindTexture) { |
| 5374 InitDecoder( | 5401 InitDecoder( |
| 5375 "GL_OES_EGL_image_external", // extensions | 5402 "GL_OES_EGL_image_external", // extensions |
| 5403 "opengl es 2.0", // gl version |
| 5376 false, // has alpha | 5404 false, // has alpha |
| 5377 false, // has depth | 5405 false, // has depth |
| 5378 false, // has stencil | 5406 false, // has stencil |
| 5379 false, // request alpha | 5407 false, // request alpha |
| 5380 false, // request depth | 5408 false, // request depth |
| 5381 false, // request stencil | 5409 false, // request stencil |
| 5382 true); // bind generates resource | 5410 true); // bind generates resource |
| 5383 EXPECT_CALL(*gl_, BindTexture(GL_TEXTURE_EXTERNAL_OES, kNewServiceId)); | 5411 EXPECT_CALL(*gl_, BindTexture(GL_TEXTURE_EXTERNAL_OES, kNewServiceId)); |
| 5384 EXPECT_CALL(*gl_, GenTextures(1, _)) | 5412 EXPECT_CALL(*gl_, GenTextures(1, _)) |
| 5385 .WillOnce(SetArgumentPointee<1>(kNewServiceId)); | 5413 .WillOnce(SetArgumentPointee<1>(kNewServiceId)); |
| 5386 BindTexture cmd; | 5414 BindTexture cmd; |
| 5387 cmd.Init(GL_TEXTURE_EXTERNAL_OES, kNewClientId); | 5415 cmd.Init(GL_TEXTURE_EXTERNAL_OES, kNewClientId); |
| 5388 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 5416 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 5389 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 5417 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 5390 TextureRef* texture_ref = GetTexture(kNewClientId); | 5418 TextureRef* texture_ref = GetTexture(kNewClientId); |
| 5391 EXPECT_TRUE(texture_ref != NULL); | 5419 EXPECT_TRUE(texture_ref != NULL); |
| 5392 EXPECT_TRUE(texture_ref->texture()->target() == GL_TEXTURE_EXTERNAL_OES); | 5420 EXPECT_TRUE(texture_ref->texture()->target() == GL_TEXTURE_EXTERNAL_OES); |
| 5393 } | 5421 } |
| 5394 | 5422 |
| 5395 TEST_F(GLES2DecoderManualInitTest, EGLImageExternalGetBinding) { | 5423 TEST_F(GLES2DecoderManualInitTest, EGLImageExternalGetBinding) { |
| 5396 InitDecoder( | 5424 InitDecoder( |
| 5397 "GL_OES_EGL_image_external", // extensions | 5425 "GL_OES_EGL_image_external", // extensions |
| 5426 "opengl es 2.0", // gl version |
| 5398 false, // has alpha | 5427 false, // has alpha |
| 5399 false, // has depth | 5428 false, // has depth |
| 5400 false, // has stencil | 5429 false, // has stencil |
| 5401 false, // request alpha | 5430 false, // request alpha |
| 5402 false, // request depth | 5431 false, // request depth |
| 5403 false, // request stencil | 5432 false, // request stencil |
| 5404 true); // bind generates resource | 5433 true); // bind generates resource |
| 5405 DoBindTexture(GL_TEXTURE_EXTERNAL_OES, client_texture_id_, kServiceTextureId); | 5434 DoBindTexture(GL_TEXTURE_EXTERNAL_OES, client_texture_id_, kServiceTextureId); |
| 5406 | 5435 |
| 5407 EXPECT_CALL(*gl_, GetError()) | 5436 EXPECT_CALL(*gl_, GetError()) |
| (...skipping 13 matching lines...) Expand all Loading... |
| 5421 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 5450 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 5422 EXPECT_EQ(decoder_->GetGLES2Util()->GLGetNumValuesReturned( | 5451 EXPECT_EQ(decoder_->GetGLES2Util()->GLGetNumValuesReturned( |
| 5423 GL_TEXTURE_BINDING_EXTERNAL_OES), result->GetNumResults()); | 5452 GL_TEXTURE_BINDING_EXTERNAL_OES), result->GetNumResults()); |
| 5424 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 5453 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 5425 EXPECT_EQ(client_texture_id_, (uint32)result->GetData()[0]); | 5454 EXPECT_EQ(client_texture_id_, (uint32)result->GetData()[0]); |
| 5426 } | 5455 } |
| 5427 | 5456 |
| 5428 TEST_F(GLES2DecoderManualInitTest, EGLImageExternalTextureDefaults) { | 5457 TEST_F(GLES2DecoderManualInitTest, EGLImageExternalTextureDefaults) { |
| 5429 InitDecoder( | 5458 InitDecoder( |
| 5430 "GL_OES_EGL_image_external", // extensions | 5459 "GL_OES_EGL_image_external", // extensions |
| 5460 "opengl es 2.0", // gl version |
| 5431 false, // has alpha | 5461 false, // has alpha |
| 5432 false, // has depth | 5462 false, // has depth |
| 5433 false, // has stencil | 5463 false, // has stencil |
| 5434 false, // request alpha | 5464 false, // request alpha |
| 5435 false, // request depth | 5465 false, // request depth |
| 5436 false, // request stencil | 5466 false, // request stencil |
| 5437 true); // bind generates resource | 5467 true); // bind generates resource |
| 5438 DoBindTexture(GL_TEXTURE_EXTERNAL_OES, client_texture_id_, kServiceTextureId); | 5468 DoBindTexture(GL_TEXTURE_EXTERNAL_OES, client_texture_id_, kServiceTextureId); |
| 5439 | 5469 |
| 5440 TextureRef* texture_ref = GetTexture(client_texture_id_); | 5470 TextureRef* texture_ref = GetTexture(client_texture_id_); |
| 5441 EXPECT_TRUE(texture_ref != NULL); | 5471 EXPECT_TRUE(texture_ref != NULL); |
| 5442 Texture* texture = texture_ref->texture(); | 5472 Texture* texture = texture_ref->texture(); |
| 5443 EXPECT_TRUE(texture->target() == GL_TEXTURE_EXTERNAL_OES); | 5473 EXPECT_TRUE(texture->target() == GL_TEXTURE_EXTERNAL_OES); |
| 5444 EXPECT_TRUE(texture->min_filter() == GL_LINEAR); | 5474 EXPECT_TRUE(texture->min_filter() == GL_LINEAR); |
| 5445 EXPECT_TRUE(texture->wrap_s() == GL_CLAMP_TO_EDGE); | 5475 EXPECT_TRUE(texture->wrap_s() == GL_CLAMP_TO_EDGE); |
| 5446 EXPECT_TRUE(texture->wrap_t() == GL_CLAMP_TO_EDGE); | 5476 EXPECT_TRUE(texture->wrap_t() == GL_CLAMP_TO_EDGE); |
| 5447 } | 5477 } |
| 5448 | 5478 |
| 5449 TEST_F(GLES2DecoderManualInitTest, EGLImageExternalTextureParam) { | 5479 TEST_F(GLES2DecoderManualInitTest, EGLImageExternalTextureParam) { |
| 5450 InitDecoder( | 5480 InitDecoder( |
| 5451 "GL_OES_EGL_image_external", // extensions | 5481 "GL_OES_EGL_image_external", // extensions |
| 5482 "opengl es 2.0", // gl version |
| 5452 false, // has alpha | 5483 false, // has alpha |
| 5453 false, // has depth | 5484 false, // has depth |
| 5454 false, // has stencil | 5485 false, // has stencil |
| 5455 false, // request alpha | 5486 false, // request alpha |
| 5456 false, // request depth | 5487 false, // request depth |
| 5457 false, // request stencil | 5488 false, // request stencil |
| 5458 true); // bind generates resource | 5489 true); // bind generates resource |
| 5459 | 5490 |
| 5460 DoBindTexture(GL_TEXTURE_EXTERNAL_OES, client_texture_id_, kServiceTextureId); | 5491 DoBindTexture(GL_TEXTURE_EXTERNAL_OES, client_texture_id_, kServiceTextureId); |
| 5461 | 5492 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5501 Texture* texture = texture_ref->texture(); | 5532 Texture* texture = texture_ref->texture(); |
| 5502 EXPECT_TRUE(texture->target() == GL_TEXTURE_EXTERNAL_OES); | 5533 EXPECT_TRUE(texture->target() == GL_TEXTURE_EXTERNAL_OES); |
| 5503 EXPECT_TRUE(texture->min_filter() == GL_LINEAR); | 5534 EXPECT_TRUE(texture->min_filter() == GL_LINEAR); |
| 5504 EXPECT_TRUE(texture->wrap_s() == GL_CLAMP_TO_EDGE); | 5535 EXPECT_TRUE(texture->wrap_s() == GL_CLAMP_TO_EDGE); |
| 5505 EXPECT_TRUE(texture->wrap_t() == GL_CLAMP_TO_EDGE); | 5536 EXPECT_TRUE(texture->wrap_t() == GL_CLAMP_TO_EDGE); |
| 5506 } | 5537 } |
| 5507 | 5538 |
| 5508 TEST_F(GLES2DecoderManualInitTest, EGLImageExternalTextureParamInvalid) { | 5539 TEST_F(GLES2DecoderManualInitTest, EGLImageExternalTextureParamInvalid) { |
| 5509 InitDecoder( | 5540 InitDecoder( |
| 5510 "GL_OES_EGL_image_external", // extensions | 5541 "GL_OES_EGL_image_external", // extensions |
| 5542 "opengl es 2.0", // gl version |
| 5511 false, // has alpha | 5543 false, // has alpha |
| 5512 false, // has depth | 5544 false, // has depth |
| 5513 false, // has stencil | 5545 false, // has stencil |
| 5514 false, // request alpha | 5546 false, // request alpha |
| 5515 false, // request depth | 5547 false, // request depth |
| 5516 false, // request stencil | 5548 false, // request stencil |
| 5517 true); // bind generates resource | 5549 true); // bind generates resource |
| 5518 | 5550 |
| 5519 DoBindTexture(GL_TEXTURE_EXTERNAL_OES, client_texture_id_, kServiceTextureId); | 5551 DoBindTexture(GL_TEXTURE_EXTERNAL_OES, client_texture_id_, kServiceTextureId); |
| 5520 | 5552 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 5542 Texture* texture = texture_ref->texture(); | 5574 Texture* texture = texture_ref->texture(); |
| 5543 EXPECT_TRUE(texture->target() == GL_TEXTURE_EXTERNAL_OES); | 5575 EXPECT_TRUE(texture->target() == GL_TEXTURE_EXTERNAL_OES); |
| 5544 EXPECT_TRUE(texture->min_filter() == GL_LINEAR); | 5576 EXPECT_TRUE(texture->min_filter() == GL_LINEAR); |
| 5545 EXPECT_TRUE(texture->wrap_s() == GL_CLAMP_TO_EDGE); | 5577 EXPECT_TRUE(texture->wrap_s() == GL_CLAMP_TO_EDGE); |
| 5546 EXPECT_TRUE(texture->wrap_t() == GL_CLAMP_TO_EDGE); | 5578 EXPECT_TRUE(texture->wrap_t() == GL_CLAMP_TO_EDGE); |
| 5547 } | 5579 } |
| 5548 | 5580 |
| 5549 TEST_F(GLES2DecoderManualInitTest, EGLImageExternalTexImage2DError) { | 5581 TEST_F(GLES2DecoderManualInitTest, EGLImageExternalTexImage2DError) { |
| 5550 InitDecoder( | 5582 InitDecoder( |
| 5551 "GL_OES_EGL_image_external", // extensions | 5583 "GL_OES_EGL_image_external", // extensions |
| 5584 "opengl es 2.0", // gl version |
| 5552 false, // has alpha | 5585 false, // has alpha |
| 5553 false, // has depth | 5586 false, // has depth |
| 5554 false, // has stencil | 5587 false, // has stencil |
| 5555 false, // request alpha | 5588 false, // request alpha |
| 5556 false, // request depth | 5589 false, // request depth |
| 5557 false, // request stencil | 5590 false, // request stencil |
| 5558 true); // bind generates resource | 5591 true); // bind generates resource |
| 5559 | 5592 |
| 5560 GLenum target = GL_TEXTURE_EXTERNAL_OES; | 5593 GLenum target = GL_TEXTURE_EXTERNAL_OES; |
| 5561 GLint level = 0; | 5594 GLint level = 0; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 5572 type, kSharedMemoryId, kSharedMemoryOffset); | 5605 type, kSharedMemoryId, kSharedMemoryOffset); |
| 5573 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 5606 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 5574 | 5607 |
| 5575 // TexImage2D is not allowed with GL_TEXTURE_EXTERNAL_OES targets. | 5608 // TexImage2D is not allowed with GL_TEXTURE_EXTERNAL_OES targets. |
| 5576 EXPECT_EQ(GL_INVALID_ENUM, GetGLError()); | 5609 EXPECT_EQ(GL_INVALID_ENUM, GetGLError()); |
| 5577 } | 5610 } |
| 5578 | 5611 |
| 5579 TEST_F(GLES2DecoderManualInitTest, BindGeneratesResourceFalse) { | 5612 TEST_F(GLES2DecoderManualInitTest, BindGeneratesResourceFalse) { |
| 5580 InitDecoder( | 5613 InitDecoder( |
| 5581 "", // extensions | 5614 "", // extensions |
| 5615 "3.0", // gl version |
| 5582 false, // has alpha | 5616 false, // has alpha |
| 5583 false, // has depth | 5617 false, // has depth |
| 5584 false, // has stencil | 5618 false, // has stencil |
| 5585 false, // request alpha | 5619 false, // request alpha |
| 5586 false, // request depth | 5620 false, // request depth |
| 5587 false, // request stencil | 5621 false, // request stencil |
| 5588 false); // bind generates resource | 5622 false); // bind generates resource |
| 5589 | 5623 |
| 5590 BindTexture cmd1; | 5624 BindTexture cmd1; |
| 5591 cmd1.Init(GL_TEXTURE_2D, kInvalidClientId); | 5625 cmd1.Init(GL_TEXTURE_2D, kInvalidClientId); |
| 5592 EXPECT_NE(error::kNoError, ExecuteCmd(cmd1)); | 5626 EXPECT_NE(error::kNoError, ExecuteCmd(cmd1)); |
| 5593 | 5627 |
| 5594 BindBuffer cmd2; | 5628 BindBuffer cmd2; |
| 5595 cmd2.Init(GL_ARRAY_BUFFER, kInvalidClientId); | 5629 cmd2.Init(GL_ARRAY_BUFFER, kInvalidClientId); |
| 5596 EXPECT_NE(error::kNoError, ExecuteCmd(cmd2)); | 5630 EXPECT_NE(error::kNoError, ExecuteCmd(cmd2)); |
| 5597 | 5631 |
| 5598 BindFramebuffer cmd3; | 5632 BindFramebuffer cmd3; |
| 5599 cmd3.Init(GL_FRAMEBUFFER, kInvalidClientId); | 5633 cmd3.Init(GL_FRAMEBUFFER, kInvalidClientId); |
| 5600 EXPECT_NE(error::kNoError, ExecuteCmd(cmd3)); | 5634 EXPECT_NE(error::kNoError, ExecuteCmd(cmd3)); |
| 5601 | 5635 |
| 5602 BindRenderbuffer cmd4; | 5636 BindRenderbuffer cmd4; |
| 5603 cmd4.Init(GL_RENDERBUFFER, kInvalidClientId); | 5637 cmd4.Init(GL_RENDERBUFFER, kInvalidClientId); |
| 5604 EXPECT_NE(error::kNoError, ExecuteCmd(cmd4)); | 5638 EXPECT_NE(error::kNoError, ExecuteCmd(cmd4)); |
| 5605 } | 5639 } |
| 5606 | 5640 |
| 5607 TEST_F(GLES2DecoderManualInitTest, CreateStreamTextureCHROMIUM) { | 5641 TEST_F(GLES2DecoderManualInitTest, CreateStreamTextureCHROMIUM) { |
| 5608 const GLuint kObjectId = 123; | 5642 const GLuint kObjectId = 123; |
| 5609 InitDecoder( | 5643 InitDecoder( |
| 5610 "GL_CHROMIUM_stream_texture", // extensions | 5644 "GL_CHROMIUM_stream_texture", // extensions |
| 5645 "3.0", // gl version |
| 5611 false, // has alpha | 5646 false, // has alpha |
| 5612 false, // has depth | 5647 false, // has depth |
| 5613 false, // has stencil | 5648 false, // has stencil |
| 5614 false, // request alpha | 5649 false, // request alpha |
| 5615 false, // request depth | 5650 false, // request depth |
| 5616 false, // request stencil | 5651 false, // request stencil |
| 5617 true); // bind generates resource | 5652 true); // bind generates resource |
| 5618 | 5653 |
| 5619 EXPECT_CALL(*stream_texture_manager(), CreateStreamTexture( | 5654 EXPECT_CALL(*stream_texture_manager(), CreateStreamTexture( |
| 5620 kServiceTextureId, client_texture_id_)) | 5655 kServiceTextureId, client_texture_id_)) |
| (...skipping 12 matching lines...) Expand all Loading... |
| 5633 EXPECT_TRUE(texture_ref->texture()->IsStreamTexture()); | 5668 EXPECT_TRUE(texture_ref->texture()->IsStreamTexture()); |
| 5634 EXPECT_CALL(*stream_texture_manager(), | 5669 EXPECT_CALL(*stream_texture_manager(), |
| 5635 DestroyStreamTexture(kServiceTextureId)) | 5670 DestroyStreamTexture(kServiceTextureId)) |
| 5636 .Times(1) | 5671 .Times(1) |
| 5637 .RetiresOnSaturation(); | 5672 .RetiresOnSaturation(); |
| 5638 } | 5673 } |
| 5639 | 5674 |
| 5640 TEST_F(GLES2DecoderManualInitTest, CreateStreamTextureCHROMIUMBadId) { | 5675 TEST_F(GLES2DecoderManualInitTest, CreateStreamTextureCHROMIUMBadId) { |
| 5641 InitDecoder( | 5676 InitDecoder( |
| 5642 "GL_CHROMIUM_stream_texture", // extensions | 5677 "GL_CHROMIUM_stream_texture", // extensions |
| 5678 "3.0", // gl version |
| 5643 false, // has alpha | 5679 false, // has alpha |
| 5644 false, // has depth | 5680 false, // has depth |
| 5645 false, // has stencil | 5681 false, // has stencil |
| 5646 false, // request alpha | 5682 false, // request alpha |
| 5647 false, // request depth | 5683 false, // request depth |
| 5648 false, // request stencil | 5684 false, // request stencil |
| 5649 true); // bind generates resource | 5685 true); // bind generates resource |
| 5650 | 5686 |
| 5651 CreateStreamTextureCHROMIUM cmd; | 5687 CreateStreamTextureCHROMIUM cmd; |
| 5652 CreateStreamTextureCHROMIUM::Result* result = | 5688 CreateStreamTextureCHROMIUM::Result* result = |
| 5653 static_cast<CreateStreamTextureCHROMIUM::Result*>(shared_memory_address_); | 5689 static_cast<CreateStreamTextureCHROMIUM::Result*>(shared_memory_address_); |
| 5654 cmd.Init(kNewClientId, shared_memory_id_, shared_memory_offset_); | 5690 cmd.Init(kNewClientId, shared_memory_id_, shared_memory_offset_); |
| 5655 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 5691 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 5656 EXPECT_EQ(static_cast<GLuint>(GL_ZERO), *result); | 5692 EXPECT_EQ(static_cast<GLuint>(GL_ZERO), *result); |
| 5657 EXPECT_EQ(GL_INVALID_VALUE, GetGLError()); | 5693 EXPECT_EQ(GL_INVALID_VALUE, GetGLError()); |
| 5658 } | 5694 } |
| 5659 | 5695 |
| 5660 TEST_F(GLES2DecoderManualInitTest, CreateStreamTextureCHROMIUMAlreadyBound) { | 5696 TEST_F(GLES2DecoderManualInitTest, CreateStreamTextureCHROMIUMAlreadyBound) { |
| 5661 InitDecoder( | 5697 InitDecoder( |
| 5662 "GL_CHROMIUM_stream_texture", // extensions | 5698 "GL_CHROMIUM_stream_texture", // extensions |
| 5699 "3.0", // gl version |
| 5663 false, // has alpha | 5700 false, // has alpha |
| 5664 false, // has depth | 5701 false, // has depth |
| 5665 false, // has stencil | 5702 false, // has stencil |
| 5666 false, // request alpha | 5703 false, // request alpha |
| 5667 false, // request depth | 5704 false, // request depth |
| 5668 false, // request stencil | 5705 false, // request stencil |
| 5669 true); // bind generates resource | 5706 true); // bind generates resource |
| 5670 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); | 5707 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); |
| 5671 | 5708 |
| 5672 CreateStreamTextureCHROMIUM cmd; | 5709 CreateStreamTextureCHROMIUM cmd; |
| 5673 CreateStreamTextureCHROMIUM::Result* result = | 5710 CreateStreamTextureCHROMIUM::Result* result = |
| 5674 static_cast<CreateStreamTextureCHROMIUM::Result*>(shared_memory_address_); | 5711 static_cast<CreateStreamTextureCHROMIUM::Result*>(shared_memory_address_); |
| 5675 cmd.Init(client_texture_id_, shared_memory_id_, shared_memory_offset_); | 5712 cmd.Init(client_texture_id_, shared_memory_id_, shared_memory_offset_); |
| 5676 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 5713 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 5677 EXPECT_EQ(static_cast<GLuint>(GL_ZERO), *result); | 5714 EXPECT_EQ(static_cast<GLuint>(GL_ZERO), *result); |
| 5678 EXPECT_EQ(GL_INVALID_OPERATION, GetGLError()); | 5715 EXPECT_EQ(GL_INVALID_OPERATION, GetGLError()); |
| 5679 } | 5716 } |
| 5680 | 5717 |
| 5681 TEST_F(GLES2DecoderManualInitTest, CreateStreamTextureCHROMIUMAlreadySet) { | 5718 TEST_F(GLES2DecoderManualInitTest, CreateStreamTextureCHROMIUMAlreadySet) { |
| 5682 InitDecoder( | 5719 InitDecoder( |
| 5683 "GL_CHROMIUM_stream_texture", // extensions | 5720 "GL_CHROMIUM_stream_texture", // extensions |
| 5721 "3.0", // gl version |
| 5684 false, // has alpha | 5722 false, // has alpha |
| 5685 false, // has depth | 5723 false, // has depth |
| 5686 false, // has stencil | 5724 false, // has stencil |
| 5687 false, // request alpha | 5725 false, // request alpha |
| 5688 false, // request depth | 5726 false, // request depth |
| 5689 false, // request stencil | 5727 false, // request stencil |
| 5690 true); // bind generates resource | 5728 true); // bind generates resource |
| 5691 | 5729 |
| 5692 TextureRef* texture_ref = GetTexture(client_texture_id_); | 5730 TextureRef* texture_ref = GetTexture(client_texture_id_); |
| 5693 group().texture_manager()->SetStreamTexture(texture_ref, true); | 5731 group().texture_manager()->SetStreamTexture(texture_ref, true); |
| 5694 | 5732 |
| 5695 CreateStreamTextureCHROMIUM cmd; | 5733 CreateStreamTextureCHROMIUM cmd; |
| 5696 cmd.Init(client_texture_id_, shared_memory_id_, shared_memory_offset_); | 5734 cmd.Init(client_texture_id_, shared_memory_id_, shared_memory_offset_); |
| 5697 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 5735 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 5698 EXPECT_EQ(GL_INVALID_OPERATION, GetGLError()); | 5736 EXPECT_EQ(GL_INVALID_OPERATION, GetGLError()); |
| 5699 | 5737 |
| 5700 EXPECT_CALL(*stream_texture_manager(), | 5738 EXPECT_CALL(*stream_texture_manager(), |
| 5701 DestroyStreamTexture(kServiceTextureId)) | 5739 DestroyStreamTexture(kServiceTextureId)) |
| 5702 .Times(1) | 5740 .Times(1) |
| 5703 .RetiresOnSaturation(); | 5741 .RetiresOnSaturation(); |
| 5704 } | 5742 } |
| 5705 | 5743 |
| 5706 TEST_F(GLES2DecoderManualInitTest, DrawStreamTextureCHROMIUM) { | 5744 TEST_F(GLES2DecoderManualInitTest, DrawStreamTextureCHROMIUM) { |
| 5707 InitDecoder( | 5745 InitDecoder( |
| 5708 "GL_CHROMIUM_stream_texture GL_OES_EGL_image_external", // extensions | 5746 "GL_CHROMIUM_stream_texture GL_OES_EGL_image_external", // extensions |
| 5747 "opengl es 2.0", // gl version |
| 5709 true, // has alpha | 5748 true, // has alpha |
| 5710 true, // has depth | 5749 true, // has depth |
| 5711 false, // has stencil | 5750 false, // has stencil |
| 5712 true, // request alpha | 5751 true, // request alpha |
| 5713 true, // request depth | 5752 true, // request depth |
| 5714 false, // request stencil | 5753 false, // request stencil |
| 5715 true); // bind generates resource | 5754 true); // bind generates resource |
| 5716 | 5755 |
| 5717 StrictMock<MockStreamTexture> stream_texture; | 5756 StrictMock<MockStreamTexture> stream_texture; |
| 5718 | 5757 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 5748 | 5787 |
| 5749 EXPECT_CALL(*stream_texture_manager(), | 5788 EXPECT_CALL(*stream_texture_manager(), |
| 5750 DestroyStreamTexture(kServiceTextureId)) | 5789 DestroyStreamTexture(kServiceTextureId)) |
| 5751 .Times(1) | 5790 .Times(1) |
| 5752 .RetiresOnSaturation(); | 5791 .RetiresOnSaturation(); |
| 5753 } | 5792 } |
| 5754 | 5793 |
| 5755 TEST_F(GLES2DecoderManualInitTest, BindStreamTextureCHROMIUMInvalid) { | 5794 TEST_F(GLES2DecoderManualInitTest, BindStreamTextureCHROMIUMInvalid) { |
| 5756 InitDecoder( | 5795 InitDecoder( |
| 5757 "GL_CHROMIUM_stream_texture", // extensions | 5796 "GL_CHROMIUM_stream_texture", // extensions |
| 5797 "3.0", // gl version |
| 5758 false, // has alpha | 5798 false, // has alpha |
| 5759 false, // has depth | 5799 false, // has depth |
| 5760 false, // has stencil | 5800 false, // has stencil |
| 5761 false, // request alpha | 5801 false, // request alpha |
| 5762 false, // request depth | 5802 false, // request depth |
| 5763 false, // request stencil | 5803 false, // request stencil |
| 5764 true); // bind generates resource | 5804 true); // bind generates resource |
| 5765 | 5805 |
| 5766 TextureRef* texture_ref = GetTexture(client_texture_id_); | 5806 TextureRef* texture_ref = GetTexture(client_texture_id_); |
| 5767 group().texture_manager()->SetStreamTexture(texture_ref, true); | 5807 group().texture_manager()->SetStreamTexture(texture_ref, true); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 5778 | 5818 |
| 5779 EXPECT_CALL(*stream_texture_manager(), | 5819 EXPECT_CALL(*stream_texture_manager(), |
| 5780 DestroyStreamTexture(kServiceTextureId)) | 5820 DestroyStreamTexture(kServiceTextureId)) |
| 5781 .Times(1) | 5821 .Times(1) |
| 5782 .RetiresOnSaturation(); | 5822 .RetiresOnSaturation(); |
| 5783 } | 5823 } |
| 5784 | 5824 |
| 5785 TEST_F(GLES2DecoderManualInitTest, DestroyStreamTextureCHROMIUM) { | 5825 TEST_F(GLES2DecoderManualInitTest, DestroyStreamTextureCHROMIUM) { |
| 5786 InitDecoder( | 5826 InitDecoder( |
| 5787 "GL_CHROMIUM_stream_texture", // extensions | 5827 "GL_CHROMIUM_stream_texture", // extensions |
| 5828 "3.0", // gl version |
| 5788 false, // has alpha | 5829 false, // has alpha |
| 5789 false, // has depth | 5830 false, // has depth |
| 5790 false, // has stencil | 5831 false, // has stencil |
| 5791 false, // request alpha | 5832 false, // request alpha |
| 5792 false, // request depth | 5833 false, // request depth |
| 5793 false, // request stencil | 5834 false, // request stencil |
| 5794 true); // bind generates resource | 5835 true); // bind generates resource |
| 5795 | 5836 |
| 5796 TextureRef* texture_ref = GetTexture(client_texture_id_); | 5837 TextureRef* texture_ref = GetTexture(client_texture_id_); |
| 5797 group().texture_manager()->SetStreamTexture(texture_ref, true); | 5838 group().texture_manager()->SetStreamTexture(texture_ref, true); |
| 5798 | 5839 |
| 5799 EXPECT_CALL(*stream_texture_manager(), | 5840 EXPECT_CALL(*stream_texture_manager(), |
| 5800 DestroyStreamTexture(kServiceTextureId)) | 5841 DestroyStreamTexture(kServiceTextureId)) |
| 5801 .Times(1) | 5842 .Times(1) |
| 5802 .RetiresOnSaturation(); | 5843 .RetiresOnSaturation(); |
| 5803 | 5844 |
| 5804 DestroyStreamTextureCHROMIUM cmd; | 5845 DestroyStreamTextureCHROMIUM cmd; |
| 5805 cmd.Init(client_texture_id_); | 5846 cmd.Init(client_texture_id_); |
| 5806 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 5847 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 5807 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 5848 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 5808 EXPECT_FALSE(texture_ref->texture()->IsStreamTexture()); | 5849 EXPECT_FALSE(texture_ref->texture()->IsStreamTexture()); |
| 5809 EXPECT_EQ(0U, texture_ref->texture()->target()); | 5850 EXPECT_EQ(0U, texture_ref->texture()->target()); |
| 5810 } | 5851 } |
| 5811 | 5852 |
| 5812 TEST_F(GLES2DecoderManualInitTest, DestroyStreamTextureCHROMIUMInvalid) { | 5853 TEST_F(GLES2DecoderManualInitTest, DestroyStreamTextureCHROMIUMInvalid) { |
| 5813 InitDecoder( | 5854 InitDecoder( |
| 5814 "GL_CHROMIUM_stream_texture", // extensions | 5855 "GL_CHROMIUM_stream_texture", // extensions |
| 5856 "3.0", // gl version |
| 5815 false, // has alpha | 5857 false, // has alpha |
| 5816 false, // has depth | 5858 false, // has depth |
| 5817 false, // has stencil | 5859 false, // has stencil |
| 5818 false, // request alpha | 5860 false, // request alpha |
| 5819 false, // request depth | 5861 false, // request depth |
| 5820 false, // request stencil | 5862 false, // request stencil |
| 5821 true); // bind generates resource | 5863 true); // bind generates resource |
| 5822 | 5864 |
| 5823 DestroyStreamTextureCHROMIUM cmd; | 5865 DestroyStreamTextureCHROMIUM cmd; |
| 5824 cmd.Init(client_texture_id_); | 5866 cmd.Init(client_texture_id_); |
| 5825 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 5867 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 5826 EXPECT_EQ(GL_INVALID_VALUE, GetGLError()); | 5868 EXPECT_EQ(GL_INVALID_VALUE, GetGLError()); |
| 5827 } | 5869 } |
| 5828 | 5870 |
| 5829 TEST_F(GLES2DecoderManualInitTest, DestroyStreamTextureCHROMIUMBadId) { | 5871 TEST_F(GLES2DecoderManualInitTest, DestroyStreamTextureCHROMIUMBadId) { |
| 5830 InitDecoder( | 5872 InitDecoder( |
| 5831 "GL_CHROMIUM_stream_texture", // extensions | 5873 "GL_CHROMIUM_stream_texture", // extensions |
| 5874 "3.0", // gl version |
| 5832 false, // has alpha | 5875 false, // has alpha |
| 5833 false, // has depth | 5876 false, // has depth |
| 5834 false, // has stencil | 5877 false, // has stencil |
| 5835 false, // request alpha | 5878 false, // request alpha |
| 5836 false, // request depth | 5879 false, // request depth |
| 5837 false, // request stencil | 5880 false, // request stencil |
| 5838 true); // bind generates resource | 5881 true); // bind generates resource |
| 5839 | 5882 |
| 5840 DestroyStreamTextureCHROMIUM cmd; | 5883 DestroyStreamTextureCHROMIUM cmd; |
| 5841 cmd.Init(GL_ZERO); | 5884 cmd.Init(GL_ZERO); |
| 5842 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 5885 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 5843 EXPECT_EQ(GL_INVALID_VALUE, GetGLError()); | 5886 EXPECT_EQ(GL_INVALID_VALUE, GetGLError()); |
| 5844 } | 5887 } |
| 5845 | 5888 |
| 5846 TEST_F(GLES2DecoderManualInitTest, StreamTextureCHROMIUMNullMgr) { | 5889 TEST_F(GLES2DecoderManualInitTest, StreamTextureCHROMIUMNullMgr) { |
| 5847 InitDecoder( | 5890 InitDecoder( |
| 5848 "", // extensions | 5891 "", // extensions |
| 5892 "3.0", // gl version |
| 5849 false, // has alpha | 5893 false, // has alpha |
| 5850 false, // has depth | 5894 false, // has depth |
| 5851 false, // has stencil | 5895 false, // has stencil |
| 5852 false, // request alpha | 5896 false, // request alpha |
| 5853 false, // request depth | 5897 false, // request depth |
| 5854 false, // request stencil | 5898 false, // request stencil |
| 5855 true); // bind generates resource | 5899 true); // bind generates resource |
| 5856 | 5900 |
| 5857 CreateStreamTextureCHROMIUM cmd; | 5901 CreateStreamTextureCHROMIUM cmd; |
| 5858 cmd.Init(client_texture_id_, shared_memory_id_, shared_memory_offset_); | 5902 cmd.Init(client_texture_id_, shared_memory_id_, shared_memory_offset_); |
| 5859 EXPECT_EQ(error::kInvalidArguments, ExecuteCmd(cmd)); | 5903 EXPECT_EQ(error::kInvalidArguments, ExecuteCmd(cmd)); |
| 5860 GetGLError(); // ignore internal error | 5904 GetGLError(); // ignore internal error |
| 5861 | 5905 |
| 5862 TextureRef* texture_ref = GetTexture(client_texture_id_); | 5906 TextureRef* texture_ref = GetTexture(client_texture_id_); |
| 5863 group().texture_manager()->SetStreamTexture(texture_ref, true); | 5907 group().texture_manager()->SetStreamTexture(texture_ref, true); |
| 5864 | 5908 |
| 5865 DestroyStreamTextureCHROMIUM cmd2; | 5909 DestroyStreamTextureCHROMIUM cmd2; |
| 5866 cmd2.Init(client_texture_id_); | 5910 cmd2.Init(client_texture_id_); |
| 5867 EXPECT_EQ(error::kInvalidArguments, ExecuteCmd(cmd2)); | 5911 EXPECT_EQ(error::kInvalidArguments, ExecuteCmd(cmd2)); |
| 5868 GetGLError(); // ignore internal error | 5912 GetGLError(); // ignore internal error |
| 5869 } | 5913 } |
| 5870 | 5914 |
| 5871 TEST_F(GLES2DecoderManualInitTest, ReCreateStreamTextureCHROMIUM) { | 5915 TEST_F(GLES2DecoderManualInitTest, ReCreateStreamTextureCHROMIUM) { |
| 5872 const GLuint kObjectId = 123; | 5916 const GLuint kObjectId = 123; |
| 5873 InitDecoder( | 5917 InitDecoder( |
| 5874 "GL_CHROMIUM_stream_texture GL_OES_EGL_image_external", // extensions | 5918 "GL_CHROMIUM_stream_texture GL_OES_EGL_image_external", // extensions |
| 5919 "opengl es 2.0", // gl version |
| 5875 false, // has alpha | 5920 false, // has alpha |
| 5876 false, // has depth | 5921 false, // has depth |
| 5877 false, // has stencil | 5922 false, // has stencil |
| 5878 false, // request alpha | 5923 false, // request alpha |
| 5879 false, // request depth | 5924 false, // request depth |
| 5880 false, // request stencil | 5925 false, // request stencil |
| 5881 true); // bind generates resource | 5926 true); // bind generates resource |
| 5882 | 5927 |
| 5883 EXPECT_CALL(*stream_texture_manager(), | 5928 EXPECT_CALL(*stream_texture_manager(), |
| 5884 DestroyStreamTexture(kServiceTextureId)) | 5929 DestroyStreamTexture(kServiceTextureId)) |
| (...skipping 24 matching lines...) Expand all Loading... |
| 5909 | 5954 |
| 5910 EXPECT_CALL(*stream_texture_manager(), | 5955 EXPECT_CALL(*stream_texture_manager(), |
| 5911 DestroyStreamTexture(kServiceTextureId)) | 5956 DestroyStreamTexture(kServiceTextureId)) |
| 5912 .Times(1) | 5957 .Times(1) |
| 5913 .RetiresOnSaturation(); | 5958 .RetiresOnSaturation(); |
| 5914 } | 5959 } |
| 5915 | 5960 |
| 5916 TEST_F(GLES2DecoderManualInitTest, ProduceAndConsumeStreamTextureCHROMIUM) { | 5961 TEST_F(GLES2DecoderManualInitTest, ProduceAndConsumeStreamTextureCHROMIUM) { |
| 5917 InitDecoder( | 5962 InitDecoder( |
| 5918 "GL_CHROMIUM_stream_texture GL_OES_EGL_image_external", // extensions | 5963 "GL_CHROMIUM_stream_texture GL_OES_EGL_image_external", // extensions |
| 5964 "opengl es 2.0", // gl version |
| 5919 false, // has alpha | 5965 false, // has alpha |
| 5920 false, // has depth | 5966 false, // has depth |
| 5921 false, // has stencil | 5967 false, // has stencil |
| 5922 false, // request alpha | 5968 false, // request alpha |
| 5923 false, // request depth | 5969 false, // request depth |
| 5924 false, // request stencil | 5970 false, // request stencil |
| 5925 true); // bind generates resource | 5971 true); // bind generates resource |
| 5926 | 5972 |
| 5927 TextureRef* texture_ref = GetTexture(client_texture_id_); | 5973 TextureRef* texture_ref = GetTexture(client_texture_id_); |
| 5928 group().texture_manager()->SetStreamTexture(texture_ref, true); | 5974 group().texture_manager()->SetStreamTexture(texture_ref, true); |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5970 | 6016 |
| 5971 EXPECT_CALL(*stream_texture_manager(), | 6017 EXPECT_CALL(*stream_texture_manager(), |
| 5972 DestroyStreamTexture(kServiceTextureId)) | 6018 DestroyStreamTexture(kServiceTextureId)) |
| 5973 .Times(1) | 6019 .Times(1) |
| 5974 .RetiresOnSaturation(); | 6020 .RetiresOnSaturation(); |
| 5975 } | 6021 } |
| 5976 | 6022 |
| 5977 TEST_F(GLES2DecoderManualInitTest, ARBTextureRectangleBindTexture) { | 6023 TEST_F(GLES2DecoderManualInitTest, ARBTextureRectangleBindTexture) { |
| 5978 InitDecoder( | 6024 InitDecoder( |
| 5979 "GL_ARB_texture_rectangle", // extensions | 6025 "GL_ARB_texture_rectangle", // extensions |
| 6026 "3.0", // gl version |
| 5980 false, // has alpha | 6027 false, // has alpha |
| 5981 false, // has depth | 6028 false, // has depth |
| 5982 false, // has stencil | 6029 false, // has stencil |
| 5983 false, // request alpha | 6030 false, // request alpha |
| 5984 false, // request depth | 6031 false, // request depth |
| 5985 false, // request stencil | 6032 false, // request stencil |
| 5986 true); // bind generates resource | 6033 true); // bind generates resource |
| 5987 EXPECT_CALL(*gl_, BindTexture(GL_TEXTURE_RECTANGLE_ARB, kNewServiceId)); | 6034 EXPECT_CALL(*gl_, BindTexture(GL_TEXTURE_RECTANGLE_ARB, kNewServiceId)); |
| 5988 EXPECT_CALL(*gl_, GenTextures(1, _)) | 6035 EXPECT_CALL(*gl_, GenTextures(1, _)) |
| 5989 .WillOnce(SetArgumentPointee<1>(kNewServiceId)); | 6036 .WillOnce(SetArgumentPointee<1>(kNewServiceId)); |
| 5990 BindTexture cmd; | 6037 BindTexture cmd; |
| 5991 cmd.Init(GL_TEXTURE_RECTANGLE_ARB, kNewClientId); | 6038 cmd.Init(GL_TEXTURE_RECTANGLE_ARB, kNewClientId); |
| 5992 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 6039 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 5993 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 6040 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 5994 Texture* texture = GetTexture(kNewClientId)->texture(); | 6041 Texture* texture = GetTexture(kNewClientId)->texture(); |
| 5995 EXPECT_TRUE(texture != NULL); | 6042 EXPECT_TRUE(texture != NULL); |
| 5996 EXPECT_TRUE(texture->target() == GL_TEXTURE_RECTANGLE_ARB); | 6043 EXPECT_TRUE(texture->target() == GL_TEXTURE_RECTANGLE_ARB); |
| 5997 } | 6044 } |
| 5998 | 6045 |
| 5999 TEST_F(GLES2DecoderManualInitTest, ARBTextureRectangleGetBinding) { | 6046 TEST_F(GLES2DecoderManualInitTest, ARBTextureRectangleGetBinding) { |
| 6000 InitDecoder( | 6047 InitDecoder( |
| 6001 "GL_ARB_texture_rectangle", // extensions | 6048 "GL_ARB_texture_rectangle", // extensions |
| 6049 "3.0", // gl version |
| 6002 false, // has alpha | 6050 false, // has alpha |
| 6003 false, // has depth | 6051 false, // has depth |
| 6004 false, // has stencil | 6052 false, // has stencil |
| 6005 false, // request alpha | 6053 false, // request alpha |
| 6006 false, // request depth | 6054 false, // request depth |
| 6007 false, // request stencil | 6055 false, // request stencil |
| 6008 true); // bind generates resource | 6056 true); // bind generates resource |
| 6009 DoBindTexture( | 6057 DoBindTexture( |
| 6010 GL_TEXTURE_RECTANGLE_ARB, client_texture_id_, kServiceTextureId); | 6058 GL_TEXTURE_RECTANGLE_ARB, client_texture_id_, kServiceTextureId); |
| 6011 | 6059 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 6026 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 6074 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 6027 EXPECT_EQ(decoder_->GetGLES2Util()->GLGetNumValuesReturned( | 6075 EXPECT_EQ(decoder_->GetGLES2Util()->GLGetNumValuesReturned( |
| 6028 GL_TEXTURE_BINDING_RECTANGLE_ARB), result->GetNumResults()); | 6076 GL_TEXTURE_BINDING_RECTANGLE_ARB), result->GetNumResults()); |
| 6029 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 6077 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 6030 EXPECT_EQ(client_texture_id_, (uint32)result->GetData()[0]); | 6078 EXPECT_EQ(client_texture_id_, (uint32)result->GetData()[0]); |
| 6031 } | 6079 } |
| 6032 | 6080 |
| 6033 TEST_F(GLES2DecoderManualInitTest, ARBTextureRectangleTextureDefaults) { | 6081 TEST_F(GLES2DecoderManualInitTest, ARBTextureRectangleTextureDefaults) { |
| 6034 InitDecoder( | 6082 InitDecoder( |
| 6035 "GL_ARB_texture_rectangle", // extensions | 6083 "GL_ARB_texture_rectangle", // extensions |
| 6084 "3.0", // gl version |
| 6036 false, // has alpha | 6085 false, // has alpha |
| 6037 false, // has depth | 6086 false, // has depth |
| 6038 false, // has stencil | 6087 false, // has stencil |
| 6039 false, // request alpha | 6088 false, // request alpha |
| 6040 false, // request depth | 6089 false, // request depth |
| 6041 false, // request stencil | 6090 false, // request stencil |
| 6042 true); // bind generates resource | 6091 true); // bind generates resource |
| 6043 DoBindTexture( | 6092 DoBindTexture( |
| 6044 GL_TEXTURE_RECTANGLE_ARB, client_texture_id_, kServiceTextureId); | 6093 GL_TEXTURE_RECTANGLE_ARB, client_texture_id_, kServiceTextureId); |
| 6045 | 6094 |
| 6046 Texture* texture = GetTexture(client_texture_id_)->texture(); | 6095 Texture* texture = GetTexture(client_texture_id_)->texture(); |
| 6047 EXPECT_TRUE(texture != NULL); | 6096 EXPECT_TRUE(texture != NULL); |
| 6048 EXPECT_TRUE(texture->target() == GL_TEXTURE_RECTANGLE_ARB); | 6097 EXPECT_TRUE(texture->target() == GL_TEXTURE_RECTANGLE_ARB); |
| 6049 EXPECT_TRUE(texture->min_filter() == GL_LINEAR); | 6098 EXPECT_TRUE(texture->min_filter() == GL_LINEAR); |
| 6050 EXPECT_TRUE(texture->wrap_s() == GL_CLAMP_TO_EDGE); | 6099 EXPECT_TRUE(texture->wrap_s() == GL_CLAMP_TO_EDGE); |
| 6051 EXPECT_TRUE(texture->wrap_t() == GL_CLAMP_TO_EDGE); | 6100 EXPECT_TRUE(texture->wrap_t() == GL_CLAMP_TO_EDGE); |
| 6052 } | 6101 } |
| 6053 | 6102 |
| 6054 TEST_F(GLES2DecoderManualInitTest, ARBTextureRectangleTextureParam) { | 6103 TEST_F(GLES2DecoderManualInitTest, ARBTextureRectangleTextureParam) { |
| 6055 InitDecoder( | 6104 InitDecoder( |
| 6056 "GL_ARB_texture_rectangle", // extensions | 6105 "GL_ARB_texture_rectangle", // extensions |
| 6106 "3.0", // gl version |
| 6057 false, // has alpha | 6107 false, // has alpha |
| 6058 false, // has depth | 6108 false, // has depth |
| 6059 false, // has stencil | 6109 false, // has stencil |
| 6060 false, // request alpha | 6110 false, // request alpha |
| 6061 false, // request depth | 6111 false, // request depth |
| 6062 false, // request stencil | 6112 false, // request stencil |
| 6063 true); // bind generates resource | 6113 true); // bind generates resource |
| 6064 | 6114 |
| 6065 DoBindTexture( | 6115 DoBindTexture( |
| 6066 GL_TEXTURE_RECTANGLE_ARB, client_texture_id_, kServiceTextureId); | 6116 GL_TEXTURE_RECTANGLE_ARB, client_texture_id_, kServiceTextureId); |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6106 EXPECT_TRUE(texture != NULL); | 6156 EXPECT_TRUE(texture != NULL); |
| 6107 EXPECT_TRUE(texture->target() == GL_TEXTURE_RECTANGLE_ARB); | 6157 EXPECT_TRUE(texture->target() == GL_TEXTURE_RECTANGLE_ARB); |
| 6108 EXPECT_TRUE(texture->min_filter() == GL_LINEAR); | 6158 EXPECT_TRUE(texture->min_filter() == GL_LINEAR); |
| 6109 EXPECT_TRUE(texture->wrap_s() == GL_CLAMP_TO_EDGE); | 6159 EXPECT_TRUE(texture->wrap_s() == GL_CLAMP_TO_EDGE); |
| 6110 EXPECT_TRUE(texture->wrap_t() == GL_CLAMP_TO_EDGE); | 6160 EXPECT_TRUE(texture->wrap_t() == GL_CLAMP_TO_EDGE); |
| 6111 } | 6161 } |
| 6112 | 6162 |
| 6113 TEST_F(GLES2DecoderManualInitTest, ARBTextureRectangleTextureParamInvalid) { | 6163 TEST_F(GLES2DecoderManualInitTest, ARBTextureRectangleTextureParamInvalid) { |
| 6114 InitDecoder( | 6164 InitDecoder( |
| 6115 "GL_ARB_texture_rectangle", // extensions | 6165 "GL_ARB_texture_rectangle", // extensions |
| 6166 "3.0", // gl version |
| 6116 false, // has alpha | 6167 false, // has alpha |
| 6117 false, // has depth | 6168 false, // has depth |
| 6118 false, // has stencil | 6169 false, // has stencil |
| 6119 false, // request alpha | 6170 false, // request alpha |
| 6120 false, // request depth | 6171 false, // request depth |
| 6121 false, // request stencil | 6172 false, // request stencil |
| 6122 true); // bind generates resource | 6173 true); // bind generates resource |
| 6123 | 6174 |
| 6124 DoBindTexture( | 6175 DoBindTexture( |
| 6125 GL_TEXTURE_RECTANGLE_ARB, client_texture_id_, kServiceTextureId); | 6176 GL_TEXTURE_RECTANGLE_ARB, client_texture_id_, kServiceTextureId); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 6147 EXPECT_TRUE(texture != NULL); | 6198 EXPECT_TRUE(texture != NULL); |
| 6148 EXPECT_TRUE(texture->target() == GL_TEXTURE_RECTANGLE_ARB); | 6199 EXPECT_TRUE(texture->target() == GL_TEXTURE_RECTANGLE_ARB); |
| 6149 EXPECT_TRUE(texture->min_filter() == GL_LINEAR); | 6200 EXPECT_TRUE(texture->min_filter() == GL_LINEAR); |
| 6150 EXPECT_TRUE(texture->wrap_s() == GL_CLAMP_TO_EDGE); | 6201 EXPECT_TRUE(texture->wrap_s() == GL_CLAMP_TO_EDGE); |
| 6151 EXPECT_TRUE(texture->wrap_t() == GL_CLAMP_TO_EDGE); | 6202 EXPECT_TRUE(texture->wrap_t() == GL_CLAMP_TO_EDGE); |
| 6152 } | 6203 } |
| 6153 | 6204 |
| 6154 TEST_F(GLES2DecoderManualInitTest, ARBTextureRectangleTexImage2DError) { | 6205 TEST_F(GLES2DecoderManualInitTest, ARBTextureRectangleTexImage2DError) { |
| 6155 InitDecoder( | 6206 InitDecoder( |
| 6156 "GL_ARB_texture_rectangle", // extensions | 6207 "GL_ARB_texture_rectangle", // extensions |
| 6208 "3.0", // gl version |
| 6157 false, // has alpha | 6209 false, // has alpha |
| 6158 false, // has depth | 6210 false, // has depth |
| 6159 false, // has stencil | 6211 false, // has stencil |
| 6160 false, // request alpha | 6212 false, // request alpha |
| 6161 false, // request depth | 6213 false, // request depth |
| 6162 false, // request stencil | 6214 false, // request stencil |
| 6163 true); // bind generates resource | 6215 true); // bind generates resource |
| 6164 | 6216 |
| 6165 GLenum target = GL_TEXTURE_RECTANGLE_ARB; | 6217 GLenum target = GL_TEXTURE_RECTANGLE_ARB; |
| 6166 GLint level = 0; | 6218 GLint level = 0; |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6250 | 6302 |
| 6251 TEST_F( | 6303 TEST_F( |
| 6252 GLES2DecoderManualInitTest, | 6304 GLES2DecoderManualInitTest, |
| 6253 TexSubImage2DDoesNotClearAfterTexImage2DNULLThenDataWithTexImage2DIsFaster)
{ | 6305 TexSubImage2DDoesNotClearAfterTexImage2DNULLThenDataWithTexImage2DIsFaster)
{ |
| 6254 CommandLine command_line(0, NULL); | 6306 CommandLine command_line(0, NULL); |
| 6255 command_line.AppendSwitchASCII( | 6307 command_line.AppendSwitchASCII( |
| 6256 switches::kGpuDriverBugWorkarounds, | 6308 switches::kGpuDriverBugWorkarounds, |
| 6257 base::IntToString(gpu::TEXSUBIMAGE2D_FASTER_THAN_TEXIMAGE2D)); | 6309 base::IntToString(gpu::TEXSUBIMAGE2D_FASTER_THAN_TEXIMAGE2D)); |
| 6258 InitDecoderWithCommandLine( | 6310 InitDecoderWithCommandLine( |
| 6259 "", // extensions | 6311 "", // extensions |
| 6312 "3.0", // gl version |
| 6260 false, // has alpha | 6313 false, // has alpha |
| 6261 false, // has depth | 6314 false, // has depth |
| 6262 false, // has stencil | 6315 false, // has stencil |
| 6263 false, // request alpha | 6316 false, // request alpha |
| 6264 false, // request depth | 6317 false, // request depth |
| 6265 false, // request stencil | 6318 false, // request stencil |
| 6266 true, // bind generates resource | 6319 true, // bind generates resource |
| 6267 &command_line); | 6320 &command_line); |
| 6268 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); | 6321 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); |
| 6269 DoTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 2, 2, 0, GL_RGBA, GL_UNSIGNED_BYTE, | 6322 DoTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 2, 2, 0, GL_RGBA, GL_UNSIGNED_BYTE, |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6541 .Times(1) | 6594 .Times(1) |
| 6542 .RetiresOnSaturation(); | 6595 .RetiresOnSaturation(); |
| 6543 CopyTexSubImage2D cmd; | 6596 CopyTexSubImage2D cmd; |
| 6544 cmd.Init(GL_TEXTURE_2D, 0, 0, 0, 0, 0, 1, 1); | 6597 cmd.Init(GL_TEXTURE_2D, 0, 0, 0, 0, 0, 1, 1); |
| 6545 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 6598 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 6546 } | 6599 } |
| 6547 | 6600 |
| 6548 TEST_F(GLES2DecoderManualInitTest, CompressedImage2DMarksTextureAsCleared) { | 6601 TEST_F(GLES2DecoderManualInitTest, CompressedImage2DMarksTextureAsCleared) { |
| 6549 InitDecoder( | 6602 InitDecoder( |
| 6550 "GL_EXT_texture_compression_s3tc", // extensions | 6603 "GL_EXT_texture_compression_s3tc", // extensions |
| 6604 "3.0", // gl version |
| 6551 false, // has alpha | 6605 false, // has alpha |
| 6552 false, // has depth | 6606 false, // has depth |
| 6553 false, // has stencil | 6607 false, // has stencil |
| 6554 false, // request alpha | 6608 false, // request alpha |
| 6555 false, // request depth | 6609 false, // request depth |
| 6556 false, // request stencil | 6610 false, // request stencil |
| 6557 true); // bind generates resource | 6611 true); // bind generates resource |
| 6558 | 6612 |
| 6559 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); | 6613 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); |
| 6560 EXPECT_CALL(*gl_, GetError()) | 6614 EXPECT_CALL(*gl_, GetError()) |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6680 result_shm_id, result_shm_offset, | 6734 result_shm_id, result_shm_offset, |
| 6681 false); | 6735 false); |
| 6682 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 6736 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 6683 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 6737 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 6684 } | 6738 } |
| 6685 | 6739 |
| 6686 TEST_F(GLES2DecoderManualInitTest, | 6740 TEST_F(GLES2DecoderManualInitTest, |
| 6687 UnClearedAttachmentsGetClearedOnReadPixelsAndDrawBufferGetsRestored) { | 6741 UnClearedAttachmentsGetClearedOnReadPixelsAndDrawBufferGetsRestored) { |
| 6688 InitDecoder( | 6742 InitDecoder( |
| 6689 "GL_EXT_framebuffer_multisample", // extensions | 6743 "GL_EXT_framebuffer_multisample", // extensions |
| 6744 "2.1", // gl version |
| 6690 false, // has alpha | 6745 false, // has alpha |
| 6691 false, // has depth | 6746 false, // has depth |
| 6692 false, // has stencil | 6747 false, // has stencil |
| 6693 false, // request alpha | 6748 false, // request alpha |
| 6694 false, // request depth | 6749 false, // request depth |
| 6695 false, // request stencil | 6750 false, // request stencil |
| 6696 true); // bind generates resource | 6751 true); // bind generates resource |
| 6697 const GLuint kFBOClientTextureId = 4100; | 6752 const GLuint kFBOClientTextureId = 4100; |
| 6698 const GLuint kFBOServiceTextureId = 4101; | 6753 const GLuint kFBOServiceTextureId = 4101; |
| 6699 | 6754 |
| (...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7132 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 7187 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 7133 } | 7188 } |
| 7134 | 7189 |
| 7135 TEST_F(GLES2DecoderTest, BeginQueryEXTDisabled) { | 7190 TEST_F(GLES2DecoderTest, BeginQueryEXTDisabled) { |
| 7136 // Test something fails if off. | 7191 // Test something fails if off. |
| 7137 } | 7192 } |
| 7138 | 7193 |
| 7139 TEST_F(GLES2DecoderManualInitTest, BeginEndQueryEXT) { | 7194 TEST_F(GLES2DecoderManualInitTest, BeginEndQueryEXT) { |
| 7140 InitDecoder( | 7195 InitDecoder( |
| 7141 "GL_EXT_occlusion_query_boolean", // extensions | 7196 "GL_EXT_occlusion_query_boolean", // extensions |
| 7197 "opengl es 2.0", // gl version |
| 7142 true, // has alpha | 7198 true, // has alpha |
| 7143 false, // has depth | 7199 false, // has depth |
| 7144 false, // has stencil | 7200 false, // has stencil |
| 7145 true, // request alpha | 7201 true, // request alpha |
| 7146 false, // request depth | 7202 false, // request depth |
| 7147 false, // request stencil | 7203 false, // request stencil |
| 7148 true); // bind generates resource | 7204 true); // bind generates resource |
| 7149 | 7205 |
| 7150 // Test end fails if no begin. | 7206 // Test end fails if no begin. |
| 7151 EndQueryEXT end_cmd; | 7207 EndQueryEXT end_cmd; |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7254 !process_success); | 7310 !process_success); |
| 7255 | 7311 |
| 7256 EXPECT_CALL(*gl, DeleteQueriesARB(1, _)) | 7312 EXPECT_CALL(*gl, DeleteQueriesARB(1, _)) |
| 7257 .Times(1) | 7313 .Times(1) |
| 7258 .RetiresOnSaturation(); | 7314 .RetiresOnSaturation(); |
| 7259 } | 7315 } |
| 7260 | 7316 |
| 7261 TEST_F(GLES2DecoderManualInitTest, BeginEndQueryEXTBadMemoryIdFails) { | 7317 TEST_F(GLES2DecoderManualInitTest, BeginEndQueryEXTBadMemoryIdFails) { |
| 7262 InitDecoder( | 7318 InitDecoder( |
| 7263 "GL_EXT_occlusion_query_boolean", // extensions | 7319 "GL_EXT_occlusion_query_boolean", // extensions |
| 7320 "opengl es 2.0", // gl version |
| 7264 true, // has alpha | 7321 true, // has alpha |
| 7265 false, // has depth | 7322 false, // has depth |
| 7266 false, // has stencil | 7323 false, // has stencil |
| 7267 true, // request alpha | 7324 true, // request alpha |
| 7268 false, // request depth | 7325 false, // request depth |
| 7269 false, // request stencil | 7326 false, // request stencil |
| 7270 true); // bind generates resource | 7327 true); // bind generates resource |
| 7271 | 7328 |
| 7272 CheckBeginEndQueryBadMemoryFails( | 7329 CheckBeginEndQueryBadMemoryFails( |
| 7273 this, kNewClientId, kNewServiceId, | 7330 this, kNewClientId, kNewServiceId, |
| 7274 kInvalidSharedMemoryId, kSharedMemoryOffset); | 7331 kInvalidSharedMemoryId, kSharedMemoryOffset); |
| 7275 } | 7332 } |
| 7276 | 7333 |
| 7277 TEST_F(GLES2DecoderManualInitTest, BeginEndQueryEXTBadMemoryOffsetFails) { | 7334 TEST_F(GLES2DecoderManualInitTest, BeginEndQueryEXTBadMemoryOffsetFails) { |
| 7278 InitDecoder( | 7335 InitDecoder( |
| 7279 "GL_EXT_occlusion_query_boolean", // extensions | 7336 "GL_EXT_occlusion_query_boolean", // extensions |
| 7337 "opengl es 2.0", // gl version |
| 7280 true, // has alpha | 7338 true, // has alpha |
| 7281 false, // has depth | 7339 false, // has depth |
| 7282 false, // has stencil | 7340 false, // has stencil |
| 7283 true, // request alpha | 7341 true, // request alpha |
| 7284 false, // request depth | 7342 false, // request depth |
| 7285 false, // request stencil | 7343 false, // request stencil |
| 7286 true); // bind generates resource | 7344 true); // bind generates resource |
| 7287 | 7345 |
| 7288 CheckBeginEndQueryBadMemoryFails( | 7346 CheckBeginEndQueryBadMemoryFails( |
| 7289 this, kNewClientId, kNewServiceId, | 7347 this, kNewClientId, kNewServiceId, |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7467 disable_cmd.Init(state); | 7525 disable_cmd.Init(state); |
| 7468 EXPECT_EQ(error::kNoError, ExecuteCmd(disable_cmd)); | 7526 EXPECT_EQ(error::kNoError, ExecuteCmd(disable_cmd)); |
| 7469 EXPECT_EQ(error::kNoError, ExecuteCmd(is_enabled_cmd)); | 7527 EXPECT_EQ(error::kNoError, ExecuteCmd(is_enabled_cmd)); |
| 7470 EXPECT_EQ(0u, *result); | 7528 EXPECT_EQ(0u, *result); |
| 7471 } | 7529 } |
| 7472 } | 7530 } |
| 7473 | 7531 |
| 7474 TEST_F(GLES2DecoderManualInitTest, DepthTextureBadArgs) { | 7532 TEST_F(GLES2DecoderManualInitTest, DepthTextureBadArgs) { |
| 7475 InitDecoder( | 7533 InitDecoder( |
| 7476 "GL_ANGLE_depth_texture", // extensions | 7534 "GL_ANGLE_depth_texture", // extensions |
| 7535 "opengl es 2.0", // gl version |
| 7477 false, // has alpha | 7536 false, // has alpha |
| 7478 true, // has depth | 7537 true, // has depth |
| 7479 true, // has stencil | 7538 true, // has stencil |
| 7480 false, // request alpha | 7539 false, // request alpha |
| 7481 true, // request depth | 7540 true, // request depth |
| 7482 true, // request stencil | 7541 true, // request stencil |
| 7483 true); // bind generates resource | 7542 true); // bind generates resource |
| 7484 | 7543 |
| 7485 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); | 7544 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); |
| 7486 // Check trying to upload data fails. | 7545 // Check trying to upload data fails. |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7519 // Check that trying to CopyTexSubImage2D fails | 7578 // Check that trying to CopyTexSubImage2D fails |
| 7520 CopyTexSubImage2D copy_sub_cmd; | 7579 CopyTexSubImage2D copy_sub_cmd; |
| 7521 copy_sub_cmd.Init(GL_TEXTURE_2D, 0, 0, 0, 0, 0, 1, 1); | 7580 copy_sub_cmd.Init(GL_TEXTURE_2D, 0, 0, 0, 0, 0, 1, 1); |
| 7522 EXPECT_EQ(error::kNoError, ExecuteCmd(copy_sub_cmd)); | 7581 EXPECT_EQ(error::kNoError, ExecuteCmd(copy_sub_cmd)); |
| 7523 EXPECT_EQ(GL_INVALID_OPERATION, GetGLError()); | 7582 EXPECT_EQ(GL_INVALID_OPERATION, GetGLError()); |
| 7524 } | 7583 } |
| 7525 | 7584 |
| 7526 TEST_F(GLES2DecoderManualInitTest, GenerateMipmapDepthTexture) { | 7585 TEST_F(GLES2DecoderManualInitTest, GenerateMipmapDepthTexture) { |
| 7527 InitDecoder( | 7586 InitDecoder( |
| 7528 "GL_ANGLE_depth_texture", // extensions | 7587 "GL_ANGLE_depth_texture", // extensions |
| 7588 "opengl es 2.0", // gl version |
| 7529 false, // has alpha | 7589 false, // has alpha |
| 7530 true, // has depth | 7590 true, // has depth |
| 7531 true, // has stencil | 7591 true, // has stencil |
| 7532 false, // request alpha | 7592 false, // request alpha |
| 7533 true, // request depth | 7593 true, // request depth |
| 7534 true, // request stencil | 7594 true, // request stencil |
| 7535 true); // bind generates resource | 7595 true); // bind generates resource |
| 7536 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); | 7596 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); |
| 7537 DoTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT, | 7597 DoTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT, |
| 7538 2, 2, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, | 7598 2, 2, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, |
| 7539 0, 0); | 7599 0, 0); |
| 7540 GenerateMipmap cmd; | 7600 GenerateMipmap cmd; |
| 7541 cmd.Init(GL_TEXTURE_2D); | 7601 cmd.Init(GL_TEXTURE_2D); |
| 7542 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 7602 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 7543 EXPECT_EQ(GL_INVALID_OPERATION, GetGLError()); | 7603 EXPECT_EQ(GL_INVALID_OPERATION, GetGLError()); |
| 7544 } | 7604 } |
| 7545 | 7605 |
| 7546 TEST_F(GLES2DecoderManualInitTest, DrawClearsDepthTexture) { | 7606 TEST_F(GLES2DecoderManualInitTest, DrawClearsDepthTexture) { |
| 7547 InitDecoder( | 7607 InitDecoder( |
| 7548 "GL_ANGLE_depth_texture", // extensions | 7608 "GL_ANGLE_depth_texture", // extensions |
| 7609 "opengl es 2.0", // gl version |
| 7549 true, // has alpha | 7610 true, // has alpha |
| 7550 true, // has depth | 7611 true, // has depth |
| 7551 false, // has stencil | 7612 false, // has stencil |
| 7552 true, // request alpha | 7613 true, // request alpha |
| 7553 true, // request depth | 7614 true, // request depth |
| 7554 false, // request stencil | 7615 false, // request stencil |
| 7555 true); // bind generates resource | 7616 true); // bind generates resource |
| 7556 | 7617 |
| 7557 SetupDefaultProgram(); | 7618 SetupDefaultProgram(); |
| 7558 SetupAllNeededVertexBuffers(); | 7619 SetupAllNeededVertexBuffers(); |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7670 | 7731 |
| 7671 class GLES2DecoderVertexArraysOESTest : public GLES2DecoderWithShaderTest { | 7732 class GLES2DecoderVertexArraysOESTest : public GLES2DecoderWithShaderTest { |
| 7672 public: | 7733 public: |
| 7673 GLES2DecoderVertexArraysOESTest() { } | 7734 GLES2DecoderVertexArraysOESTest() { } |
| 7674 | 7735 |
| 7675 bool vertex_array_deleted_manually_; | 7736 bool vertex_array_deleted_manually_; |
| 7676 | 7737 |
| 7677 virtual void SetUp() { | 7738 virtual void SetUp() { |
| 7678 InitDecoder( | 7739 InitDecoder( |
| 7679 "GL_OES_vertex_array_object", // extensions | 7740 "GL_OES_vertex_array_object", // extensions |
| 7741 "opengl es 2.0", // gl version |
| 7680 false, // has alpha | 7742 false, // has alpha |
| 7681 false, // has depth | 7743 false, // has depth |
| 7682 false, // has stencil | 7744 false, // has stencil |
| 7683 false, // request alpha | 7745 false, // request alpha |
| 7684 false, // request depth | 7746 false, // request depth |
| 7685 false, // request stencil | 7747 false, // request stencil |
| 7686 true); // bind generates resource | 7748 true); // bind generates resource |
| 7687 SetupDefaultProgram(); | 7749 SetupDefaultProgram(); |
| 7688 | 7750 |
| 7689 AddExpectationsForGenVertexArraysOES(); | 7751 AddExpectationsForGenVertexArraysOES(); |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7820 }; | 7882 }; |
| 7821 | 7883 |
| 7822 class GLES2DecoderEmulatedVertexArraysOESTest | 7884 class GLES2DecoderEmulatedVertexArraysOESTest |
| 7823 : public GLES2DecoderVertexArraysOESTest { | 7885 : public GLES2DecoderVertexArraysOESTest { |
| 7824 public: | 7886 public: |
| 7825 GLES2DecoderEmulatedVertexArraysOESTest() { } | 7887 GLES2DecoderEmulatedVertexArraysOESTest() { } |
| 7826 | 7888 |
| 7827 virtual void SetUp() { | 7889 virtual void SetUp() { |
| 7828 InitDecoder( | 7890 InitDecoder( |
| 7829 "", // extensions | 7891 "", // extensions |
| 7892 "3.0", // gl version |
| 7830 false, // has alpha | 7893 false, // has alpha |
| 7831 false, // has depth | 7894 false, // has depth |
| 7832 false, // has stencil | 7895 false, // has stencil |
| 7833 false, // request alpha | 7896 false, // request alpha |
| 7834 false, // request depth | 7897 false, // request depth |
| 7835 false, // request stencil | 7898 false, // request stencil |
| 7836 true); // bind generates resource | 7899 true); // bind generates resource |
| 7837 SetupDefaultProgram(); | 7900 SetupDefaultProgram(); |
| 7838 | 7901 |
| 7839 AddExpectationsForGenVertexArraysOES(); | 7902 AddExpectationsForGenVertexArraysOES(); |
| (...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8176 FramebufferRenderbuffer fbrb_cmd; | 8239 FramebufferRenderbuffer fbrb_cmd; |
| 8177 fbrb_cmd.Init( | 8240 fbrb_cmd.Init( |
| 8178 GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, | 8241 GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, |
| 8179 client_renderbuffer_id_); | 8242 client_renderbuffer_id_); |
| 8180 EXPECT_EQ(error::kNoError, ExecuteCmd(fbrb_cmd)); | 8243 EXPECT_EQ(error::kNoError, ExecuteCmd(fbrb_cmd)); |
| 8181 } | 8244 } |
| 8182 | 8245 |
| 8183 TEST_F(GLES2DecoderManualInitTest, GpuMemoryManagerCHROMIUM) { | 8246 TEST_F(GLES2DecoderManualInitTest, GpuMemoryManagerCHROMIUM) { |
| 8184 InitDecoder( | 8247 InitDecoder( |
| 8185 "GL_ARB_texture_rectangle", // extensions | 8248 "GL_ARB_texture_rectangle", // extensions |
| 8249 "3.0", // gl version |
| 8186 false, // has alpha | 8250 false, // has alpha |
| 8187 false, // has depth | 8251 false, // has depth |
| 8188 false, // has stencil | 8252 false, // has stencil |
| 8189 false, // request alpha | 8253 false, // request alpha |
| 8190 false, // request depth | 8254 false, // request depth |
| 8191 false, // request stencil | 8255 false, // request stencil |
| 8192 true); // bind generates resource | 8256 true); // bind generates resource |
| 8193 | 8257 |
| 8194 Texture* texture = GetTexture(client_texture_id_)->texture(); | 8258 Texture* texture = GetTexture(client_texture_id_)->texture(); |
| 8195 EXPECT_TRUE(texture != NULL); | 8259 EXPECT_TRUE(texture != NULL); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 8216 cmd.Init(GL_TEXTURE_2D, | 8280 cmd.Init(GL_TEXTURE_2D, |
| 8217 GL_TEXTURE_POOL_CHROMIUM, | 8281 GL_TEXTURE_POOL_CHROMIUM, |
| 8218 GL_NONE); | 8282 GL_NONE); |
| 8219 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 8283 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 8220 EXPECT_EQ(GL_INVALID_ENUM, GetGLError()); | 8284 EXPECT_EQ(GL_INVALID_ENUM, GetGLError()); |
| 8221 } | 8285 } |
| 8222 | 8286 |
| 8223 TEST_F(GLES2DecoderManualInitTest, AsyncPixelTransfers) { | 8287 TEST_F(GLES2DecoderManualInitTest, AsyncPixelTransfers) { |
| 8224 InitDecoder( | 8288 InitDecoder( |
| 8225 "GL_CHROMIUM_async_pixel_transfers", // extensions | 8289 "GL_CHROMIUM_async_pixel_transfers", // extensions |
| 8290 "3.0", // gl version |
| 8226 false, false, false, // has alpha/depth/stencil | 8291 false, false, false, // has alpha/depth/stencil |
| 8227 false, false, false, // request alpha/depth/stencil | 8292 false, false, false, // request alpha/depth/stencil |
| 8228 true); // bind generates resource | 8293 true); // bind generates resource |
| 8229 | 8294 |
| 8230 // Set up the texture. | 8295 // Set up the texture. |
| 8231 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); | 8296 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); |
| 8232 TextureRef* texture_ref = GetTexture(client_texture_id_); | 8297 TextureRef* texture_ref = GetTexture(client_texture_id_); |
| 8233 Texture* texture = texture_ref->texture(); | 8298 Texture* texture = texture_ref->texture(); |
| 8234 | 8299 |
| 8235 // Set a mock Async delegate | 8300 // Set a mock Async delegate |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8406 EXPECT_CALL(*delegate, WaitForTransferCompletion()); | 8471 EXPECT_CALL(*delegate, WaitForTransferCompletion()); |
| 8407 EXPECT_CALL(*manager, BindCompletedAsyncTransfers()); | 8472 EXPECT_CALL(*manager, BindCompletedAsyncTransfers()); |
| 8408 EXPECT_EQ(error::kNoError, ExecuteCmd(wait_cmd)); | 8473 EXPECT_EQ(error::kNoError, ExecuteCmd(wait_cmd)); |
| 8409 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 8474 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 8410 } | 8475 } |
| 8411 } | 8476 } |
| 8412 | 8477 |
| 8413 TEST_F(GLES2DecoderManualInitTest, AsyncPixelTransferManager) { | 8478 TEST_F(GLES2DecoderManualInitTest, AsyncPixelTransferManager) { |
| 8414 InitDecoder( | 8479 InitDecoder( |
| 8415 "GL_CHROMIUM_async_pixel_transfers", // extensions | 8480 "GL_CHROMIUM_async_pixel_transfers", // extensions |
| 8481 "3.0", // gl version |
| 8416 false, false, false, // has alpha/depth/stencil | 8482 false, false, false, // has alpha/depth/stencil |
| 8417 false, false, false, // request alpha/depth/stencil | 8483 false, false, false, // request alpha/depth/stencil |
| 8418 true); // bind generates resource | 8484 true); // bind generates resource |
| 8419 | 8485 |
| 8420 // Set up the texture. | 8486 // Set up the texture. |
| 8421 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); | 8487 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); |
| 8422 TextureRef* texture_ref = GetTexture(client_texture_id_); | 8488 TextureRef* texture_ref = GetTexture(client_texture_id_); |
| 8423 | 8489 |
| 8424 // Set a mock Async delegate. | 8490 // Set a mock Async delegate. |
| 8425 StrictMock<gpu::MockAsyncPixelTransferManager>* manager = | 8491 StrictMock<gpu::MockAsyncPixelTransferManager>* manager = |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8509 }; | 8575 }; |
| 8510 | 8576 |
| 8511 } // anonymous namespace. | 8577 } // anonymous namespace. |
| 8512 | 8578 |
| 8513 TEST_F(GLES2DecoderManualInitTest, MemoryTrackerInitialSize) { | 8579 TEST_F(GLES2DecoderManualInitTest, MemoryTrackerInitialSize) { |
| 8514 scoped_refptr<SizeOnlyMemoryTracker> memory_tracker = | 8580 scoped_refptr<SizeOnlyMemoryTracker> memory_tracker = |
| 8515 new SizeOnlyMemoryTracker(); | 8581 new SizeOnlyMemoryTracker(); |
| 8516 set_memory_tracker(memory_tracker.get()); | 8582 set_memory_tracker(memory_tracker.get()); |
| 8517 InitDecoder( | 8583 InitDecoder( |
| 8518 "", // extensions | 8584 "", // extensions |
| 8585 "3.0", // gl version |
| 8519 false, // has alpha | 8586 false, // has alpha |
| 8520 false, // has depth | 8587 false, // has depth |
| 8521 false, // has stencil | 8588 false, // has stencil |
| 8522 false, // request alpha | 8589 false, // request alpha |
| 8523 false, // request depth | 8590 false, // request depth |
| 8524 false, // request stencil | 8591 false, // request stencil |
| 8525 true); // bind generates resource | 8592 true); // bind generates resource |
| 8526 // Expect that initial size - size is 0. | 8593 // Expect that initial size - size is 0. |
| 8527 EXPECT_EQ(0u, memory_tracker->GetPoolSize(MemoryTracker::kUnmanaged)); | 8594 EXPECT_EQ(0u, memory_tracker->GetPoolSize(MemoryTracker::kUnmanaged)); |
| 8528 EXPECT_EQ(0u, memory_tracker->GetPoolSize(MemoryTracker::kManaged)); | 8595 EXPECT_EQ(0u, memory_tracker->GetPoolSize(MemoryTracker::kManaged)); |
| 8529 } | 8596 } |
| 8530 | 8597 |
| 8531 TEST_F(GLES2DecoderManualInitTest, MemoryTrackerTexImage2D) { | 8598 TEST_F(GLES2DecoderManualInitTest, MemoryTrackerTexImage2D) { |
| 8532 scoped_refptr<SizeOnlyMemoryTracker> memory_tracker = | 8599 scoped_refptr<SizeOnlyMemoryTracker> memory_tracker = |
| 8533 new SizeOnlyMemoryTracker(); | 8600 new SizeOnlyMemoryTracker(); |
| 8534 set_memory_tracker(memory_tracker.get()); | 8601 set_memory_tracker(memory_tracker.get()); |
| 8535 InitDecoder( | 8602 InitDecoder( |
| 8536 "", // extensions | 8603 "", // extensions |
| 8604 "3.0", // gl version |
| 8537 false, // has alpha | 8605 false, // has alpha |
| 8538 false, // has depth | 8606 false, // has depth |
| 8539 false, // has stencil | 8607 false, // has stencil |
| 8540 false, // request alpha | 8608 false, // request alpha |
| 8541 false, // request depth | 8609 false, // request depth |
| 8542 false, // request stencil | 8610 false, // request stencil |
| 8543 true); // bind generates resource | 8611 true); // bind generates resource |
| 8544 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); | 8612 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); |
| 8545 EXPECT_CALL(*memory_tracker.get(), EnsureGPUMemoryAvailable(128)) | 8613 EXPECT_CALL(*memory_tracker.get(), EnsureGPUMemoryAvailable(128)) |
| 8546 .WillOnce(Return(true)).RetiresOnSaturation(); | 8614 .WillOnce(Return(true)).RetiresOnSaturation(); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 8563 EXPECT_EQ(GL_OUT_OF_MEMORY, GetGLError()); | 8631 EXPECT_EQ(GL_OUT_OF_MEMORY, GetGLError()); |
| 8564 EXPECT_EQ(64u, memory_tracker->GetPoolSize(MemoryTracker::kUnmanaged)); | 8632 EXPECT_EQ(64u, memory_tracker->GetPoolSize(MemoryTracker::kUnmanaged)); |
| 8565 } | 8633 } |
| 8566 | 8634 |
| 8567 TEST_F(GLES2DecoderManualInitTest, MemoryTrackerTexStorage2DEXT) { | 8635 TEST_F(GLES2DecoderManualInitTest, MemoryTrackerTexStorage2DEXT) { |
| 8568 scoped_refptr<SizeOnlyMemoryTracker> memory_tracker = | 8636 scoped_refptr<SizeOnlyMemoryTracker> memory_tracker = |
| 8569 new SizeOnlyMemoryTracker(); | 8637 new SizeOnlyMemoryTracker(); |
| 8570 set_memory_tracker(memory_tracker.get()); | 8638 set_memory_tracker(memory_tracker.get()); |
| 8571 InitDecoder( | 8639 InitDecoder( |
| 8572 "", // extensions | 8640 "", // extensions |
| 8641 "3.0", // gl version |
| 8573 false, // has alpha | 8642 false, // has alpha |
| 8574 false, // has depth | 8643 false, // has depth |
| 8575 false, // has stencil | 8644 false, // has stencil |
| 8576 false, // request alpha | 8645 false, // request alpha |
| 8577 false, // request depth | 8646 false, // request depth |
| 8578 false, // request stencil | 8647 false, // request stencil |
| 8579 true); // bind generates resource | 8648 true); // bind generates resource |
| 8580 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); | 8649 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); |
| 8581 // Check we get out of memory and no call to glTexStorage2DEXT | 8650 // Check we get out of memory and no call to glTexStorage2DEXT |
| 8582 // if Ensure fails. | 8651 // if Ensure fails. |
| (...skipping 11 matching lines...) Expand all Loading... |
| 8594 GLint level = 0; | 8663 GLint level = 0; |
| 8595 GLenum internal_format = GL_RGBA; | 8664 GLenum internal_format = GL_RGBA; |
| 8596 GLsizei width = 4; | 8665 GLsizei width = 4; |
| 8597 GLsizei height = 8; | 8666 GLsizei height = 8; |
| 8598 GLint border = 0; | 8667 GLint border = 0; |
| 8599 scoped_refptr<SizeOnlyMemoryTracker> memory_tracker = | 8668 scoped_refptr<SizeOnlyMemoryTracker> memory_tracker = |
| 8600 new SizeOnlyMemoryTracker(); | 8669 new SizeOnlyMemoryTracker(); |
| 8601 set_memory_tracker(memory_tracker.get()); | 8670 set_memory_tracker(memory_tracker.get()); |
| 8602 InitDecoder( | 8671 InitDecoder( |
| 8603 "", // extensions | 8672 "", // extensions |
| 8673 "3.0", // gl version |
| 8604 true, // has alpha | 8674 true, // has alpha |
| 8605 false, // has depth | 8675 false, // has depth |
| 8606 false, // has stencil | 8676 false, // has stencil |
| 8607 true, // request alpha | 8677 true, // request alpha |
| 8608 false, // request depth | 8678 false, // request depth |
| 8609 false, // request stencil | 8679 false, // request stencil |
| 8610 true); // bind generates resource | 8680 true); // bind generates resource |
| 8611 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); | 8681 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); |
| 8612 EXPECT_CALL(*memory_tracker.get(), EnsureGPUMemoryAvailable(128)) | 8682 EXPECT_CALL(*memory_tracker.get(), EnsureGPUMemoryAvailable(128)) |
| 8613 .WillOnce(Return(true)).RetiresOnSaturation(); | 8683 .WillOnce(Return(true)).RetiresOnSaturation(); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 8631 EXPECT_EQ(GL_OUT_OF_MEMORY, GetGLError()); | 8701 EXPECT_EQ(GL_OUT_OF_MEMORY, GetGLError()); |
| 8632 EXPECT_EQ(128u, memory_tracker->GetPoolSize(MemoryTracker::kUnmanaged)); | 8702 EXPECT_EQ(128u, memory_tracker->GetPoolSize(MemoryTracker::kUnmanaged)); |
| 8633 } | 8703 } |
| 8634 | 8704 |
| 8635 TEST_F(GLES2DecoderManualInitTest, MemoryTrackerRenderbufferStorage) { | 8705 TEST_F(GLES2DecoderManualInitTest, MemoryTrackerRenderbufferStorage) { |
| 8636 scoped_refptr<SizeOnlyMemoryTracker> memory_tracker = | 8706 scoped_refptr<SizeOnlyMemoryTracker> memory_tracker = |
| 8637 new SizeOnlyMemoryTracker(); | 8707 new SizeOnlyMemoryTracker(); |
| 8638 set_memory_tracker(memory_tracker.get()); | 8708 set_memory_tracker(memory_tracker.get()); |
| 8639 InitDecoder( | 8709 InitDecoder( |
| 8640 "", // extensions | 8710 "", // extensions |
| 8711 "3.0", // gl version |
| 8641 false, // has alpha | 8712 false, // has alpha |
| 8642 false, // has depth | 8713 false, // has depth |
| 8643 false, // has stencil | 8714 false, // has stencil |
| 8644 false, // request alpha | 8715 false, // request alpha |
| 8645 false, // request depth | 8716 false, // request depth |
| 8646 false, // request stencil | 8717 false, // request stencil |
| 8647 true); // bind generates resource | 8718 true); // bind generates resource |
| 8648 DoBindRenderbuffer(GL_RENDERBUFFER, client_renderbuffer_id_, | 8719 DoBindRenderbuffer(GL_RENDERBUFFER, client_renderbuffer_id_, |
| 8649 kServiceRenderbufferId); | 8720 kServiceRenderbufferId); |
| 8650 EXPECT_CALL(*gl_, GetError()) | 8721 EXPECT_CALL(*gl_, GetError()) |
| (...skipping 19 matching lines...) Expand all Loading... |
| 8670 EXPECT_EQ(GL_OUT_OF_MEMORY, GetGLError()); | 8741 EXPECT_EQ(GL_OUT_OF_MEMORY, GetGLError()); |
| 8671 EXPECT_EQ(128u, memory_tracker->GetPoolSize(MemoryTracker::kUnmanaged)); | 8742 EXPECT_EQ(128u, memory_tracker->GetPoolSize(MemoryTracker::kUnmanaged)); |
| 8672 } | 8743 } |
| 8673 | 8744 |
| 8674 TEST_F(GLES2DecoderManualInitTest, MemoryTrackerBufferData) { | 8745 TEST_F(GLES2DecoderManualInitTest, MemoryTrackerBufferData) { |
| 8675 scoped_refptr<SizeOnlyMemoryTracker> memory_tracker = | 8746 scoped_refptr<SizeOnlyMemoryTracker> memory_tracker = |
| 8676 new SizeOnlyMemoryTracker(); | 8747 new SizeOnlyMemoryTracker(); |
| 8677 set_memory_tracker(memory_tracker.get()); | 8748 set_memory_tracker(memory_tracker.get()); |
| 8678 InitDecoder( | 8749 InitDecoder( |
| 8679 "", // extensions | 8750 "", // extensions |
| 8751 "3.0", // gl version |
| 8680 false, // has alpha | 8752 false, // has alpha |
| 8681 false, // has depth | 8753 false, // has depth |
| 8682 false, // has stencil | 8754 false, // has stencil |
| 8683 false, // request alpha | 8755 false, // request alpha |
| 8684 false, // request depth | 8756 false, // request depth |
| 8685 false, // request stencil | 8757 false, // request stencil |
| 8686 true); // bind generates resource | 8758 true); // bind generates resource |
| 8687 DoBindBuffer(GL_ARRAY_BUFFER, client_buffer_id_, | 8759 DoBindBuffer(GL_ARRAY_BUFFER, client_buffer_id_, |
| 8688 kServiceBufferId); | 8760 kServiceBufferId); |
| 8689 EXPECT_CALL(*gl_, GetError()) | 8761 EXPECT_CALL(*gl_, GetError()) |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8759 .Times(1) | 8831 .Times(1) |
| 8760 .RetiresOnSaturation(); | 8832 .RetiresOnSaturation(); |
| 8761 | 8833 |
| 8762 EXPECT_EQ(error::kNoError, | 8834 EXPECT_EQ(error::kNoError, |
| 8763 ExecuteImmediateCmd(cmd, sizeof(bufs))); | 8835 ExecuteImmediateCmd(cmd, sizeof(bufs))); |
| 8764 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 8836 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 8765 } | 8837 } |
| 8766 | 8838 |
| 8767 TEST_F(GLES2DecoderManualInitTest, DiscardFramebufferEXT) { | 8839 TEST_F(GLES2DecoderManualInitTest, DiscardFramebufferEXT) { |
| 8768 InitDecoder("GL_EXT_discard_framebuffer", // extensions | 8840 InitDecoder("GL_EXT_discard_framebuffer", // extensions |
| 8841 "opengl es 2.0", // gl version |
| 8769 false, // has alpha | 8842 false, // has alpha |
| 8770 false, // has depth | 8843 false, // has depth |
| 8771 false, // has stencil | 8844 false, // has stencil |
| 8772 false, // request alpha | 8845 false, // request alpha |
| 8773 false, // request depth | 8846 false, // request depth |
| 8774 false, // request stencil | 8847 false, // request stencil |
| 8775 false); // bind generates resource | 8848 false); // bind generates resource |
| 8776 | 8849 |
| 8777 const GLenum target = GL_FRAMEBUFFER; | 8850 const GLenum target = GL_FRAMEBUFFER; |
| 8778 const GLsizei count = 1; | 8851 const GLsizei count = 1; |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8849 // TODO(gman): TexImage2DImmediate | 8922 // TODO(gman): TexImage2DImmediate |
| 8850 | 8923 |
| 8851 // TODO(gman): TexSubImage2DImmediate | 8924 // TODO(gman): TexSubImage2DImmediate |
| 8852 | 8925 |
| 8853 // TODO(gman): UseProgram | 8926 // TODO(gman): UseProgram |
| 8854 | 8927 |
| 8855 // TODO(gman): SwapBuffers | 8928 // TODO(gman): SwapBuffers |
| 8856 | 8929 |
| 8857 } // namespace gles2 | 8930 } // namespace gles2 |
| 8858 } // namespace gpu | 8931 } // namespace gpu |
| OLD | NEW |