| 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.h" | 5 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 1516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1527 GetInteger64i_v cmd; | 1527 GetInteger64i_v cmd; |
| 1528 cmd.Init(GL_UNIFORM_BUFFER_SIZE, 2, shared_memory_id_, | 1528 cmd.Init(GL_UNIFORM_BUFFER_SIZE, 2, shared_memory_id_, |
| 1529 shared_memory_offset_); | 1529 shared_memory_offset_); |
| 1530 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 1530 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 1531 EXPECT_EQ(decoder_->GetGLES2Util()->GLGetNumValuesReturned( | 1531 EXPECT_EQ(decoder_->GetGLES2Util()->GLGetNumValuesReturned( |
| 1532 GL_UNIFORM_BUFFER_SIZE), | 1532 GL_UNIFORM_BUFFER_SIZE), |
| 1533 result->GetNumResults()); | 1533 result->GetNumResults()); |
| 1534 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 1534 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 1535 } | 1535 } |
| 1536 | 1536 |
| 1537 TEST_P(GLES3DecoderTest, GetSamplerBinding) { |
| 1538 const GLuint kClientID = 12; |
| 1539 const GLuint kServiceID = 1012; |
| 1540 const GLuint kUnit = 0; |
| 1541 DoCreateSampler(kClientID, kServiceID); |
| 1542 DoBindSampler(kUnit, kClientID, kServiceID); |
| 1543 |
| 1544 EXPECT_CALL(*gl_, GetError()) |
| 1545 .WillOnce(Return(GL_NO_ERROR)) |
| 1546 .WillOnce(Return(GL_NO_ERROR)) |
| 1547 .RetiresOnSaturation(); |
| 1548 |
| 1549 typedef cmds::GetIntegerv::Result Result; |
| 1550 Result* result = static_cast<Result*>(shared_memory_address_); |
| 1551 cmds::GetIntegerv cmd; |
| 1552 cmd.Init(GL_SAMPLER_BINDING, shared_memory_id_, shared_memory_offset_); |
| 1553 result->size = 0; |
| 1554 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 1555 EXPECT_EQ(1, result->GetNumResults()); |
| 1556 EXPECT_EQ(kClientID, static_cast<GLuint>(result->GetData()[0])); |
| 1557 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 1558 } |
| 1559 |
| 1560 TEST_P(GLES3DecoderTest, GetTransformFeedbackBinding) { |
| 1561 const GLuint kClientID = 12; |
| 1562 const GLuint kServiceID = 1012; |
| 1563 const GLenum kTarget = GL_TRANSFORM_FEEDBACK; |
| 1564 DoCreateTransformFeedback(kClientID, kServiceID); |
| 1565 DoBindTransformFeedback(kTarget, kClientID, kServiceID); |
| 1566 |
| 1567 EXPECT_CALL(*gl_, GetError()) |
| 1568 .WillOnce(Return(GL_NO_ERROR)) |
| 1569 .WillOnce(Return(GL_NO_ERROR)) |
| 1570 .RetiresOnSaturation(); |
| 1571 |
| 1572 typedef cmds::GetIntegerv::Result Result; |
| 1573 Result* result = static_cast<Result*>(shared_memory_address_); |
| 1574 cmds::GetIntegerv cmd; |
| 1575 cmd.Init( |
| 1576 GL_TRANSFORM_FEEDBACK_BINDING, shared_memory_id_, shared_memory_offset_); |
| 1577 result->size = 0; |
| 1578 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 1579 EXPECT_EQ(1, result->GetNumResults()); |
| 1580 EXPECT_EQ(kClientID, static_cast<GLuint>(result->GetData()[0])); |
| 1581 |
| 1582 DoBindTransformFeedback(kTarget, 0, kServiceDefaultTransformFeedbackId); |
| 1583 DoDeleteTransformFeedback(kClientID, kServiceID); |
| 1584 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 1585 } |
| 1586 |
| 1537 // Test that processing with 0 entries does nothing. | 1587 // Test that processing with 0 entries does nothing. |
| 1538 TEST_P(GLES2DecoderDoCommandsTest, DoCommandsOneOfZero) { | 1588 TEST_P(GLES2DecoderDoCommandsTest, DoCommandsOneOfZero) { |
| 1539 int num_processed = -1; | 1589 int num_processed = -1; |
| 1540 SetExpectationsForNCommands(0); | 1590 SetExpectationsForNCommands(0); |
| 1541 EXPECT_EQ( | 1591 EXPECT_EQ( |
| 1542 error::kNoError, | 1592 error::kNoError, |
| 1543 decoder_->DoCommands(1, &cmds_, entries_per_cmd_ * 0, &num_processed)); | 1593 decoder_->DoCommands(1, &cmds_, entries_per_cmd_ * 0, &num_processed)); |
| 1544 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 1594 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 1545 EXPECT_EQ(0, num_processed); | 1595 EXPECT_EQ(0, num_processed); |
| 1546 } | 1596 } |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1755 INSTANTIATE_TEST_CASE_P(Service, GLES3DecoderWithShaderTest, ::testing::Bool()); | 1805 INSTANTIATE_TEST_CASE_P(Service, GLES3DecoderWithShaderTest, ::testing::Bool()); |
| 1756 | 1806 |
| 1757 INSTANTIATE_TEST_CASE_P(Service, GLES3DecoderManualInitTest, ::testing::Bool()); | 1807 INSTANTIATE_TEST_CASE_P(Service, GLES3DecoderManualInitTest, ::testing::Bool()); |
| 1758 | 1808 |
| 1759 INSTANTIATE_TEST_CASE_P(Service, | 1809 INSTANTIATE_TEST_CASE_P(Service, |
| 1760 GLES3DecoderRGBBackbufferTest, | 1810 GLES3DecoderRGBBackbufferTest, |
| 1761 ::testing::Bool()); | 1811 ::testing::Bool()); |
| 1762 | 1812 |
| 1763 } // namespace gles2 | 1813 } // namespace gles2 |
| 1764 } // namespace gpu | 1814 } // namespace gpu |
| OLD | NEW |