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_base.h" | 5 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 1558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1569 DoVertexAttribPointer(0, 2, GL_FLOAT, 0, 0); | 1569 DoVertexAttribPointer(0, 2, GL_FLOAT, 0, 0); |
1570 DoVertexAttribPointer(1, 2, GL_FLOAT, 0, 0); | 1570 DoVertexAttribPointer(1, 2, GL_FLOAT, 0, 0); |
1571 DoVertexAttribPointer(2, 2, GL_FLOAT, 0, 0); | 1571 DoVertexAttribPointer(2, 2, GL_FLOAT, 0, 0); |
1572 } | 1572 } |
1573 | 1573 |
1574 void GLES2DecoderTestBase::SetupIndexBuffer() { | 1574 void GLES2DecoderTestBase::SetupIndexBuffer() { |
1575 DoBindBuffer(GL_ELEMENT_ARRAY_BUFFER, | 1575 DoBindBuffer(GL_ELEMENT_ARRAY_BUFFER, |
1576 client_element_buffer_id_, | 1576 client_element_buffer_id_, |
1577 kServiceElementBufferId); | 1577 kServiceElementBufferId); |
1578 static const GLshort indices[] = {100, 1, 2, 3, 4, 5, 6, 7, 100, 9}; | 1578 static const GLshort indices[] = {100, 1, 2, 3, 4, 5, 6, 7, 100, 9}; |
1579 COMPILE_ASSERT(arraysize(indices) == kNumIndices, Indices_is_not_10); | 1579 static_assert(arraysize(indices) == kNumIndices, |
| 1580 "indices should have kNumIndices elements"); |
1580 DoBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(indices)); | 1581 DoBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(indices)); |
1581 DoBufferSubData(GL_ELEMENT_ARRAY_BUFFER, 0, 2, indices); | 1582 DoBufferSubData(GL_ELEMENT_ARRAY_BUFFER, 0, 2, indices); |
1582 DoBufferSubData(GL_ELEMENT_ARRAY_BUFFER, 2, sizeof(indices) - 2, &indices[1]); | 1583 DoBufferSubData(GL_ELEMENT_ARRAY_BUFFER, 2, sizeof(indices) - 2, &indices[1]); |
1583 } | 1584 } |
1584 | 1585 |
1585 void GLES2DecoderTestBase::SetupTexture() { | 1586 void GLES2DecoderTestBase::SetupTexture() { |
1586 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); | 1587 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); |
1587 DoTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 1, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, | 1588 DoTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 1, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, |
1588 kSharedMemoryId, kSharedMemoryOffset); | 1589 kSharedMemoryId, kSharedMemoryOffset); |
1589 }; | 1590 }; |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1695 SetupDefaultProgram(); | 1696 SetupDefaultProgram(); |
1696 } | 1697 } |
1697 | 1698 |
1698 // Include the auto-generated part of this file. We split this because it means | 1699 // Include the auto-generated part of this file. We split this because it means |
1699 // we can easily edit the non-auto generated parts right here in this file | 1700 // we can easily edit the non-auto generated parts right here in this file |
1700 // instead of having to edit some template or the code generator. | 1701 // instead of having to edit some template or the code generator. |
1701 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_0_autogen.h" | 1702 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_0_autogen.h" |
1702 | 1703 |
1703 } // namespace gles2 | 1704 } // namespace gles2 |
1704 } // namespace gpu | 1705 } // namespace gpu |
OLD | NEW |