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

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

Issue 1319453010: Fix GetFramebufferAttachmentParameteriv command handling. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: revision per piman review Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 22 matching lines...) Expand all
33 using ::testing::_; 33 using ::testing::_;
34 using ::testing::DoAll; 34 using ::testing::DoAll;
35 using ::testing::InSequence; 35 using ::testing::InSequence;
36 using ::testing::Invoke; 36 using ::testing::Invoke;
37 using ::testing::MatcherCast; 37 using ::testing::MatcherCast;
38 using ::testing::Mock; 38 using ::testing::Mock;
39 using ::testing::Pointee; 39 using ::testing::Pointee;
40 using ::testing::Return; 40 using ::testing::Return;
41 using ::testing::SaveArg; 41 using ::testing::SaveArg;
42 using ::testing::SetArrayArgument; 42 using ::testing::SetArrayArgument;
43 using ::testing::SetArgumentPointee;
44 using ::testing::SetArgPointee; 43 using ::testing::SetArgPointee;
45 using ::testing::StrEq; 44 using ::testing::StrEq;
46 using ::testing::StrictMock; 45 using ::testing::StrictMock;
47 46
48 namespace gpu { 47 namespace gpu {
49 namespace gles2 { 48 namespace gles2 {
50 49
51 using namespace cmds; 50 using namespace cmds;
52 51
53 class GLES2DecoderTestWithExtensionsOnGLES2 : public GLES2DecoderTest { 52 class GLES2DecoderTestWithExtensionsOnGLES2 : public GLES2DecoderTest {
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 shared_memory_id_, 136 shared_memory_id_,
138 shared_memory_offset_); 137 shared_memory_offset_);
139 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 138 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
140 EXPECT_EQ(GL_INVALID_OPERATION, GetGLError()); 139 EXPECT_EQ(GL_INVALID_OPERATION, GetGLError());
141 } 140 }
142 141
143 TEST_P(GLES2DecoderTest, GetFramebufferAttachmentParameterivWithRenderbuffer) { 142 TEST_P(GLES2DecoderTest, GetFramebufferAttachmentParameterivWithRenderbuffer) {
144 DoBindFramebuffer( 143 DoBindFramebuffer(
145 GL_FRAMEBUFFER, client_framebuffer_id_, kServiceFramebufferId); 144 GL_FRAMEBUFFER, client_framebuffer_id_, kServiceFramebufferId);
146 EXPECT_CALL(*gl_, GetError()) 145 EXPECT_CALL(*gl_, GetError())
147 .WillOnce(Return(GL_NO_ERROR)) 146 .WillRepeatedly(Return(GL_NO_ERROR));
148 .RetiresOnSaturation();
149 EXPECT_CALL(*gl_, 147 EXPECT_CALL(*gl_,
150 FramebufferRenderbufferEXT(GL_FRAMEBUFFER, 148 FramebufferRenderbufferEXT(GL_FRAMEBUFFER,
151 GL_COLOR_ATTACHMENT0, 149 GL_COLOR_ATTACHMENT0,
152 GL_RENDERBUFFER, 150 GL_RENDERBUFFER,
153 kServiceRenderbufferId)) 151 kServiceRenderbufferId))
154 .Times(1) 152 .Times(1)
155 .RetiresOnSaturation(); 153 .RetiresOnSaturation();
156 EXPECT_CALL(*gl_, GetError())
157 .WillOnce(Return(GL_NO_ERROR))
158 .RetiresOnSaturation();
159 EXPECT_CALL(*gl_, GetError())
160 .WillOnce(Return(GL_NO_ERROR))
161 .WillOnce(Return(GL_NO_ERROR))
162 .RetiresOnSaturation();
163 GetFramebufferAttachmentParameteriv::Result* result = 154 GetFramebufferAttachmentParameteriv::Result* result =
164 static_cast<GetFramebufferAttachmentParameteriv::Result*>( 155 static_cast<GetFramebufferAttachmentParameteriv::Result*>(
165 shared_memory_address_); 156 shared_memory_address_);
166 result->size = 0; 157 result->size = 0;
167 const GLint* result_value = result->GetData(); 158 const GLint* result_value = result->GetData();
168 FramebufferRenderbuffer fbrb_cmd; 159 FramebufferRenderbuffer fbrb_cmd;
169 GetFramebufferAttachmentParameteriv cmd; 160 GetFramebufferAttachmentParameteriv cmd;
170 fbrb_cmd.Init(GL_FRAMEBUFFER, 161 fbrb_cmd.Init(GL_FRAMEBUFFER,
171 GL_COLOR_ATTACHMENT0, 162 GL_COLOR_ATTACHMENT0,
172 GL_RENDERBUFFER, 163 GL_RENDERBUFFER,
173 client_renderbuffer_id_); 164 client_renderbuffer_id_);
174 cmd.Init(GL_FRAMEBUFFER, 165 cmd.Init(GL_FRAMEBUFFER,
175 GL_COLOR_ATTACHMENT0, 166 GL_COLOR_ATTACHMENT0,
176 GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, 167 GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME,
177 shared_memory_id_, 168 shared_memory_id_,
178 shared_memory_offset_); 169 shared_memory_offset_);
179 EXPECT_EQ(error::kNoError, ExecuteCmd(fbrb_cmd)); 170 EXPECT_EQ(error::kNoError, ExecuteCmd(fbrb_cmd));
180 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 171 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
181 EXPECT_EQ(GL_NO_ERROR, GetGLError()); 172 EXPECT_EQ(GL_NO_ERROR, GetGLError());
182 EXPECT_EQ(static_cast<GLuint>(*result_value), client_renderbuffer_id_); 173 EXPECT_EQ(client_renderbuffer_id_, static_cast<GLuint>(*result_value));
183 } 174 }
184 175
185 TEST_P(GLES2DecoderTest, GetFramebufferAttachmentParameterivWithTexture) { 176 TEST_P(GLES2DecoderTest, GetFramebufferAttachmentParameterivWithTexture) {
186 DoBindFramebuffer( 177 DoBindFramebuffer(
187 GL_FRAMEBUFFER, client_framebuffer_id_, kServiceFramebufferId); 178 GL_FRAMEBUFFER, client_framebuffer_id_, kServiceFramebufferId);
188 EXPECT_CALL(*gl_, GetError()) 179 EXPECT_CALL(*gl_, GetError())
189 .WillOnce(Return(GL_NO_ERROR)) 180 .WillRepeatedly(Return(GL_NO_ERROR));
190 .RetiresOnSaturation();
191 EXPECT_CALL(*gl_, 181 EXPECT_CALL(*gl_,
192 FramebufferTexture2DEXT(GL_FRAMEBUFFER, 182 FramebufferTexture2DEXT(GL_FRAMEBUFFER,
193 GL_COLOR_ATTACHMENT0, 183 GL_COLOR_ATTACHMENT0,
194 GL_TEXTURE_2D, 184 GL_TEXTURE_2D,
195 kServiceTextureId, 185 kServiceTextureId,
196 0)) 186 0))
197 .Times(1) 187 .Times(1)
198 .RetiresOnSaturation(); 188 .RetiresOnSaturation();
199 EXPECT_CALL(*gl_, GetError())
200 .WillOnce(Return(GL_NO_ERROR))
201 .RetiresOnSaturation();
202 EXPECT_CALL(*gl_, GetError())
203 .WillOnce(Return(GL_NO_ERROR))
204 .WillOnce(Return(GL_NO_ERROR))
205 .RetiresOnSaturation();
206 GetFramebufferAttachmentParameteriv::Result* result = 189 GetFramebufferAttachmentParameteriv::Result* result =
207 static_cast<GetFramebufferAttachmentParameteriv::Result*>( 190 static_cast<GetFramebufferAttachmentParameteriv::Result*>(
208 shared_memory_address_); 191 shared_memory_address_);
209 result->SetNumResults(0); 192 result->SetNumResults(0);
210 const GLint* result_value = result->GetData(); 193 const GLint* result_value = result->GetData();
211 FramebufferTexture2D fbtex_cmd; 194 FramebufferTexture2D fbtex_cmd;
212 GetFramebufferAttachmentParameteriv cmd; 195 GetFramebufferAttachmentParameteriv cmd;
213 fbtex_cmd.Init(GL_FRAMEBUFFER, 196 fbtex_cmd.Init(GL_FRAMEBUFFER,
214 GL_COLOR_ATTACHMENT0, 197 GL_COLOR_ATTACHMENT0,
215 GL_TEXTURE_2D, 198 GL_TEXTURE_2D,
216 client_texture_id_); 199 client_texture_id_);
217 cmd.Init(GL_FRAMEBUFFER, 200 cmd.Init(GL_FRAMEBUFFER,
218 GL_COLOR_ATTACHMENT0, 201 GL_COLOR_ATTACHMENT0,
219 GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, 202 GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME,
220 shared_memory_id_, 203 shared_memory_id_,
221 shared_memory_offset_); 204 shared_memory_offset_);
222 EXPECT_EQ(error::kNoError, ExecuteCmd(fbtex_cmd)); 205 EXPECT_EQ(error::kNoError, ExecuteCmd(fbtex_cmd));
223 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 206 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
224 EXPECT_EQ(GL_NO_ERROR, GetGLError()); 207 EXPECT_EQ(GL_NO_ERROR, GetGLError());
225 EXPECT_EQ(static_cast<GLuint>(*result_value), client_texture_id_); 208 EXPECT_EQ(client_texture_id_, static_cast<GLuint>(*result_value));
226 } 209 }
227 210
228 TEST_P(GLES2DecoderWithShaderTest, 211 TEST_P(GLES2DecoderWithShaderTest,
229 GetRenderbufferParameterivRebindRenderbuffer) { 212 GetRenderbufferParameterivRebindRenderbuffer) {
230 SetupTexture(); 213 SetupTexture();
231 DoBindRenderbuffer( 214 DoBindRenderbuffer(
232 GL_RENDERBUFFER, client_renderbuffer_id_, kServiceRenderbufferId); 215 GL_RENDERBUFFER, client_renderbuffer_id_, kServiceRenderbufferId);
233 DoRenderbufferStorage(GL_RENDERBUFFER, GL_RGBA4, GL_RGBA, 1, 1, GL_NO_ERROR); 216 DoRenderbufferStorage(GL_RENDERBUFFER, GL_RGBA4, GL_RGBA, 1, 1, GL_NO_ERROR);
234 217
235 GetRenderbufferParameteriv cmd; 218 GetRenderbufferParameteriv cmd;
(...skipping 743 matching lines...) Expand 10 before | Expand all | Expand 10 after
979 init.bind_generates_resource = true; 962 init.bind_generates_resource = true;
980 InitDecoder(init); 963 InitDecoder(init);
981 964
982 EXPECT_CALL(*gl_, GetError()) 965 EXPECT_CALL(*gl_, GetError())
983 .WillOnce(Return(GL_NO_ERROR)) 966 .WillOnce(Return(GL_NO_ERROR))
984 .WillOnce(Return(GL_NO_ERROR)) 967 .WillOnce(Return(GL_NO_ERROR))
985 .RetiresOnSaturation(); 968 .RetiresOnSaturation();
986 typedef GetIntegerv::Result Result; 969 typedef GetIntegerv::Result Result;
987 Result* result = static_cast<Result*>(shared_memory_address_); 970 Result* result = static_cast<Result*>(shared_memory_address_);
988 EXPECT_CALL(*gl_, GetIntegerv(GL_DEPTH_BITS, _)) 971 EXPECT_CALL(*gl_, GetIntegerv(GL_DEPTH_BITS, _))
989 .WillOnce(SetArgumentPointee<1>(24)) 972 .WillOnce(SetArgPointee<1>(24))
990 .RetiresOnSaturation(); 973 .RetiresOnSaturation();
991 result->size = 0; 974 result->size = 0;
992 GetIntegerv cmd2; 975 GetIntegerv cmd2;
993 cmd2.Init(GL_DEPTH_BITS, shared_memory_id_, shared_memory_offset_); 976 cmd2.Init(GL_DEPTH_BITS, shared_memory_id_, shared_memory_offset_);
994 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd2)); 977 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd2));
995 EXPECT_EQ(decoder_->GetGLES2Util()->GLGetNumValuesReturned(GL_DEPTH_BITS), 978 EXPECT_EQ(decoder_->GetGLES2Util()->GLGetNumValuesReturned(GL_DEPTH_BITS),
996 result->GetNumResults()); 979 result->GetNumResults());
997 EXPECT_EQ(GL_NO_ERROR, GetGLError()); 980 EXPECT_EQ(GL_NO_ERROR, GetGLError());
998 EXPECT_EQ(24, result->GetData()[0]); 981 EXPECT_EQ(24, result->GetData()[0]);
999 } 982 }
1000 983
1001 TEST_P(GLES2DecoderManualInitTest, ActualDepthDoesNotMatchRequestedDepth) { 984 TEST_P(GLES2DecoderManualInitTest, ActualDepthDoesNotMatchRequestedDepth) {
1002 InitState init; 985 InitState init;
1003 init.has_depth = true; 986 init.has_depth = true;
1004 init.bind_generates_resource = true; 987 init.bind_generates_resource = true;
1005 InitDecoder(init); 988 InitDecoder(init);
1006 989
1007 EXPECT_CALL(*gl_, GetError()) 990 EXPECT_CALL(*gl_, GetError())
1008 .WillOnce(Return(GL_NO_ERROR)) 991 .WillOnce(Return(GL_NO_ERROR))
1009 .WillOnce(Return(GL_NO_ERROR)) 992 .WillOnce(Return(GL_NO_ERROR))
1010 .RetiresOnSaturation(); 993 .RetiresOnSaturation();
1011 typedef GetIntegerv::Result Result; 994 typedef GetIntegerv::Result Result;
1012 Result* result = static_cast<Result*>(shared_memory_address_); 995 Result* result = static_cast<Result*>(shared_memory_address_);
1013 EXPECT_CALL(*gl_, GetIntegerv(GL_DEPTH_BITS, _)) 996 EXPECT_CALL(*gl_, GetIntegerv(GL_DEPTH_BITS, _))
1014 .WillOnce(SetArgumentPointee<1>(24)) 997 .WillOnce(SetArgPointee<1>(24))
1015 .RetiresOnSaturation(); 998 .RetiresOnSaturation();
1016 result->size = 0; 999 result->size = 0;
1017 GetIntegerv cmd2; 1000 GetIntegerv cmd2;
1018 cmd2.Init(GL_DEPTH_BITS, shared_memory_id_, shared_memory_offset_); 1001 cmd2.Init(GL_DEPTH_BITS, shared_memory_id_, shared_memory_offset_);
1019 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd2)); 1002 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd2));
1020 EXPECT_EQ(decoder_->GetGLES2Util()->GLGetNumValuesReturned(GL_DEPTH_BITS), 1003 EXPECT_EQ(decoder_->GetGLES2Util()->GLGetNumValuesReturned(GL_DEPTH_BITS),
1021 result->GetNumResults()); 1004 result->GetNumResults());
1022 EXPECT_EQ(GL_NO_ERROR, GetGLError()); 1005 EXPECT_EQ(GL_NO_ERROR, GetGLError());
1023 EXPECT_EQ(0, result->GetData()[0]); 1006 EXPECT_EQ(0, result->GetData()[0]);
1024 } 1007 }
1025 1008
1026 TEST_P(GLES2DecoderManualInitTest, ActualStencilMatchesRequestedStencil) { 1009 TEST_P(GLES2DecoderManualInitTest, ActualStencilMatchesRequestedStencil) {
1027 InitState init; 1010 InitState init;
1028 init.has_stencil = true; 1011 init.has_stencil = true;
1029 init.request_stencil = true; 1012 init.request_stencil = true;
1030 init.bind_generates_resource = true; 1013 init.bind_generates_resource = true;
1031 InitDecoder(init); 1014 InitDecoder(init);
1032 1015
1033 EXPECT_CALL(*gl_, GetError()) 1016 EXPECT_CALL(*gl_, GetError())
1034 .WillOnce(Return(GL_NO_ERROR)) 1017 .WillOnce(Return(GL_NO_ERROR))
1035 .WillOnce(Return(GL_NO_ERROR)) 1018 .WillOnce(Return(GL_NO_ERROR))
1036 .RetiresOnSaturation(); 1019 .RetiresOnSaturation();
1037 typedef GetIntegerv::Result Result; 1020 typedef GetIntegerv::Result Result;
1038 Result* result = static_cast<Result*>(shared_memory_address_); 1021 Result* result = static_cast<Result*>(shared_memory_address_);
1039 EXPECT_CALL(*gl_, GetIntegerv(GL_STENCIL_BITS, _)) 1022 EXPECT_CALL(*gl_, GetIntegerv(GL_STENCIL_BITS, _))
1040 .WillOnce(SetArgumentPointee<1>(8)) 1023 .WillOnce(SetArgPointee<1>(8))
1041 .RetiresOnSaturation(); 1024 .RetiresOnSaturation();
1042 result->size = 0; 1025 result->size = 0;
1043 GetIntegerv cmd2; 1026 GetIntegerv cmd2;
1044 cmd2.Init(GL_STENCIL_BITS, shared_memory_id_, shared_memory_offset_); 1027 cmd2.Init(GL_STENCIL_BITS, shared_memory_id_, shared_memory_offset_);
1045 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd2)); 1028 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd2));
1046 EXPECT_EQ(decoder_->GetGLES2Util()->GLGetNumValuesReturned(GL_STENCIL_BITS), 1029 EXPECT_EQ(decoder_->GetGLES2Util()->GLGetNumValuesReturned(GL_STENCIL_BITS),
1047 result->GetNumResults()); 1030 result->GetNumResults());
1048 EXPECT_EQ(GL_NO_ERROR, GetGLError()); 1031 EXPECT_EQ(GL_NO_ERROR, GetGLError());
1049 EXPECT_EQ(8, result->GetData()[0]); 1032 EXPECT_EQ(8, result->GetData()[0]);
1050 } 1033 }
1051 1034
1052 TEST_P(GLES2DecoderManualInitTest, ActualStencilDoesNotMatchRequestedStencil) { 1035 TEST_P(GLES2DecoderManualInitTest, ActualStencilDoesNotMatchRequestedStencil) {
1053 InitState init; 1036 InitState init;
1054 init.has_stencil = true; 1037 init.has_stencil = true;
1055 init.bind_generates_resource = true; 1038 init.bind_generates_resource = true;
1056 InitDecoder(init); 1039 InitDecoder(init);
1057 1040
1058 EXPECT_CALL(*gl_, GetError()) 1041 EXPECT_CALL(*gl_, GetError())
1059 .WillOnce(Return(GL_NO_ERROR)) 1042 .WillOnce(Return(GL_NO_ERROR))
1060 .WillOnce(Return(GL_NO_ERROR)) 1043 .WillOnce(Return(GL_NO_ERROR))
1061 .RetiresOnSaturation(); 1044 .RetiresOnSaturation();
1062 typedef GetIntegerv::Result Result; 1045 typedef GetIntegerv::Result Result;
1063 Result* result = static_cast<Result*>(shared_memory_address_); 1046 Result* result = static_cast<Result*>(shared_memory_address_);
1064 EXPECT_CALL(*gl_, GetIntegerv(GL_STENCIL_BITS, _)) 1047 EXPECT_CALL(*gl_, GetIntegerv(GL_STENCIL_BITS, _))
1065 .WillOnce(SetArgumentPointee<1>(8)) 1048 .WillOnce(SetArgPointee<1>(8))
1066 .RetiresOnSaturation(); 1049 .RetiresOnSaturation();
1067 result->size = 0; 1050 result->size = 0;
1068 GetIntegerv cmd2; 1051 GetIntegerv cmd2;
1069 cmd2.Init(GL_STENCIL_BITS, shared_memory_id_, shared_memory_offset_); 1052 cmd2.Init(GL_STENCIL_BITS, shared_memory_id_, shared_memory_offset_);
1070 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd2)); 1053 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd2));
1071 EXPECT_EQ(decoder_->GetGLES2Util()->GLGetNumValuesReturned(GL_STENCIL_BITS), 1054 EXPECT_EQ(decoder_->GetGLES2Util()->GLGetNumValuesReturned(GL_STENCIL_BITS),
1072 result->GetNumResults()); 1055 result->GetNumResults());
1073 EXPECT_EQ(GL_NO_ERROR, GetGLError()); 1056 EXPECT_EQ(GL_NO_ERROR, GetGLError());
1074 EXPECT_EQ(0, result->GetData()[0]); 1057 EXPECT_EQ(0, result->GetData()[0]);
1075 } 1058 }
(...skipping 14 matching lines...) Expand all
1090 .WillOnce(Return(GL_NO_ERROR)) 1073 .WillOnce(Return(GL_NO_ERROR))
1091 .WillOnce(Return(GL_NO_ERROR)) 1074 .WillOnce(Return(GL_NO_ERROR))
1092 .WillOnce(Return(GL_NO_ERROR)) 1075 .WillOnce(Return(GL_NO_ERROR))
1093 .RetiresOnSaturation(); 1076 .RetiresOnSaturation();
1094 typedef GetIntegerv::Result Result; 1077 typedef GetIntegerv::Result Result;
1095 Result* result = static_cast<Result*>(shared_memory_address_); 1078 Result* result = static_cast<Result*>(shared_memory_address_);
1096 result->size = 0; 1079 result->size = 0;
1097 GetIntegerv cmd2; 1080 GetIntegerv cmd2;
1098 cmd2.Init(GL_STENCIL_BITS, shared_memory_id_, shared_memory_offset_); 1081 cmd2.Init(GL_STENCIL_BITS, shared_memory_id_, shared_memory_offset_);
1099 EXPECT_CALL(*gl_, GetIntegerv(GL_STENCIL_BITS, _)) 1082 EXPECT_CALL(*gl_, GetIntegerv(GL_STENCIL_BITS, _))
1100 .WillOnce(SetArgumentPointee<1>(8)) 1083 .WillOnce(SetArgPointee<1>(8))
1101 .RetiresOnSaturation(); 1084 .RetiresOnSaturation();
1102 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd2)); 1085 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd2));
1103 EXPECT_EQ(decoder_->GetGLES2Util()->GLGetNumValuesReturned(GL_STENCIL_BITS), 1086 EXPECT_EQ(decoder_->GetGLES2Util()->GLGetNumValuesReturned(GL_STENCIL_BITS),
1104 result->GetNumResults()); 1087 result->GetNumResults());
1105 EXPECT_EQ(GL_NO_ERROR, GetGLError()); 1088 EXPECT_EQ(GL_NO_ERROR, GetGLError());
1106 EXPECT_EQ(8, result->GetData()[0]); 1089 EXPECT_EQ(8, result->GetData()[0]);
1107 result->size = 0; 1090 result->size = 0;
1108 cmd2.Init(GL_DEPTH_BITS, shared_memory_id_, shared_memory_offset_); 1091 cmd2.Init(GL_DEPTH_BITS, shared_memory_id_, shared_memory_offset_);
1109 EXPECT_CALL(*gl_, GetIntegerv(GL_DEPTH_BITS, _)) 1092 EXPECT_CALL(*gl_, GetIntegerv(GL_DEPTH_BITS, _))
1110 .WillOnce(SetArgumentPointee<1>(24)) 1093 .WillOnce(SetArgPointee<1>(24))
1111 .RetiresOnSaturation(); 1094 .RetiresOnSaturation();
1112 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd2)); 1095 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd2));
1113 EXPECT_EQ(decoder_->GetGLES2Util()->GLGetNumValuesReturned(GL_DEPTH_BITS), 1096 EXPECT_EQ(decoder_->GetGLES2Util()->GLGetNumValuesReturned(GL_DEPTH_BITS),
1114 result->GetNumResults()); 1097 result->GetNumResults());
1115 EXPECT_EQ(GL_NO_ERROR, GetGLError()); 1098 EXPECT_EQ(GL_NO_ERROR, GetGLError());
1116 EXPECT_EQ(24, result->GetData()[0]); 1099 EXPECT_EQ(24, result->GetData()[0]);
1117 } 1100 }
1118 1101
1119 TEST_P(GLES2DecoderManualInitTest, PackedDepthStencilNoRequestedStencil) { 1102 TEST_P(GLES2DecoderManualInitTest, PackedDepthStencilNoRequestedStencil) {
1120 InitState init; 1103 InitState init;
(...skipping 10 matching lines...) Expand all
1131 .WillOnce(Return(GL_NO_ERROR)) 1114 .WillOnce(Return(GL_NO_ERROR))
1132 .WillOnce(Return(GL_NO_ERROR)) 1115 .WillOnce(Return(GL_NO_ERROR))
1133 .WillOnce(Return(GL_NO_ERROR)) 1116 .WillOnce(Return(GL_NO_ERROR))
1134 .RetiresOnSaturation(); 1117 .RetiresOnSaturation();
1135 typedef GetIntegerv::Result Result; 1118 typedef GetIntegerv::Result Result;
1136 Result* result = static_cast<Result*>(shared_memory_address_); 1119 Result* result = static_cast<Result*>(shared_memory_address_);
1137 result->size = 0; 1120 result->size = 0;
1138 GetIntegerv cmd2; 1121 GetIntegerv cmd2;
1139 cmd2.Init(GL_STENCIL_BITS, shared_memory_id_, shared_memory_offset_); 1122 cmd2.Init(GL_STENCIL_BITS, shared_memory_id_, shared_memory_offset_);
1140 EXPECT_CALL(*gl_, GetIntegerv(GL_STENCIL_BITS, _)) 1123 EXPECT_CALL(*gl_, GetIntegerv(GL_STENCIL_BITS, _))
1141 .WillOnce(SetArgumentPointee<1>(8)) 1124 .WillOnce(SetArgPointee<1>(8))
1142 .RetiresOnSaturation(); 1125 .RetiresOnSaturation();
1143 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd2)); 1126 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd2));
1144 EXPECT_EQ(decoder_->GetGLES2Util()->GLGetNumValuesReturned(GL_STENCIL_BITS), 1127 EXPECT_EQ(decoder_->GetGLES2Util()->GLGetNumValuesReturned(GL_STENCIL_BITS),
1145 result->GetNumResults()); 1128 result->GetNumResults());
1146 EXPECT_EQ(GL_NO_ERROR, GetGLError()); 1129 EXPECT_EQ(GL_NO_ERROR, GetGLError());
1147 EXPECT_EQ(0, result->GetData()[0]); 1130 EXPECT_EQ(0, result->GetData()[0]);
1148 result->size = 0; 1131 result->size = 0;
1149 cmd2.Init(GL_DEPTH_BITS, shared_memory_id_, shared_memory_offset_); 1132 cmd2.Init(GL_DEPTH_BITS, shared_memory_id_, shared_memory_offset_);
1150 EXPECT_CALL(*gl_, GetIntegerv(GL_DEPTH_BITS, _)) 1133 EXPECT_CALL(*gl_, GetIntegerv(GL_DEPTH_BITS, _))
1151 .WillOnce(SetArgumentPointee<1>(24)) 1134 .WillOnce(SetArgPointee<1>(24))
1152 .RetiresOnSaturation(); 1135 .RetiresOnSaturation();
1153 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd2)); 1136 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd2));
1154 EXPECT_EQ(decoder_->GetGLES2Util()->GLGetNumValuesReturned(GL_DEPTH_BITS), 1137 EXPECT_EQ(decoder_->GetGLES2Util()->GLGetNumValuesReturned(GL_DEPTH_BITS),
1155 result->GetNumResults()); 1138 result->GetNumResults());
1156 EXPECT_EQ(GL_NO_ERROR, GetGLError()); 1139 EXPECT_EQ(GL_NO_ERROR, GetGLError());
1157 EXPECT_EQ(24, result->GetData()[0]); 1140 EXPECT_EQ(24, result->GetData()[0]);
1158 } 1141 }
1159 1142
1160 TEST_P(GLES2DecoderManualInitTest, PackedDepthStencilRenderbufferDepth) { 1143 TEST_P(GLES2DecoderManualInitTest, PackedDepthStencilRenderbufferDepth) {
1161 InitState init; 1144 InitState init;
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
1201 GL_RENDERBUFFER, 1184 GL_RENDERBUFFER,
1202 client_renderbuffer_id_); 1185 client_renderbuffer_id_);
1203 EXPECT_EQ(error::kNoError, ExecuteCmd(fbrb_cmd)); 1186 EXPECT_EQ(error::kNoError, ExecuteCmd(fbrb_cmd));
1204 1187
1205 typedef GetIntegerv::Result Result; 1188 typedef GetIntegerv::Result Result;
1206 Result* result = static_cast<Result*>(shared_memory_address_); 1189 Result* result = static_cast<Result*>(shared_memory_address_);
1207 result->size = 0; 1190 result->size = 0;
1208 GetIntegerv cmd2; 1191 GetIntegerv cmd2;
1209 cmd2.Init(GL_STENCIL_BITS, shared_memory_id_, shared_memory_offset_); 1192 cmd2.Init(GL_STENCIL_BITS, shared_memory_id_, shared_memory_offset_);
1210 EXPECT_CALL(*gl_, GetIntegerv(GL_STENCIL_BITS, _)) 1193 EXPECT_CALL(*gl_, GetIntegerv(GL_STENCIL_BITS, _))
1211 .WillOnce(SetArgumentPointee<1>(8)) 1194 .WillOnce(SetArgPointee<1>(8))
1212 .RetiresOnSaturation(); 1195 .RetiresOnSaturation();
1213 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd2)); 1196 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd2));
1214 EXPECT_EQ(decoder_->GetGLES2Util()->GLGetNumValuesReturned(GL_STENCIL_BITS), 1197 EXPECT_EQ(decoder_->GetGLES2Util()->GLGetNumValuesReturned(GL_STENCIL_BITS),
1215 result->GetNumResults()); 1198 result->GetNumResults());
1216 EXPECT_EQ(GL_NO_ERROR, GetGLError()); 1199 EXPECT_EQ(GL_NO_ERROR, GetGLError());
1217 EXPECT_EQ(0, result->GetData()[0]); 1200 EXPECT_EQ(0, result->GetData()[0]);
1218 result->size = 0; 1201 result->size = 0;
1219 cmd2.Init(GL_DEPTH_BITS, shared_memory_id_, shared_memory_offset_); 1202 cmd2.Init(GL_DEPTH_BITS, shared_memory_id_, shared_memory_offset_);
1220 EXPECT_CALL(*gl_, GetIntegerv(GL_DEPTH_BITS, _)) 1203 EXPECT_CALL(*gl_, GetIntegerv(GL_DEPTH_BITS, _))
1221 .WillOnce(SetArgumentPointee<1>(24)) 1204 .WillOnce(SetArgPointee<1>(24))
1222 .RetiresOnSaturation(); 1205 .RetiresOnSaturation();
1223 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd2)); 1206 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd2));
1224 EXPECT_EQ(decoder_->GetGLES2Util()->GLGetNumValuesReturned(GL_DEPTH_BITS), 1207 EXPECT_EQ(decoder_->GetGLES2Util()->GLGetNumValuesReturned(GL_DEPTH_BITS),
1225 result->GetNumResults()); 1208 result->GetNumResults());
1226 EXPECT_EQ(GL_NO_ERROR, GetGLError()); 1209 EXPECT_EQ(GL_NO_ERROR, GetGLError());
1227 EXPECT_EQ(24, result->GetData()[0]); 1210 EXPECT_EQ(24, result->GetData()[0]);
1228 } 1211 }
1229 1212
1230 TEST_P(GLES2DecoderManualInitTest, PackedDepthStencilRenderbufferStencil) { 1213 TEST_P(GLES2DecoderManualInitTest, PackedDepthStencilRenderbufferStencil) {
1231 InitState init; 1214 InitState init;
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
1271 GL_RENDERBUFFER, 1254 GL_RENDERBUFFER,
1272 client_renderbuffer_id_); 1255 client_renderbuffer_id_);
1273 EXPECT_EQ(error::kNoError, ExecuteCmd(fbrb_cmd)); 1256 EXPECT_EQ(error::kNoError, ExecuteCmd(fbrb_cmd));
1274 1257
1275 typedef GetIntegerv::Result Result; 1258 typedef GetIntegerv::Result Result;
1276 Result* result = static_cast<Result*>(shared_memory_address_); 1259 Result* result = static_cast<Result*>(shared_memory_address_);
1277 result->size = 0; 1260 result->size = 0;
1278 GetIntegerv cmd2; 1261 GetIntegerv cmd2;
1279 cmd2.Init(GL_STENCIL_BITS, shared_memory_id_, shared_memory_offset_); 1262 cmd2.Init(GL_STENCIL_BITS, shared_memory_id_, shared_memory_offset_);
1280 EXPECT_CALL(*gl_, GetIntegerv(GL_STENCIL_BITS, _)) 1263 EXPECT_CALL(*gl_, GetIntegerv(GL_STENCIL_BITS, _))
1281 .WillOnce(SetArgumentPointee<1>(8)) 1264 .WillOnce(SetArgPointee<1>(8))
1282 .RetiresOnSaturation(); 1265 .RetiresOnSaturation();
1283 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd2)); 1266 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd2));
1284 EXPECT_EQ(decoder_->GetGLES2Util()->GLGetNumValuesReturned(GL_STENCIL_BITS), 1267 EXPECT_EQ(decoder_->GetGLES2Util()->GLGetNumValuesReturned(GL_STENCIL_BITS),
1285 result->GetNumResults()); 1268 result->GetNumResults());
1286 EXPECT_EQ(GL_NO_ERROR, GetGLError()); 1269 EXPECT_EQ(GL_NO_ERROR, GetGLError());
1287 EXPECT_EQ(8, result->GetData()[0]); 1270 EXPECT_EQ(8, result->GetData()[0]);
1288 result->size = 0; 1271 result->size = 0;
1289 cmd2.Init(GL_DEPTH_BITS, shared_memory_id_, shared_memory_offset_); 1272 cmd2.Init(GL_DEPTH_BITS, shared_memory_id_, shared_memory_offset_);
1290 EXPECT_CALL(*gl_, GetIntegerv(GL_DEPTH_BITS, _)) 1273 EXPECT_CALL(*gl_, GetIntegerv(GL_DEPTH_BITS, _))
1291 .WillOnce(SetArgumentPointee<1>(24)) 1274 .WillOnce(SetArgPointee<1>(24))
1292 .RetiresOnSaturation(); 1275 .RetiresOnSaturation();
1293 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd2)); 1276 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd2));
1294 EXPECT_EQ(decoder_->GetGLES2Util()->GLGetNumValuesReturned(GL_DEPTH_BITS), 1277 EXPECT_EQ(decoder_->GetGLES2Util()->GLGetNumValuesReturned(GL_DEPTH_BITS),
1295 result->GetNumResults()); 1278 result->GetNumResults());
1296 EXPECT_EQ(GL_NO_ERROR, GetGLError()); 1279 EXPECT_EQ(GL_NO_ERROR, GetGLError());
1297 EXPECT_EQ(0, result->GetData()[0]); 1280 EXPECT_EQ(0, result->GetData()[0]);
1298 } 1281 }
1299 1282
1300 TEST_P(GLES2DecoderTest, FramebufferRenderbufferGLError) { 1283 TEST_P(GLES2DecoderTest, FramebufferRenderbufferGLError) {
1301 DoBindFramebuffer( 1284 DoBindFramebuffer(
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after
1769 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 1752 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
1770 EXPECT_EQ(GL_OUT_OF_MEMORY, GetGLError()); 1753 EXPECT_EQ(GL_OUT_OF_MEMORY, GetGLError());
1771 } 1754 }
1772 1755
1773 TEST_P(GLES2DecoderWithShaderTest, UnClearedAttachmentsGetClearedOnClear) { 1756 TEST_P(GLES2DecoderWithShaderTest, UnClearedAttachmentsGetClearedOnClear) {
1774 const GLuint kFBOClientTextureId = 4100; 1757 const GLuint kFBOClientTextureId = 4100;
1775 const GLuint kFBOServiceTextureId = 4101; 1758 const GLuint kFBOServiceTextureId = 4101;
1776 1759
1777 // Register a texture id. 1760 // Register a texture id.
1778 EXPECT_CALL(*gl_, GenTextures(_, _)) 1761 EXPECT_CALL(*gl_, GenTextures(_, _))
1779 .WillOnce(SetArgumentPointee<1>(kFBOServiceTextureId)) 1762 .WillOnce(SetArgPointee<1>(kFBOServiceTextureId))
1780 .RetiresOnSaturation(); 1763 .RetiresOnSaturation();
1781 GenHelper<GenTexturesImmediate>(kFBOClientTextureId); 1764 GenHelper<GenTexturesImmediate>(kFBOClientTextureId);
1782 1765
1783 // Setup "render to" texture. 1766 // Setup "render to" texture.
1784 DoBindTexture(GL_TEXTURE_2D, kFBOClientTextureId, kFBOServiceTextureId); 1767 DoBindTexture(GL_TEXTURE_2D, kFBOClientTextureId, kFBOServiceTextureId);
1785 DoTexImage2D( 1768 DoTexImage2D(
1786 GL_TEXTURE_2D, 0, GL_RGBA, 1, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0, 0); 1769 GL_TEXTURE_2D, 0, GL_RGBA, 1, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0, 0);
1787 DoBindFramebuffer( 1770 DoBindFramebuffer(
1788 GL_FRAMEBUFFER, client_framebuffer_id_, kServiceFramebufferId); 1771 GL_FRAMEBUFFER, client_framebuffer_id_, kServiceFramebufferId);
1789 DoFramebufferTexture2D(GL_FRAMEBUFFER, 1772 DoFramebufferTexture2D(GL_FRAMEBUFFER,
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
1826 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 1809 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
1827 EXPECT_EQ(GL_NO_ERROR, GetGLError()); 1810 EXPECT_EQ(GL_NO_ERROR, GetGLError());
1828 } 1811 }
1829 1812
1830 TEST_P(GLES2DecoderWithShaderTest, UnClearedAttachmentsGetClearedOnReadPixels) { 1813 TEST_P(GLES2DecoderWithShaderTest, UnClearedAttachmentsGetClearedOnReadPixels) {
1831 const GLuint kFBOClientTextureId = 4100; 1814 const GLuint kFBOClientTextureId = 4100;
1832 const GLuint kFBOServiceTextureId = 4101; 1815 const GLuint kFBOServiceTextureId = 4101;
1833 1816
1834 // Register a texture id. 1817 // Register a texture id.
1835 EXPECT_CALL(*gl_, GenTextures(_, _)) 1818 EXPECT_CALL(*gl_, GenTextures(_, _))
1836 .WillOnce(SetArgumentPointee<1>(kFBOServiceTextureId)) 1819 .WillOnce(SetArgPointee<1>(kFBOServiceTextureId))
1837 .RetiresOnSaturation(); 1820 .RetiresOnSaturation();
1838 GenHelper<GenTexturesImmediate>(kFBOClientTextureId); 1821 GenHelper<GenTexturesImmediate>(kFBOClientTextureId);
1839 1822
1840 // Setup "render to" texture. 1823 // Setup "render to" texture.
1841 DoBindTexture(GL_TEXTURE_2D, kFBOClientTextureId, kFBOServiceTextureId); 1824 DoBindTexture(GL_TEXTURE_2D, kFBOClientTextureId, kFBOServiceTextureId);
1842 DoTexImage2D( 1825 DoTexImage2D(
1843 GL_TEXTURE_2D, 0, GL_RGBA, 1, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0, 0); 1826 GL_TEXTURE_2D, 0, GL_RGBA, 1, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0, 0);
1844 DoBindFramebuffer( 1827 DoBindFramebuffer(
1845 GL_FRAMEBUFFER, client_framebuffer_id_, kServiceFramebufferId); 1828 GL_FRAMEBUFFER, client_framebuffer_id_, kServiceFramebufferId);
1846 DoFramebufferTexture2D(GL_FRAMEBUFFER, 1829 DoFramebufferTexture2D(GL_FRAMEBUFFER,
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
1897 UnClearedAttachmentsGetClearedOnReadPixelsAndDrawBufferGetsRestored) { 1880 UnClearedAttachmentsGetClearedOnReadPixelsAndDrawBufferGetsRestored) {
1898 InitState init; 1881 InitState init;
1899 init.extensions = "GL_EXT_framebuffer_multisample"; 1882 init.extensions = "GL_EXT_framebuffer_multisample";
1900 init.bind_generates_resource = true; 1883 init.bind_generates_resource = true;
1901 InitDecoder(init); 1884 InitDecoder(init);
1902 const GLuint kFBOClientTextureId = 4100; 1885 const GLuint kFBOClientTextureId = 4100;
1903 const GLuint kFBOServiceTextureId = 4101; 1886 const GLuint kFBOServiceTextureId = 4101;
1904 1887
1905 // Register a texture id. 1888 // Register a texture id.
1906 EXPECT_CALL(*gl_, GenTextures(_, _)) 1889 EXPECT_CALL(*gl_, GenTextures(_, _))
1907 .WillOnce(SetArgumentPointee<1>(kFBOServiceTextureId)) 1890 .WillOnce(SetArgPointee<1>(kFBOServiceTextureId))
1908 .RetiresOnSaturation(); 1891 .RetiresOnSaturation();
1909 GenHelper<GenTexturesImmediate>(kFBOClientTextureId); 1892 GenHelper<GenTexturesImmediate>(kFBOClientTextureId);
1910 1893
1911 // Setup "render from" texture. 1894 // Setup "render from" texture.
1912 DoBindTexture(GL_TEXTURE_2D, kFBOClientTextureId, kFBOServiceTextureId); 1895 DoBindTexture(GL_TEXTURE_2D, kFBOClientTextureId, kFBOServiceTextureId);
1913 DoTexImage2D( 1896 DoTexImage2D(
1914 GL_TEXTURE_2D, 0, GL_RGBA, 1, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0, 0); 1897 GL_TEXTURE_2D, 0, GL_RGBA, 1, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0, 0);
1915 DoBindFramebuffer( 1898 DoBindFramebuffer(
1916 GL_READ_FRAMEBUFFER, client_framebuffer_id_, kServiceFramebufferId); 1899 GL_READ_FRAMEBUFFER, client_framebuffer_id_, kServiceFramebufferId);
1917 DoFramebufferTexture2D(GL_READ_FRAMEBUFFER, 1900 DoFramebufferTexture2D(GL_READ_FRAMEBUFFER,
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
2056 } 2039 }
2057 2040
2058 void GLES2DecoderWithShaderTest::CheckTextureChangesMarkFBOAsNotComplete( 2041 void GLES2DecoderWithShaderTest::CheckTextureChangesMarkFBOAsNotComplete(
2059 bool bound_fbo) { 2042 bool bound_fbo) {
2060 FramebufferManager* framebuffer_manager = group().framebuffer_manager(); 2043 FramebufferManager* framebuffer_manager = group().framebuffer_manager();
2061 const GLuint kFBOClientTextureId = 4100; 2044 const GLuint kFBOClientTextureId = 4100;
2062 const GLuint kFBOServiceTextureId = 4101; 2045 const GLuint kFBOServiceTextureId = 4101;
2063 2046
2064 // Register a texture id. 2047 // Register a texture id.
2065 EXPECT_CALL(*gl_, GenTextures(_, _)) 2048 EXPECT_CALL(*gl_, GenTextures(_, _))
2066 .WillOnce(SetArgumentPointee<1>(kFBOServiceTextureId)) 2049 .WillOnce(SetArgPointee<1>(kFBOServiceTextureId))
2067 .RetiresOnSaturation(); 2050 .RetiresOnSaturation();
2068 GenHelper<GenTexturesImmediate>(kFBOClientTextureId); 2051 GenHelper<GenTexturesImmediate>(kFBOClientTextureId);
2069 2052
2070 SetupTexture(); 2053 SetupTexture();
2071 2054
2072 // Setup "render to" texture. 2055 // Setup "render to" texture.
2073 DoBindTexture(GL_TEXTURE_2D, kFBOClientTextureId, kFBOServiceTextureId); 2056 DoBindTexture(GL_TEXTURE_2D, kFBOClientTextureId, kFBOServiceTextureId);
2074 DoTexImage2D( 2057 DoTexImage2D(
2075 GL_TEXTURE_2D, 0, GL_RGBA, 1, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0, 0); 2058 GL_TEXTURE_2D, 0, GL_RGBA, 1, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0, 0);
2076 DoBindFramebuffer( 2059 DoBindFramebuffer(
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
2299 init.gl_version = "opengl es 2.0"; 2282 init.gl_version = "opengl es 2.0";
2300 init.has_alpha = true; 2283 init.has_alpha = true;
2301 init.bind_generates_resource = true; 2284 init.bind_generates_resource = true;
2302 InitDecoder(init); 2285 InitDecoder(init);
2303 2286
2304 const GLuint kFBOClientTextureId = 4100; 2287 const GLuint kFBOClientTextureId = 4100;
2305 const GLuint kFBOServiceTextureId = 4101; 2288 const GLuint kFBOServiceTextureId = 4101;
2306 2289
2307 // Register a texture id. 2290 // Register a texture id.
2308 EXPECT_CALL(*gl_, GenTextures(_, _)) 2291 EXPECT_CALL(*gl_, GenTextures(_, _))
2309 .WillOnce(SetArgumentPointee<1>(kFBOServiceTextureId)) 2292 .WillOnce(SetArgPointee<1>(kFBOServiceTextureId))
2310 .RetiresOnSaturation(); 2293 .RetiresOnSaturation();
2311 GenHelper<GenTexturesImmediate>(kFBOClientTextureId); 2294 GenHelper<GenTexturesImmediate>(kFBOClientTextureId);
2312 2295
2313 // Setup "render to" texture. 2296 // Setup "render to" texture.
2314 DoBindTexture(GL_TEXTURE_2D, kFBOClientTextureId, kFBOServiceTextureId); 2297 DoBindTexture(GL_TEXTURE_2D, kFBOClientTextureId, kFBOServiceTextureId);
2315 DoTexImage2D( 2298 DoTexImage2D(
2316 GL_TEXTURE_2D, 0, GL_RGBA, 1, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0, 0); 2299 GL_TEXTURE_2D, 0, GL_RGBA, 1, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0, 0);
2317 DoBindFramebuffer( 2300 DoBindFramebuffer(
2318 GL_FRAMEBUFFER, client_framebuffer_id_, kServiceFramebufferId); 2301 GL_FRAMEBUFFER, client_framebuffer_id_, kServiceFramebufferId);
2319 DoFramebufferTexture2D(GL_FRAMEBUFFER, 2302 DoFramebufferTexture2D(GL_FRAMEBUFFER,
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
2400 EXPECT_CALL(*gl_, GetError()).Times(6).RetiresOnSaturation(); 2383 EXPECT_CALL(*gl_, GetError()).Times(6).RetiresOnSaturation();
2401 2384
2402 typedef GetIntegerv::Result Result; 2385 typedef GetIntegerv::Result Result;
2403 Result* result = static_cast<Result*>(shared_memory_address_); 2386 Result* result = static_cast<Result*>(shared_memory_address_);
2404 GetIntegerv cmd; 2387 GetIntegerv cmd;
2405 const GLuint kFBOClientTextureId = 4100; 2388 const GLuint kFBOClientTextureId = 4100;
2406 const GLuint kFBOServiceTextureId = 4101; 2389 const GLuint kFBOServiceTextureId = 4101;
2407 2390
2408 // Register a texture id. 2391 // Register a texture id.
2409 EXPECT_CALL(*gl_, GenTextures(_, _)) 2392 EXPECT_CALL(*gl_, GenTextures(_, _))
2410 .WillOnce(SetArgumentPointee<1>(kFBOServiceTextureId)) 2393 .WillOnce(SetArgPointee<1>(kFBOServiceTextureId))
2411 .RetiresOnSaturation(); 2394 .RetiresOnSaturation();
2412 GenHelper<GenTexturesImmediate>(kFBOClientTextureId); 2395 GenHelper<GenTexturesImmediate>(kFBOClientTextureId);
2413 2396
2414 // Setup "render to" texture. 2397 // Setup "render to" texture.
2415 DoBindTexture(GL_TEXTURE_2D, kFBOClientTextureId, kFBOServiceTextureId); 2398 DoBindTexture(GL_TEXTURE_2D, kFBOClientTextureId, kFBOServiceTextureId);
2416 DoTexImage2D( 2399 DoTexImage2D(
2417 GL_TEXTURE_2D, 0, GL_RGBA, 1, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0, 0); 2400 GL_TEXTURE_2D, 0, GL_RGBA, 1, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0, 0);
2418 DoBindFramebuffer( 2401 DoBindFramebuffer(
2419 GL_FRAMEBUFFER, client_framebuffer_id_, kServiceFramebufferId); 2402 GL_FRAMEBUFFER, client_framebuffer_id_, kServiceFramebufferId);
2420 DoFramebufferTexture2D(GL_FRAMEBUFFER, 2403 DoFramebufferTexture2D(GL_FRAMEBUFFER,
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
2457 .RetiresOnSaturation(); 2440 .RetiresOnSaturation();
2458 2441
2459 typedef GetIntegerv::Result Result; 2442 typedef GetIntegerv::Result Result;
2460 Result* result = static_cast<Result*>(shared_memory_address_); 2443 Result* result = static_cast<Result*>(shared_memory_address_);
2461 GetIntegerv cmd; 2444 GetIntegerv cmd;
2462 const GLuint kFBOClientTextureId = 4100; 2445 const GLuint kFBOClientTextureId = 4100;
2463 const GLuint kFBOServiceTextureId = 4101; 2446 const GLuint kFBOServiceTextureId = 4101;
2464 2447
2465 // Register a texture id. 2448 // Register a texture id.
2466 EXPECT_CALL(*gl_, GenTextures(_, _)) 2449 EXPECT_CALL(*gl_, GenTextures(_, _))
2467 .WillOnce(SetArgumentPointee<1>(kFBOServiceTextureId)) 2450 .WillOnce(SetArgPointee<1>(kFBOServiceTextureId))
2468 .RetiresOnSaturation(); 2451 .RetiresOnSaturation();
2469 GenHelper<GenTexturesImmediate>(kFBOClientTextureId); 2452 GenHelper<GenTexturesImmediate>(kFBOClientTextureId);
2470 2453
2471 // Setup "render to" texture. 2454 // Setup "render to" texture.
2472 DoBindTexture(GL_TEXTURE_2D, kFBOClientTextureId, kFBOServiceTextureId); 2455 DoBindTexture(GL_TEXTURE_2D, kFBOClientTextureId, kFBOServiceTextureId);
2473 DoTexImage2D( 2456 DoTexImage2D(
2474 GL_TEXTURE_2D, 0, GL_RGBA, 1, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0, 0); 2457 GL_TEXTURE_2D, 0, GL_RGBA, 1, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0, 0);
2475 DoBindFramebuffer( 2458 DoBindFramebuffer(
2476 GL_FRAMEBUFFER, client_framebuffer_id_, kServiceFramebufferId); 2459 GL_FRAMEBUFFER, client_framebuffer_id_, kServiceFramebufferId);
2477 DoFramebufferTexture2D(GL_FRAMEBUFFER, 2460 DoFramebufferTexture2D(GL_FRAMEBUFFER,
(...skipping 22 matching lines...) Expand all
2500 EXPECT_EQ(1, result->GetNumResults()); 2483 EXPECT_EQ(1, result->GetNumResults());
2501 EXPECT_EQ(GL_NO_ERROR, GetGLError()); 2484 EXPECT_EQ(GL_NO_ERROR, GetGLError());
2502 } 2485 }
2503 2486
2504 // TODO(gman): PixelStorei 2487 // TODO(gman): PixelStorei
2505 2488
2506 // TODO(gman): SwapBuffers 2489 // TODO(gman): SwapBuffers
2507 2490
2508 } // namespace gles2 2491 } // namespace gles2
2509 } // namespace gpu 2492 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698