OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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 "cc/output/geometry_binding.h" | 5 #include "cc/output/geometry_binding.h" |
6 | 6 |
7 #include "cc/output/gl_renderer.h" // For the GLC() macro. | 7 #include "cc/output/gl_renderer.h" // For the GLC() macro. |
8 #include "gpu/command_buffer/client/gles2_interface.h" | 8 #include "gpu/command_buffer/client/gles2_interface.h" |
9 #include "third_party/khronos/GLES2/gl2.h" | 9 #include "ui/gfx/geometry/rect_f.h" |
10 #include "ui/gfx/rect_f.h" | |
11 | 10 |
12 namespace cc { | 11 namespace cc { |
13 | 12 |
14 GeometryBinding::GeometryBinding(gpu::gles2::GLES2Interface* gl, | 13 GeometryBinding::GeometryBinding(gpu::gles2::GLES2Interface* gl, |
15 const gfx::RectF& quad_vertex_rect) | 14 const gfx::RectF& quad_vertex_rect) |
16 : gl_(gl), quad_vertices_vbo_(0), quad_elements_vbo_(0) { | 15 : gl_(gl), quad_vertices_vbo_(0), quad_elements_vbo_(0) { |
17 struct Vertex { | 16 struct Vertex { |
18 float a_position[3]; | 17 float a_position[3]; |
19 float a_texCoord[2]; | 18 float a_texCoord[2]; |
20 // Index of the vertex, divide by 4 to have the matrix for this quad. | 19 // Index of the vertex, divide by 4 to have the matrix for this quad. |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 GL_FLOAT, | 105 GL_FLOAT, |
107 false, | 106 false, |
108 6 * sizeof(float), // NOLINT(runtime/sizeof) | 107 6 * sizeof(float), // NOLINT(runtime/sizeof) |
109 offsets[2])); | 108 offsets[2])); |
110 GLC(gl_, gl_->EnableVertexAttribArray(PositionAttribLocation())); | 109 GLC(gl_, gl_->EnableVertexAttribArray(PositionAttribLocation())); |
111 GLC(gl_, gl_->EnableVertexAttribArray(TexCoordAttribLocation())); | 110 GLC(gl_, gl_->EnableVertexAttribArray(TexCoordAttribLocation())); |
112 GLC(gl_, gl_->EnableVertexAttribArray(TriangleIndexAttribLocation())); | 111 GLC(gl_, gl_->EnableVertexAttribArray(TriangleIndexAttribLocation())); |
113 } | 112 } |
114 | 113 |
115 } // namespace cc | 114 } // namespace cc |
OLD | NEW |