Chromium Code Reviews| Index: cc/geometry_binding.cc |
| diff --git a/cc/geometry_binding.cc b/cc/geometry_binding.cc |
| index cef487012be8382deb15ed8b671aaf27980816be..ec4441c623aa9153d97e2ea8563a1fd4721ac6b8 100644 |
| --- a/cc/geometry_binding.cc |
| +++ b/cc/geometry_binding.cc |
| @@ -25,7 +25,7 @@ GeometryBinding::GeometryBinding(WebKit::WebGraphicsContext3D* context, const gf |
| struct Vertex { |
| float a_position[3]; |
| float a_texCoord[2]; |
| - float a_index; // index into the matrix array for this quad |
| + float a_index; // index of the vertex, divide by 4 to have the matrix for this quad |
| }; |
| struct Quad { Vertex v0, v1, v2, v3; }; |
| struct QuadIndex { uint16_t data[6]; }; |
| @@ -36,10 +36,10 @@ GeometryBinding::GeometryBinding(WebKit::WebGraphicsContext3D* context, const gf |
| Quad quad_list[8]; |
| QuadIndex quad_index_list[8]; |
| for (int i = 0; i < 8; i++) { |
|
whunt
2012/12/14 21:13:45
Why are we adding 0.5f to these indices? They're
Jerome
2012/12/14 21:48:47
I was worried that the precision of the math might
whunt
2012/12/14 22:38:44
Every floating point standard known represents who
|
| - Vertex v0 = { quadVertexRect.x() , quadVertexRect.bottom(), 0.0f, 0.0f, 1.0f, (float)i }; |
| - Vertex v1 = { quadVertexRect.x() , quadVertexRect.y() , 0.0f, 0.0f, 0.0f, (float)i }; |
| - Vertex v2 = { quadVertexRect.right(), quadVertexRect.y() , 0.0f, 1.0f, 0.0f, (float)i }; |
| - Vertex v3 = { quadVertexRect.right(), quadVertexRect.bottom(), 0.0f, 1.0f, 1.0f, (float)i }; |
| + Vertex v0 = { quadVertexRect.x() , quadVertexRect.bottom(), 0.0f, 0.0f, 1.0f, i * 4 + 0.5f }; |
| + Vertex v1 = { quadVertexRect.x() , quadVertexRect.y() , 0.0f, 0.0f, 0.0f, i * 4 + 1.5f }; |
| + Vertex v2 = { quadVertexRect.right(), quadVertexRect.y() , 0.0f, 1.0f, 0.0f, i * 4 + 2.5f }; |
| + Vertex v3 = { quadVertexRect.right(), quadVertexRect.bottom(), 0.0f, 1.0f, 1.0f, i * 4 + 3.5f }; |
| Quad x = { v0, v1, v2, v3 }; |
| quad_list[i] = x; |
| QuadIndex y = { 0 + 4 * i, 1 + 4 * i, 2 + 4 * i, 3 + 4 * i, 0 + 4 * i, 2 + 4 * i }; |