| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h" | 5 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/string_number_conversions.h" | 10 #include "base/string_number_conversions.h" |
| (...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 381 clear_bits, | 381 clear_bits, |
| 382 restore_red, | 382 restore_red, |
| 383 restore_green, | 383 restore_green, |
| 384 restore_blue, | 384 restore_blue, |
| 385 restore_alpha, | 385 restore_alpha, |
| 386 restore_stencil, | 386 restore_stencil, |
| 387 restore_depth, | 387 restore_depth, |
| 388 restore_scissor_test); | 388 restore_scissor_test); |
| 389 } | 389 } |
| 390 | 390 |
| 391 void GLES2DecoderTestBase::SetupExpectationsForRestoreClearState( |
| 392 GLclampf restore_red, |
| 393 GLclampf restore_green, |
| 394 GLclampf restore_blue, |
| 395 GLclampf restore_alpha, |
| 396 GLuint restore_stencil, |
| 397 GLclampf restore_depth, |
| 398 bool restore_scissor_test) { |
| 399 EXPECT_CALL(*gl_, ClearColor( |
| 400 restore_red, restore_green, restore_blue, restore_alpha)) |
| 401 .Times(1) |
| 402 .RetiresOnSaturation(); |
| 403 EXPECT_CALL(*gl_, ClearStencil(restore_stencil)) |
| 404 .Times(1) |
| 405 .RetiresOnSaturation(); |
| 406 EXPECT_CALL(*gl_, ClearDepth(restore_depth)) |
| 407 .Times(1) |
| 408 .RetiresOnSaturation(); |
| 409 if (restore_scissor_test) { |
| 410 EXPECT_CALL(*gl_, Enable(GL_SCISSOR_TEST)) |
| 411 .Times(1) |
| 412 .RetiresOnSaturation(); |
| 413 } |
| 414 } |
| 415 |
| 391 void GLES2DecoderTestBase::SetupExpectationsForFramebufferClearingMulti( | 416 void GLES2DecoderTestBase::SetupExpectationsForFramebufferClearingMulti( |
| 392 GLuint read_framebuffer_service_id, | 417 GLuint read_framebuffer_service_id, |
| 393 GLuint draw_framebuffer_service_id, | 418 GLuint draw_framebuffer_service_id, |
| 394 GLenum target, | 419 GLenum target, |
| 395 GLuint clear_bits, | 420 GLuint clear_bits, |
| 396 GLclampf restore_red, | 421 GLclampf restore_red, |
| 397 GLclampf restore_green, | 422 GLclampf restore_green, |
| 398 GLclampf restore_blue, | 423 GLclampf restore_blue, |
| 399 GLclampf restore_alpha, | 424 GLclampf restore_alpha, |
| 400 GLuint restore_stencil, | 425 GLuint restore_stencil, |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 437 EXPECT_CALL(*gl_, DepthMask(1)) | 462 EXPECT_CALL(*gl_, DepthMask(1)) |
| 438 .Times(1) | 463 .Times(1) |
| 439 .RetiresOnSaturation(); | 464 .RetiresOnSaturation(); |
| 440 } | 465 } |
| 441 EXPECT_CALL(*gl_, Disable(GL_SCISSOR_TEST)) | 466 EXPECT_CALL(*gl_, Disable(GL_SCISSOR_TEST)) |
| 442 .Times(1) | 467 .Times(1) |
| 443 .RetiresOnSaturation(); | 468 .RetiresOnSaturation(); |
| 444 EXPECT_CALL(*gl_, Clear(clear_bits)) | 469 EXPECT_CALL(*gl_, Clear(clear_bits)) |
| 445 .Times(1) | 470 .Times(1) |
| 446 .RetiresOnSaturation(); | 471 .RetiresOnSaturation(); |
| 447 EXPECT_CALL(*gl_, ClearColor( | 472 SetupExpectationsForRestoreClearState( |
| 448 restore_red, restore_green, restore_blue, restore_alpha)) | 473 restore_red, restore_green, restore_blue, restore_alpha, |
| 449 .Times(1) | 474 restore_stencil, restore_depth, restore_scissor_test); |
| 450 .RetiresOnSaturation(); | |
| 451 EXPECT_CALL(*gl_, ClearStencil(restore_stencil)) | |
| 452 .Times(1) | |
| 453 .RetiresOnSaturation(); | |
| 454 EXPECT_CALL(*gl_, ClearDepth(restore_depth)) | |
| 455 .Times(1) | |
| 456 .RetiresOnSaturation(); | |
| 457 if (restore_scissor_test) { | |
| 458 EXPECT_CALL(*gl_, Enable(GL_SCISSOR_TEST)) | |
| 459 .Times(1) | |
| 460 .RetiresOnSaturation(); | |
| 461 } | |
| 462 if (target == GL_READ_FRAMEBUFFER_EXT) { | 475 if (target == GL_READ_FRAMEBUFFER_EXT) { |
| 463 EXPECT_CALL(*gl_, BindFramebufferEXT( | 476 EXPECT_CALL(*gl_, BindFramebufferEXT( |
| 464 GL_READ_FRAMEBUFFER_EXT, read_framebuffer_service_id)) | 477 GL_READ_FRAMEBUFFER_EXT, read_framebuffer_service_id)) |
| 465 .Times(1) | 478 .Times(1) |
| 466 .RetiresOnSaturation(); | 479 .RetiresOnSaturation(); |
| 467 EXPECT_CALL(*gl_, BindFramebufferEXT( | 480 EXPECT_CALL(*gl_, BindFramebufferEXT( |
| 468 GL_DRAW_FRAMEBUFFER_EXT, draw_framebuffer_service_id)) | 481 GL_DRAW_FRAMEBUFFER_EXT, draw_framebuffer_service_id)) |
| 469 .Times(1) | 482 .Times(1) |
| 470 .RetiresOnSaturation(); | 483 .RetiresOnSaturation(); |
| 471 } | 484 } |
| (...skipping 710 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1182 num_vertices, buffer_id, GL_NO_ERROR); | 1195 num_vertices, buffer_id, GL_NO_ERROR); |
| 1183 } | 1196 } |
| 1184 | 1197 |
| 1185 void GLES2DecoderWithShaderTestBase::SetUp() { | 1198 void GLES2DecoderWithShaderTestBase::SetUp() { |
| 1186 GLES2DecoderTestBase::SetUp(); | 1199 GLES2DecoderTestBase::SetUp(); |
| 1187 SetupDefaultProgram(); | 1200 SetupDefaultProgram(); |
| 1188 } | 1201 } |
| 1189 | 1202 |
| 1190 } // namespace gles2 | 1203 } // namespace gles2 |
| 1191 } // namespace gpu | 1204 } // namespace gpu |
| OLD | NEW |