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

Unified Diff: cc/geometry_binding.cc

Issue 11570027: Adding support for per vertex opacity on textured layer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixing unittest Created 8 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/draw_quad_unittest.cc ('k') | cc/gl_renderer.h » ('j') | cc/gl_renderer.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 };
« no previous file with comments | « cc/draw_quad_unittest.cc ('k') | cc/gl_renderer.h » ('j') | cc/gl_renderer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698