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

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

Issue 1949303003: Improve indexed gl state related GL commands. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@tex
Patch Set: fix a DCHECK failure Created 4 years, 7 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
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.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 1540 matching lines...) Expand 10 before | Expand all | Expand 10 after
1551 TEST_P(GLES3DecoderTest, GenTransformFeedbacksImmediateInvalidArgs) { 1551 TEST_P(GLES3DecoderTest, GenTransformFeedbacksImmediateInvalidArgs) {
1552 EXPECT_CALL(*gl_, GenTransformFeedbacks(_, _)).Times(0); 1552 EXPECT_CALL(*gl_, GenTransformFeedbacks(_, _)).Times(0);
1553 cmds::GenTransformFeedbacksImmediate* cmd = 1553 cmds::GenTransformFeedbacksImmediate* cmd =
1554 GetImmediateAs<cmds::GenTransformFeedbacksImmediate>(); 1554 GetImmediateAs<cmds::GenTransformFeedbacksImmediate>();
1555 SpecializedSetup<cmds::GenTransformFeedbacksImmediate, 0>(false); 1555 SpecializedSetup<cmds::GenTransformFeedbacksImmediate, 0>(false);
1556 cmd->Init(1, &client_transformfeedback_id_); 1556 cmd->Init(1, &client_transformfeedback_id_);
1557 EXPECT_EQ(error::kInvalidArguments, 1557 EXPECT_EQ(error::kInvalidArguments,
1558 ExecuteImmediateCmd(*cmd, sizeof(&client_transformfeedback_id_))); 1558 ExecuteImmediateCmd(*cmd, sizeof(&client_transformfeedback_id_)));
1559 } 1559 }
1560 1560
1561 TEST_P(GLES3DecoderTest, GetIntegeri_vValidArgs) {
1562 EXPECT_CALL(*gl_, GetIntegeri_v(_, _, _)).Times(0);
1563 typedef cmds::GetIntegeri_v::Result Result;
1564 Result* result = static_cast<Result*>(shared_memory_address_);
1565 result->size = 0;
1566 cmds::GetIntegeri_v cmd;
1567 cmd.Init(GL_TRANSFORM_FEEDBACK_BUFFER_BINDING, 2, shared_memory_id_,
1568 shared_memory_offset_);
1569 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
1570 EXPECT_EQ(decoder_->GetGLES2Util()->GLGetNumValuesReturned(
1571 GL_TRANSFORM_FEEDBACK_BUFFER_BINDING),
1572 result->GetNumResults());
1573 EXPECT_EQ(GL_NO_ERROR, GetGLError());
1574 }
1575
1576 TEST_P(GLES3DecoderTest, GetInteger64i_vValidArgs) {
1577 EXPECT_CALL(*gl_, GetInteger64i_v(_, _, _)).Times(0);
1578 typedef cmds::GetInteger64i_v::Result Result;
1579 Result* result = static_cast<Result*>(shared_memory_address_);
1580 result->size = 0;
1581 cmds::GetInteger64i_v cmd;
1582 cmd.Init(GL_UNIFORM_BUFFER_SIZE, 2, shared_memory_id_,
1583 shared_memory_offset_);
1584 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
1585 EXPECT_EQ(decoder_->GetGLES2Util()->GLGetNumValuesReturned(
1586 GL_UNIFORM_BUFFER_SIZE),
1587 result->GetNumResults());
1588 EXPECT_EQ(GL_NO_ERROR, GetGLError());
1589 }
1590
1561 // Test that processing with 0 entries does nothing. 1591 // Test that processing with 0 entries does nothing.
1562 TEST_P(GLES2DecoderDoCommandsTest, DoCommandsOneOfZero) { 1592 TEST_P(GLES2DecoderDoCommandsTest, DoCommandsOneOfZero) {
1563 int num_processed = -1; 1593 int num_processed = -1;
1564 SetExpectationsForNCommands(0); 1594 SetExpectationsForNCommands(0);
1565 EXPECT_EQ( 1595 EXPECT_EQ(
1566 error::kNoError, 1596 error::kNoError,
1567 decoder_->DoCommands(1, &cmds_, entries_per_cmd_ * 0, &num_processed)); 1597 decoder_->DoCommands(1, &cmds_, entries_per_cmd_ * 0, &num_processed));
1568 EXPECT_EQ(GL_NO_ERROR, GetGLError()); 1598 EXPECT_EQ(GL_NO_ERROR, GetGLError());
1569 EXPECT_EQ(0, num_processed); 1599 EXPECT_EQ(0, num_processed);
1570 } 1600 }
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
1661 INSTANTIATE_TEST_CASE_P(Service, GLES2DecoderDoCommandsTest, ::testing::Bool()); 1691 INSTANTIATE_TEST_CASE_P(Service, GLES2DecoderDoCommandsTest, ::testing::Bool());
1662 1692
1663 INSTANTIATE_TEST_CASE_P(Service, GLES3DecoderTest, ::testing::Bool()); 1693 INSTANTIATE_TEST_CASE_P(Service, GLES3DecoderTest, ::testing::Bool());
1664 1694
1665 INSTANTIATE_TEST_CASE_P(Service, 1695 INSTANTIATE_TEST_CASE_P(Service,
1666 GLES3DecoderWithESSL3ShaderTest, 1696 GLES3DecoderWithESSL3ShaderTest,
1667 ::testing::Bool()); 1697 ::testing::Bool());
1668 1698
1669 } // namespace gles2 1699 } // namespace gles2
1670 } // namespace gpu 1700 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698