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

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

Issue 10573004: Set default GL state (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: revert revert Created 8 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h" 5 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 9
10 #include "base/string_number_conversions.h" 10 #include "base/string_number_conversions.h"
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 183
184 static GLint max_viewport_dims[] = { 184 static GLint max_viewport_dims[] = {
185 kMaxViewportWidth, 185 kMaxViewportWidth,
186 kMaxViewportHeight 186 kMaxViewportHeight
187 }; 187 };
188 EXPECT_CALL(*gl_, GetIntegerv(GL_MAX_VIEWPORT_DIMS, _)) 188 EXPECT_CALL(*gl_, GetIntegerv(GL_MAX_VIEWPORT_DIMS, _))
189 .WillOnce(SetArrayArgument<1>( 189 .WillOnce(SetArrayArgument<1>(
190 max_viewport_dims, max_viewport_dims + arraysize(max_viewport_dims))) 190 max_viewport_dims, max_viewport_dims + arraysize(max_viewport_dims)))
191 .RetiresOnSaturation(); 191 .RetiresOnSaturation();
192 192
193 EXPECT_CALL(*gl_, ActiveTexture(GL_TEXTURE0))
194 .Times(1)
195 .RetiresOnSaturation();
196 EXPECT_CALL(*gl_, LineWidth(1.0))
197 .Times(1)
198 .RetiresOnSaturation();
199 EXPECT_CALL(*gl_, Disable(GL_BLEND))
200 .Times(1)
201 .RetiresOnSaturation();
202 EXPECT_CALL(*gl_, BlendColor(0.0f, 0.0, 0.0f, 0.0f))
203 .Times(1)
204 .RetiresOnSaturation();
205 EXPECT_CALL(*gl_, BlendFunc(GL_ONE, GL_ZERO))
206 .Times(1)
207 .RetiresOnSaturation();
208 EXPECT_CALL(*gl_, BlendEquation(GL_FUNC_ADD))
209 .Times(1)
210 .RetiresOnSaturation();
211 EXPECT_CALL(*gl_, BlendFuncSeparate(GL_ONE, GL_ZERO, GL_ONE, GL_ZERO))
212 .Times(1)
213 .RetiresOnSaturation();
214 EXPECT_CALL(*gl_, ClearColor(0.0f, 0.0, 0.0f, 0.0f))
215 .Times(1)
216 .RetiresOnSaturation();
217 EXPECT_CALL(*gl_, ColorMask(true, true, true, true))
218 .Times(1)
219 .RetiresOnSaturation();
220 EXPECT_CALL(*gl_, Disable(GL_CULL_FACE))
221 .Times(1)
222 .RetiresOnSaturation();
223 EXPECT_CALL(*gl_, CullFace(GL_BACK))
224 .Times(1)
225 .RetiresOnSaturation();
226 EXPECT_CALL(*gl_, ClearDepth(1.0f))
227 .Times(1)
228 .RetiresOnSaturation();
229 EXPECT_CALL(*gl_, DepthFunc(GL_LESS))
230 .Times(1)
231 .RetiresOnSaturation();
232 EXPECT_CALL(*gl_, DepthRange(0.0f, 1.0f))
233 .Times(1)
234 .RetiresOnSaturation();
235 EXPECT_CALL(*gl_, Disable(GL_DEPTH_TEST))
236 .Times(1)
237 .RetiresOnSaturation();
238 EXPECT_CALL(*gl_, Enable(GL_DITHER))
239 .Times(1)
240 .RetiresOnSaturation();
241 EXPECT_CALL(*gl_, FrontFace(GL_CCW))
242 .Times(1)
243 .RetiresOnSaturation();
244 EXPECT_CALL(*gl_, Hint(GL_GENERATE_MIPMAP_HINT, GL_DONT_CARE))
245 .Times(1)
246 .RetiresOnSaturation();
247 EXPECT_CALL(*gl_, LineWidth(1.0f))
248 .Times(1)
249 .RetiresOnSaturation();
250 EXPECT_CALL(*gl_, PixelStorei(GL_PACK_ALIGNMENT, 4))
251 .Times(1)
252 .RetiresOnSaturation();
253 EXPECT_CALL(*gl_, PolygonOffset(0.0f, 0.0f))
254 .Times(1)
255 .RetiresOnSaturation();
256 EXPECT_CALL(*gl_, Disable(GL_POLYGON_OFFSET_FILL))
257 .Times(1)
258 .RetiresOnSaturation();
259 EXPECT_CALL(*gl_, SampleCoverage(1.0, false))
260 .Times(1)
261 .RetiresOnSaturation();
262 EXPECT_CALL(*gl_, Scissor(
263 kViewportX, kViewportY, kViewportWidth, kViewportHeight))
264 .Times(1)
265 .RetiresOnSaturation();
266 EXPECT_CALL(*gl_, Disable(GL_SCISSOR_TEST))
267 .Times(1)
268 .RetiresOnSaturation();
269 EXPECT_CALL(*gl_, Disable(GL_STENCIL_TEST))
270 .Times(1)
271 .RetiresOnSaturation();
272 EXPECT_CALL(*gl_, ClearStencil(0))
273 .Times(1)
274 .RetiresOnSaturation();
275 EXPECT_CALL(*gl_, StencilFunc(GL_ALWAYS, 0, 0xFFFFFFFFU))
276 .Times(1)
277 .RetiresOnSaturation();
278 EXPECT_CALL(*gl_, StencilOp(GL_KEEP, GL_KEEP, GL_KEEP))
279 .Times(1)
280 .RetiresOnSaturation();
281 EXPECT_CALL(*gl_, StencilMaskSeparate(GL_FRONT, 0xFFFFFFFFU))
282 .Times(1)
283 .RetiresOnSaturation();
284 EXPECT_CALL(*gl_, StencilMaskSeparate(GL_BACK, 0xFFFFFFFFU))
285 .Times(1)
286 .RetiresOnSaturation();
287 EXPECT_CALL(*gl_, PixelStorei(GL_UNPACK_ALIGNMENT, 4))
288 .Times(1)
289 .RetiresOnSaturation();
290
291 EXPECT_CALL(*gl_, BindBuffer(GL_ARRAY_BUFFER, 0))
292 .Times(1)
293 .RetiresOnSaturation();
294 EXPECT_CALL(*gl_, BindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0))
295 .Times(1)
296 .RetiresOnSaturation();
297 EXPECT_CALL(*gl_, BindFramebufferEXT(GL_FRAMEBUFFER, 0))
298 .Times(1)
299 .RetiresOnSaturation();
300 EXPECT_CALL(*gl_, BindRenderbufferEXT(GL_RENDERBUFFER, 0))
301 .Times(1)
302 .RetiresOnSaturation();
303
193 engine_.reset(new StrictMock<MockCommandBufferEngine>()); 304 engine_.reset(new StrictMock<MockCommandBufferEngine>());
194 Buffer buffer = engine_->GetSharedMemoryBuffer(kSharedMemoryId); 305 Buffer buffer = engine_->GetSharedMemoryBuffer(kSharedMemoryId);
195 shared_memory_offset_ = kSharedMemoryOffset; 306 shared_memory_offset_ = kSharedMemoryOffset;
196 shared_memory_address_ = reinterpret_cast<int8*>(buffer.ptr) + 307 shared_memory_address_ = reinterpret_cast<int8*>(buffer.ptr) +
197 shared_memory_offset_; 308 shared_memory_offset_;
198 shared_memory_id_ = kSharedMemoryId; 309 shared_memory_id_ = kSharedMemoryId;
199 shared_memory_base_ = buffer.ptr; 310 shared_memory_base_ = buffer.ptr;
200 311
201 surface_ = new gfx::GLSurfaceStub; 312 surface_ = new gfx::GLSurfaceStub;
202 surface_->SetSize(gfx::Size(kBackBufferWidth, kBackBufferHeight)); 313 surface_->SetSize(gfx::Size(kBackBufferWidth, kBackBufferHeight));
(...skipping 1015 matching lines...) Expand 10 before | Expand all | Expand 10 after
1218 num_vertices, buffer_id, GL_NO_ERROR); 1329 num_vertices, buffer_id, GL_NO_ERROR);
1219 } 1330 }
1220 1331
1221 void GLES2DecoderWithShaderTestBase::SetUp() { 1332 void GLES2DecoderWithShaderTestBase::SetUp() {
1222 GLES2DecoderTestBase::SetUp(); 1333 GLES2DecoderTestBase::SetUp();
1223 SetupDefaultProgram(); 1334 SetupDefaultProgram();
1224 } 1335 }
1225 1336
1226 } // namespace gles2 1337 } // namespace gles2
1227 } // namespace gpu 1338 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698