| OLD | NEW |
| 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 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 498 InitDecoder(init); | 498 InitDecoder(init); |
| 499 | 499 |
| 500 Enable cmd; | 500 Enable cmd; |
| 501 cmd.Init(GL_STENCIL_TEST); | 501 cmd.Init(GL_STENCIL_TEST); |
| 502 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 502 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 503 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 503 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 504 | 504 |
| 505 SetupDefaultProgram(); | 505 SetupDefaultProgram(); |
| 506 SetupTexture(); | 506 SetupTexture(); |
| 507 AddExpectationsForSimulatedAttrib0(kNumVertices, 0); | 507 AddExpectationsForSimulatedAttrib0(kNumVertices, 0); |
| 508 SetupExpectationsForApplyingDirtyState(true, // Framebuffer is RGB | 508 SetupExpectationsForApplyingDirtyState( |
| 509 false, // Framebuffer has depth | 509 true, // Framebuffer is RGB |
| 510 true, // Framebuffer has stencil | 510 false, // Framebuffer has depth |
| 511 0x1110, // color bits | 511 true, // Framebuffer has stencil |
| 512 false, // depth mask | 512 0x1110, // color bits |
| 513 false, // depth enabled | 513 false, // depth mask |
| 514 -1, // front stencil mask | 514 false, // depth enabled |
| 515 -1, // back stencil mask | 515 GLES2Decoder::kDefaultStencilMask, // front stencil mask |
| 516 true); // stencil enabled | 516 GLES2Decoder::kDefaultStencilMask, // back stencil mask |
| 517 true); // stencil enabled |
| 517 | 518 |
| 518 EXPECT_CALL(*gl_, DrawArrays(GL_TRIANGLES, 0, kNumVertices)) | 519 EXPECT_CALL(*gl_, DrawArrays(GL_TRIANGLES, 0, kNumVertices)) |
| 519 .Times(1) | 520 .Times(1) |
| 520 .RetiresOnSaturation(); | 521 .RetiresOnSaturation(); |
| 521 DrawArrays draw_cmd; | 522 DrawArrays draw_cmd; |
| 522 draw_cmd.Init(GL_TRIANGLES, 0, kNumVertices); | 523 draw_cmd.Init(GL_TRIANGLES, 0, kNumVertices); |
| 523 EXPECT_EQ(error::kNoError, ExecuteCmd(draw_cmd)); | 524 EXPECT_EQ(error::kNoError, ExecuteCmd(draw_cmd)); |
| 524 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 525 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 525 | 526 |
| 526 EXPECT_CALL(*gl_, GetError()) | 527 EXPECT_CALL(*gl_, GetError()) |
| (...skipping 1722 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2249 target, | 2250 target, |
| 2250 kServiceTextureId, | 2251 kServiceTextureId, |
| 2251 level)) | 2252 level)) |
| 2252 .Times(1) | 2253 .Times(1) |
| 2253 .RetiresOnSaturation(); | 2254 .RetiresOnSaturation(); |
| 2254 EXPECT_CALL(*gl_, CheckFramebufferStatusEXT(GL_DRAW_FRAMEBUFFER_EXT)) | 2255 EXPECT_CALL(*gl_, CheckFramebufferStatusEXT(GL_DRAW_FRAMEBUFFER_EXT)) |
| 2255 .WillOnce(Return(GL_FRAMEBUFFER_COMPLETE)) | 2256 .WillOnce(Return(GL_FRAMEBUFFER_COMPLETE)) |
| 2256 .RetiresOnSaturation(); | 2257 .RetiresOnSaturation(); |
| 2257 | 2258 |
| 2258 EXPECT_CALL(*gl_, ClearStencil(0)).Times(1).RetiresOnSaturation(); | 2259 EXPECT_CALL(*gl_, ClearStencil(0)).Times(1).RetiresOnSaturation(); |
| 2259 SetupExpectationsForStencilMask(-1, -1); | 2260 SetupExpectationsForStencilMask(GLES2Decoder::kDefaultStencilMask, |
| 2261 GLES2Decoder::kDefaultStencilMask); |
| 2260 EXPECT_CALL(*gl_, ClearDepth(1.0f)).Times(1).RetiresOnSaturation(); | 2262 EXPECT_CALL(*gl_, ClearDepth(1.0f)).Times(1).RetiresOnSaturation(); |
| 2261 SetupExpectationsForDepthMask(true); | 2263 SetupExpectationsForDepthMask(true); |
| 2262 SetupExpectationsForEnableDisable(GL_SCISSOR_TEST, false); | 2264 SetupExpectationsForEnableDisable(GL_SCISSOR_TEST, false); |
| 2263 | 2265 |
| 2264 EXPECT_CALL(*gl_, Clear(GL_DEPTH_BUFFER_BIT)).Times(1).RetiresOnSaturation(); | 2266 EXPECT_CALL(*gl_, Clear(GL_DEPTH_BUFFER_BIT)).Times(1).RetiresOnSaturation(); |
| 2265 | 2267 |
| 2266 SetupExpectationsForRestoreClearState(0.0f, 0.0f, 0.0f, 0.0f, 0, 1.0f, true); | 2268 SetupExpectationsForRestoreClearState(0.0f, 0.0f, 0.0f, 0.0f, 0, 1.0f, true); |
| 2267 | 2269 |
| 2268 EXPECT_CALL(*gl_, DeleteFramebuffersEXT(1, _)).Times(1).RetiresOnSaturation(); | 2270 EXPECT_CALL(*gl_, DeleteFramebuffersEXT(1, _)).Times(1).RetiresOnSaturation(); |
| 2269 EXPECT_CALL(*gl_, BindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, 0)) | 2271 EXPECT_CALL(*gl_, BindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, 0)) |
| 2270 .Times(1) | 2272 .Times(1) |
| 2271 .RetiresOnSaturation(); | 2273 .RetiresOnSaturation(); |
| 2272 | 2274 |
| 2273 SetupExpectationsForApplyingDefaultDirtyState(); | 2275 SetupExpectationsForApplyingDefaultDirtyState(); |
| 2274 EXPECT_CALL(*gl_, DrawArrays(GL_TRIANGLES, 0, kNumVertices)) | 2276 EXPECT_CALL(*gl_, DrawArrays(GL_TRIANGLES, 0, kNumVertices)) |
| 2275 .Times(1) | 2277 .Times(1) |
| 2276 .RetiresOnSaturation(); | 2278 .RetiresOnSaturation(); |
| 2277 DrawArrays cmd; | 2279 DrawArrays cmd; |
| 2278 cmd.Init(GL_TRIANGLES, 0, kNumVertices); | 2280 cmd.Init(GL_TRIANGLES, 0, kNumVertices); |
| 2279 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 2281 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 2280 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 2282 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 2281 } | 2283 } |
| 2282 | 2284 |
| 2283 } // namespace gles2 | 2285 } // namespace gles2 |
| 2284 } // namespace gpu | 2286 } // namespace gpu |
| OLD | NEW |