| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "gpu/command_buffer/common/gles2_cmd_format.h" | 7 #include "gpu/command_buffer/common/gles2_cmd_format.h" |
| 8 #include "gpu/command_buffer/common/gles2_cmd_utils.h" | 8 #include "gpu/command_buffer/common/gles2_cmd_utils.h" |
| 9 #include "gpu/command_buffer/common/gl_mock.h" | 9 #include "gpu/command_buffer/common/gl_mock.h" |
| 10 #include "gpu/command_buffer/common/id_allocator.h" | 10 #include "gpu/command_buffer/common/id_allocator.h" |
| (...skipping 1217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1228 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 1228 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 1229 EXPECT_EQ(GL_INVALID_OPERATION, GetGLError()); | 1229 EXPECT_EQ(GL_INVALID_OPERATION, GetGLError()); |
| 1230 } | 1230 } |
| 1231 | 1231 |
| 1232 TEST_F(GLES2DecoderTest, FramebufferTexture2DWithNoBoundTarget) { | 1232 TEST_F(GLES2DecoderTest, FramebufferTexture2DWithNoBoundTarget) { |
| 1233 EXPECT_CALL(*gl_, FramebufferTexture2DEXT(_, _, _, _, _)) | 1233 EXPECT_CALL(*gl_, FramebufferTexture2DEXT(_, _, _, _, _)) |
| 1234 .Times(0); | 1234 .Times(0); |
| 1235 FramebufferTexture2D cmd; | 1235 FramebufferTexture2D cmd; |
| 1236 cmd.Init( | 1236 cmd.Init( |
| 1237 GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, client_texture_id_, | 1237 GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, client_texture_id_, |
| 1238 5); | 1238 0); |
| 1239 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 1239 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 1240 EXPECT_EQ(GL_INVALID_OPERATION, GetGLError()); | 1240 EXPECT_EQ(GL_INVALID_OPERATION, GetGLError()); |
| 1241 } | 1241 } |
| 1242 | 1242 |
| 1243 TEST_F(GLES2DecoderTest, GetFramebufferAttachmentParameterivWithNoBoundTarget) { | 1243 TEST_F(GLES2DecoderTest, GetFramebufferAttachmentParameterivWithNoBoundTarget) { |
| 1244 EXPECT_CALL(*gl_, GetError()) | 1244 EXPECT_CALL(*gl_, GetError()) |
| 1245 .WillOnce(Return(GL_NO_ERROR)) | 1245 .WillOnce(Return(GL_NO_ERROR)) |
| 1246 .WillOnce(Return(GL_NO_ERROR)) | 1246 .WillOnce(Return(GL_NO_ERROR)) |
| 1247 .RetiresOnSaturation(); | 1247 .RetiresOnSaturation(); |
| 1248 EXPECT_CALL(*gl_, GetFramebufferAttachmentParameterivEXT(_, _, _, _)) | 1248 EXPECT_CALL(*gl_, GetFramebufferAttachmentParameterivEXT(_, _, _, _)) |
| 1249 .Times(0); | 1249 .Times(0); |
| 1250 GetFramebufferAttachmentParameteriv cmd; | 1250 GetFramebufferAttachmentParameteriv cmd; |
| 1251 cmd.Init( | 1251 cmd.Init( |
| 1252 GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, | 1252 GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, |
| 1253 GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, shared_memory_id_, | 1253 GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, shared_memory_id_, |
| 1254 shared_memory_offset_); | 1254 shared_memory_offset_); |
| 1255 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 1255 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 1256 EXPECT_EQ(GL_INVALID_OPERATION, GetGLError()); | 1256 EXPECT_EQ(GL_INVALID_OPERATION, GetGLError()); |
| 1257 } | 1257 } |
| 1258 | 1258 |
| 1259 TEST_F(GLES2DecoderTest, GetFramebufferAttachmentParameterivWithRenderbuffer) { | 1259 TEST_F(GLES2DecoderTest, GetFramebufferAttachmentParameterivWithRenderbuffer) { |
| 1260 DoBindFramebuffer(GL_FRAMEBUFFER, client_framebuffer_id_, | 1260 DoBindFramebuffer(GL_FRAMEBUFFER, client_framebuffer_id_, |
| 1261 kServiceFramebufferId); | 1261 kServiceFramebufferId); |
| 1262 EXPECT_CALL(*gl_, GetError()) |
| 1263 .WillOnce(Return(GL_NO_ERROR)) |
| 1264 .RetiresOnSaturation(); |
| 1262 EXPECT_CALL(*gl_, FramebufferRenderbufferEXT( | 1265 EXPECT_CALL(*gl_, FramebufferRenderbufferEXT( |
| 1263 GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, | 1266 GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, |
| 1264 kServiceRenderbufferId)) | 1267 kServiceRenderbufferId)) |
| 1265 .Times(1) | 1268 .Times(1) |
| 1266 .RetiresOnSaturation(); | 1269 .RetiresOnSaturation(); |
| 1270 EXPECT_CALL(*gl_, GetError()) |
| 1271 .WillOnce(Return(GL_NO_ERROR)) |
| 1272 .RetiresOnSaturation(); |
| 1267 SetupExpectationsForFramebufferAttachment( | 1273 SetupExpectationsForFramebufferAttachment( |
| 1268 GL_COLOR_BUFFER_BIT, // clear bits | 1274 GL_COLOR_BUFFER_BIT, // clear bits |
| 1269 0, 0, 0, 0, // color | 1275 0, 0, 0, 0, // color |
| 1270 0x1111, // color bits | 1276 0x1111, // color bits |
| 1271 0, // stencil | 1277 0, // stencil |
| 1272 -1, // stencil mask back, | 1278 -1, // stencil mask back, |
| 1273 -1, // stencil mask front, | 1279 -1, // stencil mask front, |
| 1274 1.0f, // depth | 1280 1.0f, // depth |
| 1275 1, // depth mask | 1281 1, // depth mask |
| 1276 false); // scissor test | 1282 false); // scissor test |
| (...skipping 29 matching lines...) Expand all Loading... |
| 1306 shared_memory_offset_); | 1312 shared_memory_offset_); |
| 1307 EXPECT_EQ(error::kNoError, ExecuteCmd(fbrb_cmd)); | 1313 EXPECT_EQ(error::kNoError, ExecuteCmd(fbrb_cmd)); |
| 1308 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 1314 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 1309 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 1315 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 1310 EXPECT_EQ(static_cast<GLuint>(*result_value), client_renderbuffer_id_); | 1316 EXPECT_EQ(static_cast<GLuint>(*result_value), client_renderbuffer_id_); |
| 1311 } | 1317 } |
| 1312 | 1318 |
| 1313 TEST_F(GLES2DecoderTest, GetFramebufferAttachmentParameterivWithTexture) { | 1319 TEST_F(GLES2DecoderTest, GetFramebufferAttachmentParameterivWithTexture) { |
| 1314 DoBindFramebuffer(GL_FRAMEBUFFER, client_framebuffer_id_, | 1320 DoBindFramebuffer(GL_FRAMEBUFFER, client_framebuffer_id_, |
| 1315 kServiceFramebufferId); | 1321 kServiceFramebufferId); |
| 1322 EXPECT_CALL(*gl_, GetError()) |
| 1323 .WillOnce(Return(GL_NO_ERROR)) |
| 1324 .RetiresOnSaturation(); |
| 1316 EXPECT_CALL(*gl_, FramebufferTexture2DEXT( | 1325 EXPECT_CALL(*gl_, FramebufferTexture2DEXT( |
| 1317 GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, | 1326 GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, |
| 1318 kServiceTextureId, 5)) | 1327 kServiceTextureId, 0)) |
| 1319 .Times(1) | 1328 .Times(1) |
| 1320 .RetiresOnSaturation(); | 1329 .RetiresOnSaturation(); |
| 1330 EXPECT_CALL(*gl_, GetError()) |
| 1331 .WillOnce(Return(GL_NO_ERROR)) |
| 1332 .RetiresOnSaturation(); |
| 1321 SetupExpectationsForFramebufferAttachment( | 1333 SetupExpectationsForFramebufferAttachment( |
| 1322 0, // clear bits | 1334 0, // clear bits |
| 1323 0, 0, 0, 0, // color | 1335 0, 0, 0, 0, // color |
| 1324 0x1111, // color bits | 1336 0x1111, // color bits |
| 1325 0, // stencil | 1337 0, // stencil |
| 1326 -1, // stencil mask back, | 1338 -1, // stencil mask back, |
| 1327 -1, // stencil mask front, | 1339 -1, // stencil mask front, |
| 1328 1.0f, // depth | 1340 1.0f, // depth |
| 1329 1, // depth mask | 1341 1, // depth mask |
| 1330 false); // scissor test | 1342 false); // scissor test |
| (...skipping 15 matching lines...) Expand all Loading... |
| 1346 .RetiresOnSaturation(); | 1358 .RetiresOnSaturation(); |
| 1347 GetFramebufferAttachmentParameteriv::Result* result = | 1359 GetFramebufferAttachmentParameteriv::Result* result = |
| 1348 static_cast<GetFramebufferAttachmentParameteriv::Result*>( | 1360 static_cast<GetFramebufferAttachmentParameteriv::Result*>( |
| 1349 shared_memory_address_); | 1361 shared_memory_address_); |
| 1350 result->SetNumResults(0); | 1362 result->SetNumResults(0); |
| 1351 const GLint* result_value = result->GetData(); | 1363 const GLint* result_value = result->GetData(); |
| 1352 FramebufferTexture2D fbtex_cmd; | 1364 FramebufferTexture2D fbtex_cmd; |
| 1353 GetFramebufferAttachmentParameteriv cmd; | 1365 GetFramebufferAttachmentParameteriv cmd; |
| 1354 fbtex_cmd.Init( | 1366 fbtex_cmd.Init( |
| 1355 GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, client_texture_id_, | 1367 GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, client_texture_id_, |
| 1356 5); | 1368 0); |
| 1357 cmd.Init( | 1369 cmd.Init( |
| 1358 GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, | 1370 GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, |
| 1359 GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, shared_memory_id_, | 1371 GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, shared_memory_id_, |
| 1360 shared_memory_offset_); | 1372 shared_memory_offset_); |
| 1361 EXPECT_EQ(error::kNoError, ExecuteCmd(fbtex_cmd)); | 1373 EXPECT_EQ(error::kNoError, ExecuteCmd(fbtex_cmd)); |
| 1362 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 1374 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 1363 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 1375 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 1364 EXPECT_EQ(static_cast<GLuint>(*result_value), client_texture_id_); | 1376 EXPECT_EQ(static_cast<GLuint>(*result_value), client_texture_id_); |
| 1365 } | 1377 } |
| 1366 | 1378 |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1478 ClearSharedMemory(); | 1490 ClearSharedMemory(); |
| 1479 | 1491 |
| 1480 // We need to setup an FBO so we can know the max size that ReadPixels will | 1492 // We need to setup an FBO so we can know the max size that ReadPixels will |
| 1481 // access | 1493 // access |
| 1482 if (init) { | 1494 if (init) { |
| 1483 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); | 1495 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); |
| 1484 DoTexImage2D(GL_TEXTURE_2D, 0, kFormat, kWidth, kHeight, 0, | 1496 DoTexImage2D(GL_TEXTURE_2D, 0, kFormat, kWidth, kHeight, 0, |
| 1485 kFormat, GL_UNSIGNED_BYTE, 0, 0); | 1497 kFormat, GL_UNSIGNED_BYTE, 0, 0); |
| 1486 DoBindFramebuffer(GL_FRAMEBUFFER, client_framebuffer_id_, | 1498 DoBindFramebuffer(GL_FRAMEBUFFER, client_framebuffer_id_, |
| 1487 kServiceFramebufferId); | 1499 kServiceFramebufferId); |
| 1500 EXPECT_CALL(*gl_, GetError()) |
| 1501 .WillOnce(Return(GL_NO_ERROR)) |
| 1502 .RetiresOnSaturation(); |
| 1503 EXPECT_CALL(*gl_, FramebufferTexture2DEXT( |
| 1504 GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, |
| 1505 kServiceTextureId, 0)) |
| 1506 .Times(1) |
| 1507 .RetiresOnSaturation(); |
| 1508 EXPECT_CALL(*gl_, GetError()) |
| 1509 .WillOnce(Return(GL_NO_ERROR)) |
| 1510 .RetiresOnSaturation(); |
| 1511 SetupExpectationsForFramebufferAttachment( |
| 1512 0, // clear bits |
| 1513 0, 0, 0, 0, // color |
| 1514 0x1111, // color bits |
| 1515 0, // stencil |
| 1516 -1, // stencil mask back, |
| 1517 -1, // stencil mask front, |
| 1518 1.0f, // depth |
| 1519 1, // depth mask |
| 1520 false); // scissor test |
| 1521 FramebufferTexture2D fbtex_cmd; |
| 1522 fbtex_cmd.Init( |
| 1523 GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, client_texture_id_, |
| 1524 0); |
| 1525 EXPECT_EQ(error::kNoError, ExecuteCmd(fbtex_cmd)); |
| 1488 } | 1526 } |
| 1489 | 1527 |
| 1490 // We need to tell our mock GL to return the info about our FBO. | |
| 1491 EXPECT_CALL(*gl_, GetFramebufferAttachmentParameterivEXT( | |
| 1492 GL_FRAMEBUFFER, | |
| 1493 GL_COLOR_ATTACHMENT0, | |
| 1494 GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, | |
| 1495 _)) | |
| 1496 .WillOnce(SetArgumentPointee<3>(GL_TEXTURE)) | |
| 1497 .RetiresOnSaturation(); | |
| 1498 EXPECT_CALL(*gl_, GetFramebufferAttachmentParameterivEXT( | |
| 1499 GL_FRAMEBUFFER, | |
| 1500 GL_COLOR_ATTACHMENT0, | |
| 1501 GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, | |
| 1502 _)) | |
| 1503 .WillOnce(SetArgumentPointee<3>(kServiceTextureId)) | |
| 1504 .RetiresOnSaturation(); | |
| 1505 EXPECT_CALL(*gl_, GetFramebufferAttachmentParameterivEXT( | |
| 1506 GL_FRAMEBUFFER, | |
| 1507 GL_COLOR_ATTACHMENT0, | |
| 1508 GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL, | |
| 1509 _)) | |
| 1510 .WillOnce(SetArgumentPointee<3>(0)) | |
| 1511 .RetiresOnSaturation(); | |
| 1512 EXPECT_CALL(*gl_, GetFramebufferAttachmentParameterivEXT( | |
| 1513 GL_FRAMEBUFFER, | |
| 1514 GL_COLOR_ATTACHMENT0, | |
| 1515 GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE, | |
| 1516 _)) | |
| 1517 .WillOnce(SetArgumentPointee<3>(0)) | |
| 1518 .RetiresOnSaturation(); | |
| 1519 | |
| 1520 ReadPixelsEmulator emu( | 1528 ReadPixelsEmulator emu( |
| 1521 kWidth, kHeight, kBytesPerPixel, kSrcPixels, kPackAlignment); | 1529 kWidth, kHeight, kBytesPerPixel, kSrcPixels, kPackAlignment); |
| 1522 typedef ReadPixels::Result Result; | 1530 typedef ReadPixels::Result Result; |
| 1523 Result* result = GetSharedMemoryAs<Result*>(); | 1531 Result* result = GetSharedMemoryAs<Result*>(); |
| 1524 uint32 result_shm_id = kSharedMemoryId; | 1532 uint32 result_shm_id = kSharedMemoryId; |
| 1525 uint32 result_shm_offset = kSharedMemoryOffset; | 1533 uint32 result_shm_offset = kSharedMemoryOffset; |
| 1526 uint32 pixels_shm_id = kSharedMemoryId; | 1534 uint32 pixels_shm_id = kSharedMemoryId; |
| 1527 uint32 pixels_shm_offset = kSharedMemoryOffset + sizeof(*result); | 1535 uint32 pixels_shm_offset = kSharedMemoryOffset + sizeof(*result); |
| 1528 void* dest = &result[1]; | 1536 void* dest = &result[1]; |
| 1529 EXPECT_CALL(*gl_, GetError()) | 1537 EXPECT_CALL(*gl_, GetError()) |
| (...skipping 910 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2440 InSequence sequence; | 2448 InSequence sequence; |
| 2441 EXPECT_CALL(*gl_, ClearColor(0.1f, 0.2f, 0.3f, 0.4f)) | 2449 EXPECT_CALL(*gl_, ClearColor(0.1f, 0.2f, 0.3f, 0.4f)) |
| 2442 .Times(1) | 2450 .Times(1) |
| 2443 .RetiresOnSaturation(); | 2451 .RetiresOnSaturation(); |
| 2444 EXPECT_CALL(*gl_, ColorMask(0, 1, 0, 1)) | 2452 EXPECT_CALL(*gl_, ColorMask(0, 1, 0, 1)) |
| 2445 .Times(1) | 2453 .Times(1) |
| 2446 .RetiresOnSaturation(); | 2454 .RetiresOnSaturation(); |
| 2447 EXPECT_CALL(*gl_, Enable(GL_SCISSOR_TEST)) | 2455 EXPECT_CALL(*gl_, Enable(GL_SCISSOR_TEST)) |
| 2448 .Times(1) | 2456 .Times(1) |
| 2449 .RetiresOnSaturation(); | 2457 .RetiresOnSaturation(); |
| 2458 EXPECT_CALL(*gl_, GetError()) |
| 2459 .WillOnce(Return(GL_NO_ERROR)) |
| 2460 .RetiresOnSaturation(); |
| 2450 EXPECT_CALL(*gl_, FramebufferRenderbufferEXT( | 2461 EXPECT_CALL(*gl_, FramebufferRenderbufferEXT( |
| 2451 GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, | 2462 GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, |
| 2452 kServiceRenderbufferId)) | 2463 kServiceRenderbufferId)) |
| 2453 .Times(1) | 2464 .Times(1) |
| 2454 .RetiresOnSaturation(); | 2465 .RetiresOnSaturation(); |
| 2466 EXPECT_CALL(*gl_, GetError()) |
| 2467 .WillOnce(Return(GL_NO_ERROR)) |
| 2468 .RetiresOnSaturation(); |
| 2455 SetupExpectationsForFramebufferAttachment( | 2469 SetupExpectationsForFramebufferAttachment( |
| 2456 GL_COLOR_BUFFER_BIT, // clear bits | 2470 GL_COLOR_BUFFER_BIT, // clear bits |
| 2457 0.1f, 0.2f, 0.3f, 0.4f, // color | 2471 0.1f, 0.2f, 0.3f, 0.4f, // color |
| 2458 0x0101, // color bits | 2472 0x0101, // color bits |
| 2459 0, // stencil | 2473 0, // stencil |
| 2460 -1, // stencil mask back | 2474 -1, // stencil mask back |
| 2461 -1, // stencil mask front | 2475 -1, // stencil mask front |
| 2462 1.0f, // depth | 2476 1.0f, // depth |
| 2463 1, // depth mask | 2477 1, // depth mask |
| 2464 true); // scissor test | 2478 true); // scissor test |
| (...skipping 14 matching lines...) Expand all Loading... |
| 2479 cmd.Init( | 2493 cmd.Init( |
| 2480 GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, | 2494 GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, |
| 2481 client_renderbuffer_id_); | 2495 client_renderbuffer_id_); |
| 2482 InSequence sequence; | 2496 InSequence sequence; |
| 2483 EXPECT_CALL(*gl_, ClearDepth(0.5f)) | 2497 EXPECT_CALL(*gl_, ClearDepth(0.5f)) |
| 2484 .Times(1) | 2498 .Times(1) |
| 2485 .RetiresOnSaturation(); | 2499 .RetiresOnSaturation(); |
| 2486 EXPECT_CALL(*gl_, DepthMask(0)) | 2500 EXPECT_CALL(*gl_, DepthMask(0)) |
| 2487 .Times(1) | 2501 .Times(1) |
| 2488 .RetiresOnSaturation(); | 2502 .RetiresOnSaturation(); |
| 2503 EXPECT_CALL(*gl_, GetError()) |
| 2504 .WillOnce(Return(GL_NO_ERROR)) |
| 2505 .RetiresOnSaturation(); |
| 2489 EXPECT_CALL(*gl_, FramebufferRenderbufferEXT( | 2506 EXPECT_CALL(*gl_, FramebufferRenderbufferEXT( |
| 2490 GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, | 2507 GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, |
| 2491 kServiceRenderbufferId)) | 2508 kServiceRenderbufferId)) |
| 2492 .Times(1) | 2509 .Times(1) |
| 2493 .RetiresOnSaturation(); | 2510 .RetiresOnSaturation(); |
| 2511 EXPECT_CALL(*gl_, GetError()) |
| 2512 .WillOnce(Return(GL_NO_ERROR)) |
| 2513 .RetiresOnSaturation(); |
| 2494 SetupExpectationsForFramebufferAttachment( | 2514 SetupExpectationsForFramebufferAttachment( |
| 2495 GL_DEPTH_BUFFER_BIT, // clear bits | 2515 GL_DEPTH_BUFFER_BIT, // clear bits |
| 2496 0, 0, 0, 0, // color | 2516 0, 0, 0, 0, // color |
| 2497 0x1111, // color bits | 2517 0x1111, // color bits |
| 2498 0, // stencil | 2518 0, // stencil |
| 2499 -1, // stencil mask back, | 2519 -1, // stencil mask back, |
| 2500 -1, // stencil mask front, | 2520 -1, // stencil mask front, |
| 2501 0.5f, // depth | 2521 0.5f, // depth |
| 2502 0, // depth mask | 2522 0, // depth mask |
| 2503 false); // scissor test | 2523 false); // scissor test |
| (...skipping 13 matching lines...) Expand all Loading... |
| 2517 cmd.Init( | 2537 cmd.Init( |
| 2518 GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, | 2538 GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, |
| 2519 client_renderbuffer_id_); | 2539 client_renderbuffer_id_); |
| 2520 InSequence sequence; | 2540 InSequence sequence; |
| 2521 EXPECT_CALL(*gl_, ClearStencil(123)) | 2541 EXPECT_CALL(*gl_, ClearStencil(123)) |
| 2522 .Times(1) | 2542 .Times(1) |
| 2523 .RetiresOnSaturation(); | 2543 .RetiresOnSaturation(); |
| 2524 EXPECT_CALL(*gl_, StencilMaskSeparate(GL_BACK, 0x1234u)) | 2544 EXPECT_CALL(*gl_, StencilMaskSeparate(GL_BACK, 0x1234u)) |
| 2525 .Times(1) | 2545 .Times(1) |
| 2526 .RetiresOnSaturation(); | 2546 .RetiresOnSaturation(); |
| 2547 EXPECT_CALL(*gl_, GetError()) |
| 2548 .WillOnce(Return(GL_NO_ERROR)) |
| 2549 .RetiresOnSaturation(); |
| 2527 EXPECT_CALL(*gl_, FramebufferRenderbufferEXT( | 2550 EXPECT_CALL(*gl_, FramebufferRenderbufferEXT( |
| 2528 GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, | 2551 GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, |
| 2529 kServiceRenderbufferId)) | 2552 kServiceRenderbufferId)) |
| 2530 .Times(1) | 2553 .Times(1) |
| 2531 .RetiresOnSaturation(); | 2554 .RetiresOnSaturation(); |
| 2555 EXPECT_CALL(*gl_, GetError()) |
| 2556 .WillOnce(Return(GL_NO_ERROR)) |
| 2557 .RetiresOnSaturation(); |
| 2532 SetupExpectationsForFramebufferAttachment( | 2558 SetupExpectationsForFramebufferAttachment( |
| 2533 GL_STENCIL_BUFFER_BIT, // clear bits | 2559 GL_STENCIL_BUFFER_BIT, // clear bits |
| 2534 0, 0, 0, 0, // color | 2560 0, 0, 0, 0, // color |
| 2535 0x1111, // color bits | 2561 0x1111, // color bits |
| 2536 123, // stencil | 2562 123, // stencil |
| 2537 -1, // stencil mask back, | 2563 -1, // stencil mask back, |
| 2538 0x1234u, // stencil mask front, | 2564 0x1234u, // stencil mask front, |
| 2539 1.0f, // depth | 2565 1.0f, // depth |
| 2540 1, // depth mask | 2566 1, // depth mask |
| 2541 false); // scissor test | 2567 false); // scissor test |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2613 // TODO(gman): UseProgram | 2639 // TODO(gman): UseProgram |
| 2614 | 2640 |
| 2615 // TODO(gman): SwapBuffers | 2641 // TODO(gman): SwapBuffers |
| 2616 | 2642 |
| 2617 // TODO(gman): VertexAttribPointer | 2643 // TODO(gman): VertexAttribPointer |
| 2618 | 2644 |
| 2619 } // namespace gles2 | 2645 } // namespace gles2 |
| 2620 } // namespace gpu | 2646 } // namespace gpu |
| 2621 | 2647 |
| 2622 | 2648 |
| OLD | NEW |