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

Unified Diff: cc/output/dynamic_geometry_binding.cc

Issue 959403002: Initialize our quads to zero before we gl_->BufferData() with them. (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | cc/output/geometry_binding.h » ('j') | cc/output/geometry_binding.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/output/dynamic_geometry_binding.cc
diff --git a/cc/output/dynamic_geometry_binding.cc b/cc/output/dynamic_geometry_binding.cc
index 8eeff0c6b4a80e7339dd8f491c3a84dd9c027d10..993e3d0ef46c38a1893b9aea2a32f1174534d496 100644
--- a/cc/output/dynamic_geometry_binding.cc
+++ b/cc/output/dynamic_geometry_binding.cc
@@ -12,8 +12,8 @@ namespace cc {
DynamicGeometryBinding::DynamicGeometryBinding(gpu::gles2::GLES2Interface* gl)
: gl_(gl), quad_vertices_vbo_(0), quad_elements_vbo_(0) {
- GeometryBindingQuad quads[8];
- GeometryBindingQuadIndex quad_indices[8];
+ GeometryBindingQuad quads[1];
+ GeometryBindingQuadIndex quad_indices[1];
static_assert(sizeof(GeometryBindingQuad) == 24 * sizeof(float),
"struct Quad should be densely packed");
@@ -50,12 +50,12 @@ void DynamicGeometryBinding::InitializeCustomQuadWithUVs(const gfx::QuadF& quad,
{quad.p4().x(), quad.p4().y(), 0.0f}, {uv[6], uv[7]}, 3.0f};
GeometryBindingQuad local_quad = {v0, v1, v2, v3};
- GeometryBindingQuadIndex quad_index = {{static_cast<uint16>(0),
- static_cast<uint16>(1),
- static_cast<uint16>(2),
- static_cast<uint16>(3),
- static_cast<uint16>(0),
- static_cast<uint16>(2)}};
+ GeometryBindingQuadIndex quad_index = {static_cast<uint16>(0),
+ static_cast<uint16>(1),
+ static_cast<uint16>(2),
+ static_cast<uint16>(3),
+ static_cast<uint16>(0),
+ static_cast<uint16>(2)};
GLC(gl_, gl_->BufferSubData(GL_ARRAY_BUFFER, 0, sizeof(GeometryBindingQuad),
&local_quad));
« no previous file with comments | « no previous file | cc/output/geometry_binding.h » ('j') | cc/output/geometry_binding.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698