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

Side by Side Diff: gpu/command_buffer/client/gles2_implementation_unittest.cc

Issue 954183006: Add glDrawRangeElements to GPU command buffer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 // Tests for GLES2Implementation. 5 // Tests for GLES2Implementation.
6 6
7 #include "gpu/command_buffer/client/gles2_implementation.h" 7 #include "gpu/command_buffer/client/gles2_implementation.h"
8 8
9 #include <limits> 9 #include <limits>
10 10
(...skipping 1433 matching lines...) Expand 10 before | Expand all | Expand 10 after
1444 gl_->VertexAttribPointer(kAttribIndex1, kNumComponents1, 1444 gl_->VertexAttribPointer(kAttribIndex1, kNumComponents1,
1445 GL_FLOAT, GL_FALSE, kClientStride, verts); 1445 GL_FLOAT, GL_FALSE, kClientStride, verts);
1446 gl_->VertexAttribPointer(kAttribIndex2, kNumComponents2, 1446 gl_->VertexAttribPointer(kAttribIndex2, kNumComponents2,
1447 GL_FLOAT, GL_FALSE, kClientStride, verts); 1447 GL_FLOAT, GL_FALSE, kClientStride, verts);
1448 gl_->VertexAttribDivisorANGLE(kAttribIndex2, kDivisor); 1448 gl_->VertexAttribDivisorANGLE(kAttribIndex2, kDivisor);
1449 gl_->DrawElementsInstancedANGLE( 1449 gl_->DrawElementsInstancedANGLE(
1450 GL_POINTS, kCount, GL_UNSIGNED_SHORT, indices, 1); 1450 GL_POINTS, kCount, GL_UNSIGNED_SHORT, indices, 1);
1451 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); 1451 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
1452 } 1452 }
1453 1453
1454 TEST_F(GLES2ImplementationTest, DrawRangeElementsServiceSideBuffers) {
1455 struct Cmds {
1456 cmds::DrawRangeElements cmd;
1457 };
1458 Cmds expected;
1459 expected.cmd.Init(GL_POINTS, 10, 19, 10, GL_UNSIGNED_INT, 8088);
1460 gl_->DrawRangeElements(
1461 GL_POINTS, 10, 19, 10, GL_UNSIGNED_INT, reinterpret_cast<void*>(8088));
1462 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
1463 }
1464
1454 TEST_F(GLES2ImplementationTest, GetVertexBufferPointerv) { 1465 TEST_F(GLES2ImplementationTest, GetVertexBufferPointerv) {
1455 static const float verts[1] = { 0.0f, }; 1466 static const float verts[1] = { 0.0f, };
1456 const GLuint kAttribIndex1 = 1; 1467 const GLuint kAttribIndex1 = 1;
1457 const GLuint kAttribIndex2 = 3; 1468 const GLuint kAttribIndex2 = 3;
1458 const GLint kNumComponents1 = 3; 1469 const GLint kNumComponents1 = 3;
1459 const GLint kNumComponents2 = 2; 1470 const GLint kNumComponents2 = 2;
1460 const GLsizei kStride1 = 12; 1471 const GLsizei kStride1 = 12;
1461 const GLsizei kStride2 = 0; 1472 const GLsizei kStride2 = 0;
1462 const GLuint kBufferId = 0x123; 1473 const GLuint kBufferId = 0x123;
1463 const GLint kOffset2 = 0x456; 1474 const GLint kOffset2 = 0x456;
(...skipping 2220 matching lines...) Expand 10 before | Expand all | Expand 10 after
3684 TEST_F(GLES2ImplementationManualInitTest, FailInitOnTransferBufferFail) { 3695 TEST_F(GLES2ImplementationManualInitTest, FailInitOnTransferBufferFail) {
3685 ContextInitOptions init_options; 3696 ContextInitOptions init_options;
3686 init_options.transfer_buffer_initialize_fail = true; 3697 init_options.transfer_buffer_initialize_fail = true;
3687 EXPECT_FALSE(Initialize(init_options)); 3698 EXPECT_FALSE(Initialize(init_options));
3688 } 3699 }
3689 3700
3690 #include "gpu/command_buffer/client/gles2_implementation_unittest_autogen.h" 3701 #include "gpu/command_buffer/client/gles2_implementation_unittest_autogen.h"
3691 3702
3692 } // namespace gles2 3703 } // namespace gles2
3693 } // namespace gpu 3704 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698