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

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: fix gpu_unittests and gl_tests 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()) 154 EXPECT_CALL(*gl_,
157 .WillOnce(Return(GL_NO_ERROR)) 155 GetFramebufferAttachmentParameterivEXT(
158 .RetiresOnSaturation(); 156 GL_FRAMEBUFFER,
159 EXPECT_CALL(*gl_, GetError()) 157 GL_COLOR_ATTACHMENT0,
160 .WillOnce(Return(GL_NO_ERROR)) 158 GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME,
161 .WillOnce(Return(GL_NO_ERROR)) 159 _))
160 .WillOnce(SetArgPointee<3>(client_renderbuffer_id_))
162 .RetiresOnSaturation(); 161 .RetiresOnSaturation();
163 GetFramebufferAttachmentParameteriv::Result* result = 162 GetFramebufferAttachmentParameteriv::Result* result =
164 static_cast<GetFramebufferAttachmentParameteriv::Result*>( 163 static_cast<GetFramebufferAttachmentParameteriv::Result*>(
165 shared_memory_address_); 164 shared_memory_address_);
166 result->size = 0; 165 result->size = 0;
167 const GLint* result_value = result->GetData(); 166 const GLint* result_value = result->GetData();
168 FramebufferRenderbuffer fbrb_cmd; 167 FramebufferRenderbuffer fbrb_cmd;
169 GetFramebufferAttachmentParameteriv cmd; 168 GetFramebufferAttachmentParameteriv cmd;
170 fbrb_cmd.Init(GL_FRAMEBUFFER, 169 fbrb_cmd.Init(GL_FRAMEBUFFER,
171 GL_COLOR_ATTACHMENT0, 170 GL_COLOR_ATTACHMENT0,
172 GL_RENDERBUFFER, 171 GL_RENDERBUFFER,
173 client_renderbuffer_id_); 172 client_renderbuffer_id_);
174 cmd.Init(GL_FRAMEBUFFER, 173 cmd.Init(GL_FRAMEBUFFER,
175 GL_COLOR_ATTACHMENT0, 174 GL_COLOR_ATTACHMENT0,
176 GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, 175 GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME,
177 shared_memory_id_, 176 shared_memory_id_,
178 shared_memory_offset_); 177 shared_memory_offset_);
179 EXPECT_EQ(error::kNoError, ExecuteCmd(fbrb_cmd)); 178 EXPECT_EQ(error::kNoError, ExecuteCmd(fbrb_cmd));
180 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 179 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
181 EXPECT_EQ(GL_NO_ERROR, GetGLError()); 180 EXPECT_EQ(GL_NO_ERROR, GetGLError());
182 EXPECT_EQ(static_cast<GLuint>(*result_value), client_renderbuffer_id_); 181 EXPECT_EQ(client_renderbuffer_id_, static_cast<GLuint>(*result_value));
183 } 182 }
184 183
185 TEST_P(GLES2DecoderTest, GetFramebufferAttachmentParameterivWithTexture) { 184 TEST_P(GLES2DecoderTest, GetFramebufferAttachmentParameterivWithTexture) {
186 DoBindFramebuffer( 185 DoBindFramebuffer(
187 GL_FRAMEBUFFER, client_framebuffer_id_, kServiceFramebufferId); 186 GL_FRAMEBUFFER, client_framebuffer_id_, kServiceFramebufferId);
188 EXPECT_CALL(*gl_, GetError()) 187 EXPECT_CALL(*gl_, GetError())
189 .WillOnce(Return(GL_NO_ERROR)) 188 .WillRepeatedly(Return(GL_NO_ERROR));
190 .RetiresOnSaturation();
191 EXPECT_CALL(*gl_, 189 EXPECT_CALL(*gl_,
192 FramebufferTexture2DEXT(GL_FRAMEBUFFER, 190 FramebufferTexture2DEXT(GL_FRAMEBUFFER,
193 GL_COLOR_ATTACHMENT0, 191 GL_COLOR_ATTACHMENT0,
194 GL_TEXTURE_2D, 192 GL_TEXTURE_2D,
195 kServiceTextureId, 193 kServiceTextureId,
196 0)) 194 0))
197 .Times(1) 195 .Times(1)
198 .RetiresOnSaturation(); 196 .RetiresOnSaturation();
199 EXPECT_CALL(*gl_, GetError()) 197 EXPECT_CALL(*gl_,
200 .WillOnce(Return(GL_NO_ERROR)) 198 GetFramebufferAttachmentParameterivEXT(
201 .RetiresOnSaturation(); 199 GL_FRAMEBUFFER,
202 EXPECT_CALL(*gl_, GetError()) 200 GL_COLOR_ATTACHMENT0,
203 .WillOnce(Return(GL_NO_ERROR)) 201 GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME,
204 .WillOnce(Return(GL_NO_ERROR)) 202 _))
203 .WillOnce(SetArgPointee<3>(client_texture_id_))
205 .RetiresOnSaturation(); 204 .RetiresOnSaturation();
206 GetFramebufferAttachmentParameteriv::Result* result = 205 GetFramebufferAttachmentParameteriv::Result* result =
207 static_cast<GetFramebufferAttachmentParameteriv::Result*>( 206 static_cast<GetFramebufferAttachmentParameteriv::Result*>(
208 shared_memory_address_); 207 shared_memory_address_);
209 result->SetNumResults(0); 208 result->SetNumResults(0);
210 const GLint* result_value = result->GetData(); 209 const GLint* result_value = result->GetData();
211 FramebufferTexture2D fbtex_cmd; 210 FramebufferTexture2D fbtex_cmd;
212 GetFramebufferAttachmentParameteriv cmd; 211 GetFramebufferAttachmentParameteriv cmd;
213 fbtex_cmd.Init(GL_FRAMEBUFFER, 212 fbtex_cmd.Init(GL_FRAMEBUFFER,
214 GL_COLOR_ATTACHMENT0, 213 GL_COLOR_ATTACHMENT0,
215 GL_TEXTURE_2D, 214 GL_TEXTURE_2D,
216 client_texture_id_); 215 client_texture_id_);
217 cmd.Init(GL_FRAMEBUFFER, 216 cmd.Init(GL_FRAMEBUFFER,
218 GL_COLOR_ATTACHMENT0, 217 GL_COLOR_ATTACHMENT0,
219 GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, 218 GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME,
220 shared_memory_id_, 219 shared_memory_id_,
221 shared_memory_offset_); 220 shared_memory_offset_);
222 EXPECT_EQ(error::kNoError, ExecuteCmd(fbtex_cmd)); 221 EXPECT_EQ(error::kNoError, ExecuteCmd(fbtex_cmd));
223 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 222 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
224 EXPECT_EQ(GL_NO_ERROR, GetGLError()); 223 EXPECT_EQ(GL_NO_ERROR, GetGLError());
225 EXPECT_EQ(static_cast<GLuint>(*result_value), client_texture_id_); 224 EXPECT_EQ(client_texture_id_, static_cast<GLuint>(*result_value));
226 } 225 }
227 226
228 TEST_P(GLES2DecoderWithShaderTest, 227 TEST_P(GLES2DecoderWithShaderTest,
229 GetRenderbufferParameterivRebindRenderbuffer) { 228 GetRenderbufferParameterivRebindRenderbuffer) {
230 SetupTexture(); 229 SetupTexture();
231 DoBindRenderbuffer( 230 DoBindRenderbuffer(
232 GL_RENDERBUFFER, client_renderbuffer_id_, kServiceRenderbufferId); 231 GL_RENDERBUFFER, client_renderbuffer_id_, kServiceRenderbufferId);
233 DoRenderbufferStorage(GL_RENDERBUFFER, GL_RGBA4, GL_RGBA, 1, 1, GL_NO_ERROR); 232 DoRenderbufferStorage(GL_RENDERBUFFER, GL_RGBA4, GL_RGBA, 1, 1, GL_NO_ERROR);
234 233
235 GetRenderbufferParameteriv cmd; 234 GetRenderbufferParameteriv cmd;
(...skipping 743 matching lines...) Expand 10 before | Expand all | Expand 10 after
979 init.bind_generates_resource = true; 978 init.bind_generates_resource = true;
980 InitDecoder(init); 979 InitDecoder(init);
981 980
982 EXPECT_CALL(*gl_, GetError()) 981 EXPECT_CALL(*gl_, GetError())
983 .WillOnce(Return(GL_NO_ERROR)) 982 .WillOnce(Return(GL_NO_ERROR))
984 .WillOnce(Return(GL_NO_ERROR)) 983 .WillOnce(Return(GL_NO_ERROR))
985 .RetiresOnSaturation(); 984 .RetiresOnSaturation();
986 typedef GetIntegerv::Result Result; 985 typedef GetIntegerv::Result Result;
987 Result* result = static_cast<Result*>(shared_memory_address_); 986 Result* result = static_cast<Result*>(shared_memory_address_);
988 EXPECT_CALL(*gl_, GetIntegerv(GL_DEPTH_BITS, _)) 987 EXPECT_CALL(*gl_, GetIntegerv(GL_DEPTH_BITS, _))
989 .WillOnce(SetArgumentPointee<1>(24)) 988 .WillOnce(SetArgPointee<1>(24))
990 .RetiresOnSaturation(); 989 .RetiresOnSaturation();
991 result->size = 0; 990 result->size = 0;
992 GetIntegerv cmd2; 991 GetIntegerv cmd2;
993 cmd2.Init(GL_DEPTH_BITS, shared_memory_id_, shared_memory_offset_); 992 cmd2.Init(GL_DEPTH_BITS, shared_memory_id_, shared_memory_offset_);
994 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd2)); 993 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd2));
995 EXPECT_EQ(decoder_->GetGLES2Util()->GLGetNumValuesReturned(GL_DEPTH_BITS), 994 EXPECT_EQ(decoder_->GetGLES2Util()->GLGetNumValuesReturned(GL_DEPTH_BITS),
996 result->GetNumResults()); 995 result->GetNumResults());
997 EXPECT_EQ(GL_NO_ERROR, GetGLError()); 996 EXPECT_EQ(GL_NO_ERROR, GetGLError());
998 EXPECT_EQ(24, result->GetData()[0]); 997 EXPECT_EQ(24, result->GetData()[0]);
999 } 998 }
1000 999
1001 TEST_P(GLES2DecoderManualInitTest, ActualDepthDoesNotMatchRequestedDepth) { 1000 TEST_P(GLES2DecoderManualInitTest, ActualDepthDoesNotMatchRequestedDepth) {
1002 InitState init; 1001 InitState init;
1003 init.has_depth = true; 1002 init.has_depth = true;
1004 init.bind_generates_resource = true; 1003 init.bind_generates_resource = true;
1005 InitDecoder(init); 1004 InitDecoder(init);
1006 1005
1007 EXPECT_CALL(*gl_, GetError()) 1006 EXPECT_CALL(*gl_, GetError())
1008 .WillOnce(Return(GL_NO_ERROR)) 1007 .WillOnce(Return(GL_NO_ERROR))
1009 .WillOnce(Return(GL_NO_ERROR)) 1008 .WillOnce(Return(GL_NO_ERROR))
1010 .RetiresOnSaturation(); 1009 .RetiresOnSaturation();
1011 typedef GetIntegerv::Result Result; 1010 typedef GetIntegerv::Result Result;
1012 Result* result = static_cast<Result*>(shared_memory_address_); 1011 Result* result = static_cast<Result*>(shared_memory_address_);
1013 EXPECT_CALL(*gl_, GetIntegerv(GL_DEPTH_BITS, _)) 1012 EXPECT_CALL(*gl_, GetIntegerv(GL_DEPTH_BITS, _))
1014 .WillOnce(SetArgumentPointee<1>(24)) 1013 .WillOnce(SetArgPointee<1>(24))
1015 .RetiresOnSaturation(); 1014 .RetiresOnSaturation();
1016 result->size = 0; 1015 result->size = 0;
1017 GetIntegerv cmd2; 1016 GetIntegerv cmd2;
1018 cmd2.Init(GL_DEPTH_BITS, shared_memory_id_, shared_memory_offset_); 1017 cmd2.Init(GL_DEPTH_BITS, shared_memory_id_, shared_memory_offset_);
1019 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd2)); 1018 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd2));
1020 EXPECT_EQ(decoder_->GetGLES2Util()->GLGetNumValuesReturned(GL_DEPTH_BITS), 1019 EXPECT_EQ(decoder_->GetGLES2Util()->GLGetNumValuesReturned(GL_DEPTH_BITS),
1021 result->GetNumResults()); 1020 result->GetNumResults());
1022 EXPECT_EQ(GL_NO_ERROR, GetGLError()); 1021 EXPECT_EQ(GL_NO_ERROR, GetGLError());
1023 EXPECT_EQ(0, result->GetData()[0]); 1022 EXPECT_EQ(0, result->GetData()[0]);
1024 } 1023 }
1025 1024
1026 TEST_P(GLES2DecoderManualInitTest, ActualStencilMatchesRequestedStencil) { 1025 TEST_P(GLES2DecoderManualInitTest, ActualStencilMatchesRequestedStencil) {
1027 InitState init; 1026 InitState init;
1028 init.has_stencil = true; 1027 init.has_stencil = true;
1029 init.request_stencil = true; 1028 init.request_stencil = true;
1030 init.bind_generates_resource = true; 1029 init.bind_generates_resource = true;
1031 InitDecoder(init); 1030 InitDecoder(init);
1032 1031
1033 EXPECT_CALL(*gl_, GetError()) 1032 EXPECT_CALL(*gl_, GetError())
1034 .WillOnce(Return(GL_NO_ERROR)) 1033 .WillOnce(Return(GL_NO_ERROR))
1035 .WillOnce(Return(GL_NO_ERROR)) 1034 .WillOnce(Return(GL_NO_ERROR))
1036 .RetiresOnSaturation(); 1035 .RetiresOnSaturation();
1037 typedef GetIntegerv::Result Result; 1036 typedef GetIntegerv::Result Result;
1038 Result* result = static_cast<Result*>(shared_memory_address_); 1037 Result* result = static_cast<Result*>(shared_memory_address_);
1039 EXPECT_CALL(*gl_, GetIntegerv(GL_STENCIL_BITS, _)) 1038 EXPECT_CALL(*gl_, GetIntegerv(GL_STENCIL_BITS, _))
1040 .WillOnce(SetArgumentPointee<1>(8)) 1039 .WillOnce(SetArgPointee<1>(8))
1041 .RetiresOnSaturation(); 1040 .RetiresOnSaturation();
1042 result->size = 0; 1041 result->size = 0;
1043 GetIntegerv cmd2; 1042 GetIntegerv cmd2;
1044 cmd2.Init(GL_STENCIL_BITS, shared_memory_id_, shared_memory_offset_); 1043 cmd2.Init(GL_STENCIL_BITS, shared_memory_id_, shared_memory_offset_);
1045 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd2)); 1044 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd2));
1046 EXPECT_EQ(decoder_->GetGLES2Util()->GLGetNumValuesReturned(GL_STENCIL_BITS), 1045 EXPECT_EQ(decoder_->GetGLES2Util()->GLGetNumValuesReturned(GL_STENCIL_BITS),
1047 result->GetNumResults()); 1046 result->GetNumResults());
1048 EXPECT_EQ(GL_NO_ERROR, GetGLError()); 1047 EXPECT_EQ(GL_NO_ERROR, GetGLError());
1049 EXPECT_EQ(8, result->GetData()[0]); 1048 EXPECT_EQ(8, result->GetData()[0]);
1050 } 1049 }
1051 1050
1052 TEST_P(GLES2DecoderManualInitTest, ActualStencilDoesNotMatchRequestedStencil) { 1051 TEST_P(GLES2DecoderManualInitTest, ActualStencilDoesNotMatchRequestedStencil) {
1053 InitState init; 1052 InitState init;
1054 init.has_stencil = true; 1053 init.has_stencil = true;
1055 init.bind_generates_resource = true; 1054 init.bind_generates_resource = true;
1056 InitDecoder(init); 1055 InitDecoder(init);
1057 1056
1058 EXPECT_CALL(*gl_, GetError()) 1057 EXPECT_CALL(*gl_, GetError())
1059 .WillOnce(Return(GL_NO_ERROR)) 1058 .WillOnce(Return(GL_NO_ERROR))
1060 .WillOnce(Return(GL_NO_ERROR)) 1059 .WillOnce(Return(GL_NO_ERROR))
1061 .RetiresOnSaturation(); 1060 .RetiresOnSaturation();
1062 typedef GetIntegerv::Result Result; 1061 typedef GetIntegerv::Result Result;
1063 Result* result = static_cast<Result*>(shared_memory_address_); 1062 Result* result = static_cast<Result*>(shared_memory_address_);
1064 EXPECT_CALL(*gl_, GetIntegerv(GL_STENCIL_BITS, _)) 1063 EXPECT_CALL(*gl_, GetIntegerv(GL_STENCIL_BITS, _))
1065 .WillOnce(SetArgumentPointee<1>(8)) 1064 .WillOnce(SetArgPointee<1>(8))
1066 .RetiresOnSaturation(); 1065 .RetiresOnSaturation();
1067 result->size = 0; 1066 result->size = 0;
1068 GetIntegerv cmd2; 1067 GetIntegerv cmd2;
1069 cmd2.Init(GL_STENCIL_BITS, shared_memory_id_, shared_memory_offset_); 1068 cmd2.Init(GL_STENCIL_BITS, shared_memory_id_, shared_memory_offset_);
1070 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd2)); 1069 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd2));
1071 EXPECT_EQ(decoder_->GetGLES2Util()->GLGetNumValuesReturned(GL_STENCIL_BITS), 1070 EXPECT_EQ(decoder_->GetGLES2Util()->GLGetNumValuesReturned(GL_STENCIL_BITS),
1072 result->GetNumResults()); 1071 result->GetNumResults());
1073 EXPECT_EQ(GL_NO_ERROR, GetGLError()); 1072 EXPECT_EQ(GL_NO_ERROR, GetGLError());
1074 EXPECT_EQ(0, result->GetData()[0]); 1073 EXPECT_EQ(0, result->GetData()[0]);
1075 } 1074 }
(...skipping 14 matching lines...) Expand all
1090 .WillOnce(Return(GL_NO_ERROR)) 1089 .WillOnce(Return(GL_NO_ERROR))
1091 .WillOnce(Return(GL_NO_ERROR)) 1090 .WillOnce(Return(GL_NO_ERROR))
1092 .WillOnce(Return(GL_NO_ERROR)) 1091 .WillOnce(Return(GL_NO_ERROR))
1093 .RetiresOnSaturation(); 1092 .RetiresOnSaturation();
1094 typedef GetIntegerv::Result Result; 1093 typedef GetIntegerv::Result Result;
1095 Result* result = static_cast<Result*>(shared_memory_address_); 1094 Result* result = static_cast<Result*>(shared_memory_address_);
1096 result->size = 0; 1095 result->size = 0;
1097 GetIntegerv cmd2; 1096 GetIntegerv cmd2;
1098 cmd2.Init(GL_STENCIL_BITS, shared_memory_id_, shared_memory_offset_); 1097 cmd2.Init(GL_STENCIL_BITS, shared_memory_id_, shared_memory_offset_);
1099 EXPECT_CALL(*gl_, GetIntegerv(GL_STENCIL_BITS, _)) 1098 EXPECT_CALL(*gl_, GetIntegerv(GL_STENCIL_BITS, _))
1100 .WillOnce(SetArgumentPointee<1>(8)) 1099 .WillOnce(SetArgPointee<1>(8))
1101 .RetiresOnSaturation(); 1100 .RetiresOnSaturation();
1102 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd2)); 1101 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd2));
1103 EXPECT_EQ(decoder_->GetGLES2Util()->GLGetNumValuesReturned(GL_STENCIL_BITS), 1102 EXPECT_EQ(decoder_->GetGLES2Util()->GLGetNumValuesReturned(GL_STENCIL_BITS),
1104 result->GetNumResults()); 1103 result->GetNumResults());
1105 EXPECT_EQ(GL_NO_ERROR, GetGLError()); 1104 EXPECT_EQ(GL_NO_ERROR, GetGLError());
1106 EXPECT_EQ(8, result->GetData()[0]); 1105 EXPECT_EQ(8, result->GetData()[0]);
1107 result->size = 0; 1106 result->size = 0;
1108 cmd2.Init(GL_DEPTH_BITS, shared_memory_id_, shared_memory_offset_); 1107 cmd2.Init(GL_DEPTH_BITS, shared_memory_id_, shared_memory_offset_);
1109 EXPECT_CALL(*gl_, GetIntegerv(GL_DEPTH_BITS, _)) 1108 EXPECT_CALL(*gl_, GetIntegerv(GL_DEPTH_BITS, _))
1110 .WillOnce(SetArgumentPointee<1>(24)) 1109 .WillOnce(SetArgPointee<1>(24))
1111 .RetiresOnSaturation(); 1110 .RetiresOnSaturation();
1112 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd2)); 1111 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd2));
1113 EXPECT_EQ(decoder_->GetGLES2Util()->GLGetNumValuesReturned(GL_DEPTH_BITS), 1112 EXPECT_EQ(decoder_->GetGLES2Util()->GLGetNumValuesReturned(GL_DEPTH_BITS),
1114 result->GetNumResults()); 1113 result->GetNumResults());
1115 EXPECT_EQ(GL_NO_ERROR, GetGLError()); 1114 EXPECT_EQ(GL_NO_ERROR, GetGLError());
1116 EXPECT_EQ(24, result->GetData()[0]); 1115 EXPECT_EQ(24, result->GetData()[0]);
1117 } 1116 }
1118 1117
1119 TEST_P(GLES2DecoderManualInitTest, PackedDepthStencilNoRequestedStencil) { 1118 TEST_P(GLES2DecoderManualInitTest, PackedDepthStencilNoRequestedStencil) {
1120 InitState init; 1119 InitState init;
(...skipping 10 matching lines...) Expand all
1131 .WillOnce(Return(GL_NO_ERROR)) 1130 .WillOnce(Return(GL_NO_ERROR))
1132 .WillOnce(Return(GL_NO_ERROR)) 1131 .WillOnce(Return(GL_NO_ERROR))
1133 .WillOnce(Return(GL_NO_ERROR)) 1132 .WillOnce(Return(GL_NO_ERROR))
1134 .RetiresOnSaturation(); 1133 .RetiresOnSaturation();
1135 typedef GetIntegerv::Result Result; 1134 typedef GetIntegerv::Result Result;
1136 Result* result = static_cast<Result*>(shared_memory_address_); 1135 Result* result = static_cast<Result*>(shared_memory_address_);
1137 result->size = 0; 1136 result->size = 0;
1138 GetIntegerv cmd2; 1137 GetIntegerv cmd2;
1139 cmd2.Init(GL_STENCIL_BITS, shared_memory_id_, shared_memory_offset_); 1138 cmd2.Init(GL_STENCIL_BITS, shared_memory_id_, shared_memory_offset_);
1140 EXPECT_CALL(*gl_, GetIntegerv(GL_STENCIL_BITS, _)) 1139 EXPECT_CALL(*gl_, GetIntegerv(GL_STENCIL_BITS, _))
1141 .WillOnce(SetArgumentPointee<1>(8)) 1140 .WillOnce(SetArgPointee<1>(8))
1142 .RetiresOnSaturation(); 1141 .RetiresOnSaturation();
1143 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd2)); 1142 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd2));
1144 EXPECT_EQ(decoder_->GetGLES2Util()->GLGetNumValuesReturned(GL_STENCIL_BITS), 1143 EXPECT_EQ(decoder_->GetGLES2Util()->GLGetNumValuesReturned(GL_STENCIL_BITS),
1145 result->GetNumResults()); 1144 result->GetNumResults());
1146 EXPECT_EQ(GL_NO_ERROR, GetGLError()); 1145 EXPECT_EQ(GL_NO_ERROR, GetGLError());
1147 EXPECT_EQ(0, result->GetData()[0]); 1146 EXPECT_EQ(0, result->GetData()[0]);
1148 result->size = 0; 1147 result->size = 0;
1149 cmd2.Init(GL_DEPTH_BITS, shared_memory_id_, shared_memory_offset_); 1148 cmd2.Init(GL_DEPTH_BITS, shared_memory_id_, shared_memory_offset_);
1150 EXPECT_CALL(*gl_, GetIntegerv(GL_DEPTH_BITS, _)) 1149 EXPECT_CALL(*gl_, GetIntegerv(GL_DEPTH_BITS, _))
1151 .WillOnce(SetArgumentPointee<1>(24)) 1150 .WillOnce(SetArgPointee<1>(24))
1152 .RetiresOnSaturation(); 1151 .RetiresOnSaturation();
1153 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd2)); 1152 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd2));
1154 EXPECT_EQ(decoder_->GetGLES2Util()->GLGetNumValuesReturned(GL_DEPTH_BITS), 1153 EXPECT_EQ(decoder_->GetGLES2Util()->GLGetNumValuesReturned(GL_DEPTH_BITS),
1155 result->GetNumResults()); 1154 result->GetNumResults());
1156 EXPECT_EQ(GL_NO_ERROR, GetGLError()); 1155 EXPECT_EQ(GL_NO_ERROR, GetGLError());
1157 EXPECT_EQ(24, result->GetData()[0]); 1156 EXPECT_EQ(24, result->GetData()[0]);
1158 } 1157 }
1159 1158
1160 TEST_P(GLES2DecoderManualInitTest, PackedDepthStencilRenderbufferDepth) { 1159 TEST_P(GLES2DecoderManualInitTest, PackedDepthStencilRenderbufferDepth) {
1161 InitState init; 1160 InitState init;
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
1201 GL_RENDERBUFFER, 1200 GL_RENDERBUFFER,
1202 client_renderbuffer_id_); 1201 client_renderbuffer_id_);
1203 EXPECT_EQ(error::kNoError, ExecuteCmd(fbrb_cmd)); 1202 EXPECT_EQ(error::kNoError, ExecuteCmd(fbrb_cmd));
1204 1203
1205 typedef GetIntegerv::Result Result; 1204 typedef GetIntegerv::Result Result;
1206 Result* result = static_cast<Result*>(shared_memory_address_); 1205 Result* result = static_cast<Result*>(shared_memory_address_);
1207 result->size = 0; 1206 result->size = 0;
1208 GetIntegerv cmd2; 1207 GetIntegerv cmd2;
1209 cmd2.Init(GL_STENCIL_BITS, shared_memory_id_, shared_memory_offset_); 1208 cmd2.Init(GL_STENCIL_BITS, shared_memory_id_, shared_memory_offset_);
1210 EXPECT_CALL(*gl_, GetIntegerv(GL_STENCIL_BITS, _)) 1209 EXPECT_CALL(*gl_, GetIntegerv(GL_STENCIL_BITS, _))
1211 .WillOnce(SetArgumentPointee<1>(8)) 1210 .WillOnce(SetArgPointee<1>(8))
1212 .RetiresOnSaturation(); 1211 .RetiresOnSaturation();
1213 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd2)); 1212 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd2));
1214 EXPECT_EQ(decoder_->GetGLES2Util()->GLGetNumValuesReturned(GL_STENCIL_BITS), 1213 EXPECT_EQ(decoder_->GetGLES2Util()->GLGetNumValuesReturned(GL_STENCIL_BITS),
1215 result->GetNumResults()); 1214 result->GetNumResults());
1216 EXPECT_EQ(GL_NO_ERROR, GetGLError()); 1215 EXPECT_EQ(GL_NO_ERROR, GetGLError());
1217 EXPECT_EQ(0, result->GetData()[0]); 1216 EXPECT_EQ(0, result->GetData()[0]);
1218 result->size = 0; 1217 result->size = 0;
1219 cmd2.Init(GL_DEPTH_BITS, shared_memory_id_, shared_memory_offset_); 1218 cmd2.Init(GL_DEPTH_BITS, shared_memory_id_, shared_memory_offset_);
1220 EXPECT_CALL(*gl_, GetIntegerv(GL_DEPTH_BITS, _)) 1219 EXPECT_CALL(*gl_, GetIntegerv(GL_DEPTH_BITS, _))
1221 .WillOnce(SetArgumentPointee<1>(24)) 1220 .WillOnce(SetArgPointee<1>(24))
1222 .RetiresOnSaturation(); 1221 .RetiresOnSaturation();
1223 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd2)); 1222 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd2));
1224 EXPECT_EQ(decoder_->GetGLES2Util()->GLGetNumValuesReturned(GL_DEPTH_BITS), 1223 EXPECT_EQ(decoder_->GetGLES2Util()->GLGetNumValuesReturned(GL_DEPTH_BITS),
1225 result->GetNumResults()); 1224 result->GetNumResults());
1226 EXPECT_EQ(GL_NO_ERROR, GetGLError()); 1225 EXPECT_EQ(GL_NO_ERROR, GetGLError());
1227 EXPECT_EQ(24, result->GetData()[0]); 1226 EXPECT_EQ(24, result->GetData()[0]);
1228 } 1227 }
1229 1228
1230 TEST_P(GLES2DecoderManualInitTest, PackedDepthStencilRenderbufferStencil) { 1229 TEST_P(GLES2DecoderManualInitTest, PackedDepthStencilRenderbufferStencil) {
1231 InitState init; 1230 InitState init;
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
1271 GL_RENDERBUFFER, 1270 GL_RENDERBUFFER,
1272 client_renderbuffer_id_); 1271 client_renderbuffer_id_);
1273 EXPECT_EQ(error::kNoError, ExecuteCmd(fbrb_cmd)); 1272 EXPECT_EQ(error::kNoError, ExecuteCmd(fbrb_cmd));
1274 1273
1275 typedef GetIntegerv::Result Result; 1274 typedef GetIntegerv::Result Result;
1276 Result* result = static_cast<Result*>(shared_memory_address_); 1275 Result* result = static_cast<Result*>(shared_memory_address_);
1277 result->size = 0; 1276 result->size = 0;
1278 GetIntegerv cmd2; 1277 GetIntegerv cmd2;
1279 cmd2.Init(GL_STENCIL_BITS, shared_memory_id_, shared_memory_offset_); 1278 cmd2.Init(GL_STENCIL_BITS, shared_memory_id_, shared_memory_offset_);
1280 EXPECT_CALL(*gl_, GetIntegerv(GL_STENCIL_BITS, _)) 1279 EXPECT_CALL(*gl_, GetIntegerv(GL_STENCIL_BITS, _))
1281 .WillOnce(SetArgumentPointee<1>(8)) 1280 .WillOnce(SetArgPointee<1>(8))
1282 .RetiresOnSaturation(); 1281 .RetiresOnSaturation();
1283 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd2)); 1282 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd2));
1284 EXPECT_EQ(decoder_->GetGLES2Util()->GLGetNumValuesReturned(GL_STENCIL_BITS), 1283 EXPECT_EQ(decoder_->GetGLES2Util()->GLGetNumValuesReturned(GL_STENCIL_BITS),
1285 result->GetNumResults()); 1284 result->GetNumResults());
1286 EXPECT_EQ(GL_NO_ERROR, GetGLError()); 1285 EXPECT_EQ(GL_NO_ERROR, GetGLError());
1287 EXPECT_EQ(8, result->GetData()[0]); 1286 EXPECT_EQ(8, result->GetData()[0]);
1288 result->size = 0; 1287 result->size = 0;
1289 cmd2.Init(GL_DEPTH_BITS, shared_memory_id_, shared_memory_offset_); 1288 cmd2.Init(GL_DEPTH_BITS, shared_memory_id_, shared_memory_offset_);
1290 EXPECT_CALL(*gl_, GetIntegerv(GL_DEPTH_BITS, _)) 1289 EXPECT_CALL(*gl_, GetIntegerv(GL_DEPTH_BITS, _))
1291 .WillOnce(SetArgumentPointee<1>(24)) 1290 .WillOnce(SetArgPointee<1>(24))
1292 .RetiresOnSaturation(); 1291 .RetiresOnSaturation();
1293 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd2)); 1292 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd2));
1294 EXPECT_EQ(decoder_->GetGLES2Util()->GLGetNumValuesReturned(GL_DEPTH_BITS), 1293 EXPECT_EQ(decoder_->GetGLES2Util()->GLGetNumValuesReturned(GL_DEPTH_BITS),
1295 result->GetNumResults()); 1294 result->GetNumResults());
1296 EXPECT_EQ(GL_NO_ERROR, GetGLError()); 1295 EXPECT_EQ(GL_NO_ERROR, GetGLError());
1297 EXPECT_EQ(0, result->GetData()[0]); 1296 EXPECT_EQ(0, result->GetData()[0]);
1298 } 1297 }
1299 1298
1300 TEST_P(GLES2DecoderTest, FramebufferRenderbufferGLError) { 1299 TEST_P(GLES2DecoderTest, FramebufferRenderbufferGLError) {
1301 DoBindFramebuffer( 1300 DoBindFramebuffer(
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after
1769 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 1768 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
1770 EXPECT_EQ(GL_OUT_OF_MEMORY, GetGLError()); 1769 EXPECT_EQ(GL_OUT_OF_MEMORY, GetGLError());
1771 } 1770 }
1772 1771
1773 TEST_P(GLES2DecoderWithShaderTest, UnClearedAttachmentsGetClearedOnClear) { 1772 TEST_P(GLES2DecoderWithShaderTest, UnClearedAttachmentsGetClearedOnClear) {
1774 const GLuint kFBOClientTextureId = 4100; 1773 const GLuint kFBOClientTextureId = 4100;
1775 const GLuint kFBOServiceTextureId = 4101; 1774 const GLuint kFBOServiceTextureId = 4101;
1776 1775
1777 // Register a texture id. 1776 // Register a texture id.
1778 EXPECT_CALL(*gl_, GenTextures(_, _)) 1777 EXPECT_CALL(*gl_, GenTextures(_, _))
1779 .WillOnce(SetArgumentPointee<1>(kFBOServiceTextureId)) 1778 .WillOnce(SetArgPointee<1>(kFBOServiceTextureId))
1780 .RetiresOnSaturation(); 1779 .RetiresOnSaturation();
1781 GenHelper<GenTexturesImmediate>(kFBOClientTextureId); 1780 GenHelper<GenTexturesImmediate>(kFBOClientTextureId);
1782 1781
1783 // Setup "render to" texture. 1782 // Setup "render to" texture.
1784 DoBindTexture(GL_TEXTURE_2D, kFBOClientTextureId, kFBOServiceTextureId); 1783 DoBindTexture(GL_TEXTURE_2D, kFBOClientTextureId, kFBOServiceTextureId);
1785 DoTexImage2D( 1784 DoTexImage2D(
1786 GL_TEXTURE_2D, 0, GL_RGBA, 1, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0, 0); 1785 GL_TEXTURE_2D, 0, GL_RGBA, 1, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0, 0);
1787 DoBindFramebuffer( 1786 DoBindFramebuffer(
1788 GL_FRAMEBUFFER, client_framebuffer_id_, kServiceFramebufferId); 1787 GL_FRAMEBUFFER, client_framebuffer_id_, kServiceFramebufferId);
1789 DoFramebufferTexture2D(GL_FRAMEBUFFER, 1788 DoFramebufferTexture2D(GL_FRAMEBUFFER,
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
1826 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 1825 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
1827 EXPECT_EQ(GL_NO_ERROR, GetGLError()); 1826 EXPECT_EQ(GL_NO_ERROR, GetGLError());
1828 } 1827 }
1829 1828
1830 TEST_P(GLES2DecoderWithShaderTest, UnClearedAttachmentsGetClearedOnReadPixels) { 1829 TEST_P(GLES2DecoderWithShaderTest, UnClearedAttachmentsGetClearedOnReadPixels) {
1831 const GLuint kFBOClientTextureId = 4100; 1830 const GLuint kFBOClientTextureId = 4100;
1832 const GLuint kFBOServiceTextureId = 4101; 1831 const GLuint kFBOServiceTextureId = 4101;
1833 1832
1834 // Register a texture id. 1833 // Register a texture id.
1835 EXPECT_CALL(*gl_, GenTextures(_, _)) 1834 EXPECT_CALL(*gl_, GenTextures(_, _))
1836 .WillOnce(SetArgumentPointee<1>(kFBOServiceTextureId)) 1835 .WillOnce(SetArgPointee<1>(kFBOServiceTextureId))
1837 .RetiresOnSaturation(); 1836 .RetiresOnSaturation();
1838 GenHelper<GenTexturesImmediate>(kFBOClientTextureId); 1837 GenHelper<GenTexturesImmediate>(kFBOClientTextureId);
1839 1838
1840 // Setup "render to" texture. 1839 // Setup "render to" texture.
1841 DoBindTexture(GL_TEXTURE_2D, kFBOClientTextureId, kFBOServiceTextureId); 1840 DoBindTexture(GL_TEXTURE_2D, kFBOClientTextureId, kFBOServiceTextureId);
1842 DoTexImage2D( 1841 DoTexImage2D(
1843 GL_TEXTURE_2D, 0, GL_RGBA, 1, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0, 0); 1842 GL_TEXTURE_2D, 0, GL_RGBA, 1, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0, 0);
1844 DoBindFramebuffer( 1843 DoBindFramebuffer(
1845 GL_FRAMEBUFFER, client_framebuffer_id_, kServiceFramebufferId); 1844 GL_FRAMEBUFFER, client_framebuffer_id_, kServiceFramebufferId);
1846 DoFramebufferTexture2D(GL_FRAMEBUFFER, 1845 DoFramebufferTexture2D(GL_FRAMEBUFFER,
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
1897 UnClearedAttachmentsGetClearedOnReadPixelsAndDrawBufferGetsRestored) { 1896 UnClearedAttachmentsGetClearedOnReadPixelsAndDrawBufferGetsRestored) {
1898 InitState init; 1897 InitState init;
1899 init.extensions = "GL_EXT_framebuffer_multisample"; 1898 init.extensions = "GL_EXT_framebuffer_multisample";
1900 init.bind_generates_resource = true; 1899 init.bind_generates_resource = true;
1901 InitDecoder(init); 1900 InitDecoder(init);
1902 const GLuint kFBOClientTextureId = 4100; 1901 const GLuint kFBOClientTextureId = 4100;
1903 const GLuint kFBOServiceTextureId = 4101; 1902 const GLuint kFBOServiceTextureId = 4101;
1904 1903
1905 // Register a texture id. 1904 // Register a texture id.
1906 EXPECT_CALL(*gl_, GenTextures(_, _)) 1905 EXPECT_CALL(*gl_, GenTextures(_, _))
1907 .WillOnce(SetArgumentPointee<1>(kFBOServiceTextureId)) 1906 .WillOnce(SetArgPointee<1>(kFBOServiceTextureId))
1908 .RetiresOnSaturation(); 1907 .RetiresOnSaturation();
1909 GenHelper<GenTexturesImmediate>(kFBOClientTextureId); 1908 GenHelper<GenTexturesImmediate>(kFBOClientTextureId);
1910 1909
1911 // Setup "render from" texture. 1910 // Setup "render from" texture.
1912 DoBindTexture(GL_TEXTURE_2D, kFBOClientTextureId, kFBOServiceTextureId); 1911 DoBindTexture(GL_TEXTURE_2D, kFBOClientTextureId, kFBOServiceTextureId);
1913 DoTexImage2D( 1912 DoTexImage2D(
1914 GL_TEXTURE_2D, 0, GL_RGBA, 1, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0, 0); 1913 GL_TEXTURE_2D, 0, GL_RGBA, 1, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0, 0);
1915 DoBindFramebuffer( 1914 DoBindFramebuffer(
1916 GL_READ_FRAMEBUFFER, client_framebuffer_id_, kServiceFramebufferId); 1915 GL_READ_FRAMEBUFFER, client_framebuffer_id_, kServiceFramebufferId);
1917 DoFramebufferTexture2D(GL_READ_FRAMEBUFFER, 1916 DoFramebufferTexture2D(GL_READ_FRAMEBUFFER,
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
2056 } 2055 }
2057 2056
2058 void GLES2DecoderWithShaderTest::CheckTextureChangesMarkFBOAsNotComplete( 2057 void GLES2DecoderWithShaderTest::CheckTextureChangesMarkFBOAsNotComplete(
2059 bool bound_fbo) { 2058 bool bound_fbo) {
2060 FramebufferManager* framebuffer_manager = group().framebuffer_manager(); 2059 FramebufferManager* framebuffer_manager = group().framebuffer_manager();
2061 const GLuint kFBOClientTextureId = 4100; 2060 const GLuint kFBOClientTextureId = 4100;
2062 const GLuint kFBOServiceTextureId = 4101; 2061 const GLuint kFBOServiceTextureId = 4101;
2063 2062
2064 // Register a texture id. 2063 // Register a texture id.
2065 EXPECT_CALL(*gl_, GenTextures(_, _)) 2064 EXPECT_CALL(*gl_, GenTextures(_, _))
2066 .WillOnce(SetArgumentPointee<1>(kFBOServiceTextureId)) 2065 .WillOnce(SetArgPointee<1>(kFBOServiceTextureId))
2067 .RetiresOnSaturation(); 2066 .RetiresOnSaturation();
2068 GenHelper<GenTexturesImmediate>(kFBOClientTextureId); 2067 GenHelper<GenTexturesImmediate>(kFBOClientTextureId);
2069 2068
2070 SetupTexture(); 2069 SetupTexture();
2071 2070
2072 // Setup "render to" texture. 2071 // Setup "render to" texture.
2073 DoBindTexture(GL_TEXTURE_2D, kFBOClientTextureId, kFBOServiceTextureId); 2072 DoBindTexture(GL_TEXTURE_2D, kFBOClientTextureId, kFBOServiceTextureId);
2074 DoTexImage2D( 2073 DoTexImage2D(
2075 GL_TEXTURE_2D, 0, GL_RGBA, 1, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0, 0); 2074 GL_TEXTURE_2D, 0, GL_RGBA, 1, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0, 0);
2076 DoBindFramebuffer( 2075 DoBindFramebuffer(
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
2299 init.gl_version = "opengl es 2.0"; 2298 init.gl_version = "opengl es 2.0";
2300 init.has_alpha = true; 2299 init.has_alpha = true;
2301 init.bind_generates_resource = true; 2300 init.bind_generates_resource = true;
2302 InitDecoder(init); 2301 InitDecoder(init);
2303 2302
2304 const GLuint kFBOClientTextureId = 4100; 2303 const GLuint kFBOClientTextureId = 4100;
2305 const GLuint kFBOServiceTextureId = 4101; 2304 const GLuint kFBOServiceTextureId = 4101;
2306 2305
2307 // Register a texture id. 2306 // Register a texture id.
2308 EXPECT_CALL(*gl_, GenTextures(_, _)) 2307 EXPECT_CALL(*gl_, GenTextures(_, _))
2309 .WillOnce(SetArgumentPointee<1>(kFBOServiceTextureId)) 2308 .WillOnce(SetArgPointee<1>(kFBOServiceTextureId))
2310 .RetiresOnSaturation(); 2309 .RetiresOnSaturation();
2311 GenHelper<GenTexturesImmediate>(kFBOClientTextureId); 2310 GenHelper<GenTexturesImmediate>(kFBOClientTextureId);
2312 2311
2313 // Setup "render to" texture. 2312 // Setup "render to" texture.
2314 DoBindTexture(GL_TEXTURE_2D, kFBOClientTextureId, kFBOServiceTextureId); 2313 DoBindTexture(GL_TEXTURE_2D, kFBOClientTextureId, kFBOServiceTextureId);
2315 DoTexImage2D( 2314 DoTexImage2D(
2316 GL_TEXTURE_2D, 0, GL_RGBA, 1, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0, 0); 2315 GL_TEXTURE_2D, 0, GL_RGBA, 1, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0, 0);
2317 DoBindFramebuffer( 2316 DoBindFramebuffer(
2318 GL_FRAMEBUFFER, client_framebuffer_id_, kServiceFramebufferId); 2317 GL_FRAMEBUFFER, client_framebuffer_id_, kServiceFramebufferId);
2319 DoFramebufferTexture2D(GL_FRAMEBUFFER, 2318 DoFramebufferTexture2D(GL_FRAMEBUFFER,
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
2400 EXPECT_CALL(*gl_, GetError()).Times(6).RetiresOnSaturation(); 2399 EXPECT_CALL(*gl_, GetError()).Times(6).RetiresOnSaturation();
2401 2400
2402 typedef GetIntegerv::Result Result; 2401 typedef GetIntegerv::Result Result;
2403 Result* result = static_cast<Result*>(shared_memory_address_); 2402 Result* result = static_cast<Result*>(shared_memory_address_);
2404 GetIntegerv cmd; 2403 GetIntegerv cmd;
2405 const GLuint kFBOClientTextureId = 4100; 2404 const GLuint kFBOClientTextureId = 4100;
2406 const GLuint kFBOServiceTextureId = 4101; 2405 const GLuint kFBOServiceTextureId = 4101;
2407 2406
2408 // Register a texture id. 2407 // Register a texture id.
2409 EXPECT_CALL(*gl_, GenTextures(_, _)) 2408 EXPECT_CALL(*gl_, GenTextures(_, _))
2410 .WillOnce(SetArgumentPointee<1>(kFBOServiceTextureId)) 2409 .WillOnce(SetArgPointee<1>(kFBOServiceTextureId))
2411 .RetiresOnSaturation(); 2410 .RetiresOnSaturation();
2412 GenHelper<GenTexturesImmediate>(kFBOClientTextureId); 2411 GenHelper<GenTexturesImmediate>(kFBOClientTextureId);
2413 2412
2414 // Setup "render to" texture. 2413 // Setup "render to" texture.
2415 DoBindTexture(GL_TEXTURE_2D, kFBOClientTextureId, kFBOServiceTextureId); 2414 DoBindTexture(GL_TEXTURE_2D, kFBOClientTextureId, kFBOServiceTextureId);
2416 DoTexImage2D( 2415 DoTexImage2D(
2417 GL_TEXTURE_2D, 0, GL_RGBA, 1, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0, 0); 2416 GL_TEXTURE_2D, 0, GL_RGBA, 1, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0, 0);
2418 DoBindFramebuffer( 2417 DoBindFramebuffer(
2419 GL_FRAMEBUFFER, client_framebuffer_id_, kServiceFramebufferId); 2418 GL_FRAMEBUFFER, client_framebuffer_id_, kServiceFramebufferId);
2420 DoFramebufferTexture2D(GL_FRAMEBUFFER, 2419 DoFramebufferTexture2D(GL_FRAMEBUFFER,
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
2457 .RetiresOnSaturation(); 2456 .RetiresOnSaturation();
2458 2457
2459 typedef GetIntegerv::Result Result; 2458 typedef GetIntegerv::Result Result;
2460 Result* result = static_cast<Result*>(shared_memory_address_); 2459 Result* result = static_cast<Result*>(shared_memory_address_);
2461 GetIntegerv cmd; 2460 GetIntegerv cmd;
2462 const GLuint kFBOClientTextureId = 4100; 2461 const GLuint kFBOClientTextureId = 4100;
2463 const GLuint kFBOServiceTextureId = 4101; 2462 const GLuint kFBOServiceTextureId = 4101;
2464 2463
2465 // Register a texture id. 2464 // Register a texture id.
2466 EXPECT_CALL(*gl_, GenTextures(_, _)) 2465 EXPECT_CALL(*gl_, GenTextures(_, _))
2467 .WillOnce(SetArgumentPointee<1>(kFBOServiceTextureId)) 2466 .WillOnce(SetArgPointee<1>(kFBOServiceTextureId))
2468 .RetiresOnSaturation(); 2467 .RetiresOnSaturation();
2469 GenHelper<GenTexturesImmediate>(kFBOClientTextureId); 2468 GenHelper<GenTexturesImmediate>(kFBOClientTextureId);
2470 2469
2471 // Setup "render to" texture. 2470 // Setup "render to" texture.
2472 DoBindTexture(GL_TEXTURE_2D, kFBOClientTextureId, kFBOServiceTextureId); 2471 DoBindTexture(GL_TEXTURE_2D, kFBOClientTextureId, kFBOServiceTextureId);
2473 DoTexImage2D( 2472 DoTexImage2D(
2474 GL_TEXTURE_2D, 0, GL_RGBA, 1, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0, 0); 2473 GL_TEXTURE_2D, 0, GL_RGBA, 1, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0, 0);
2475 DoBindFramebuffer( 2474 DoBindFramebuffer(
2476 GL_FRAMEBUFFER, client_framebuffer_id_, kServiceFramebufferId); 2475 GL_FRAMEBUFFER, client_framebuffer_id_, kServiceFramebufferId);
2477 DoFramebufferTexture2D(GL_FRAMEBUFFER, 2476 DoFramebufferTexture2D(GL_FRAMEBUFFER,
(...skipping 22 matching lines...) Expand all
2500 EXPECT_EQ(1, result->GetNumResults()); 2499 EXPECT_EQ(1, result->GetNumResults());
2501 EXPECT_EQ(GL_NO_ERROR, GetGLError()); 2500 EXPECT_EQ(GL_NO_ERROR, GetGLError());
2502 } 2501 }
2503 2502
2504 // TODO(gman): PixelStorei 2503 // TODO(gman): PixelStorei
2505 2504
2506 // TODO(gman): SwapBuffers 2505 // TODO(gman): SwapBuffers
2507 2506
2508 } // namespace gles2 2507 } // namespace gles2
2509 } // namespace gpu 2508 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698