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

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 | no next file » | no next file with comments »
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..b1cc0d29e207f750abd62b5b4eb55a4dfbfad16f 100644
--- a/cc/output/dynamic_geometry_binding.cc
+++ b/cc/output/dynamic_geometry_binding.cc
@@ -12,14 +12,17 @@ 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];
enne (OOO) 2015/02/27 21:36:01 Can you initialize this in the class itself rather
awoloszyn 2015/02/27 22:08:37 Done.
+ GeometryBindingQuadIndex quad_indices[1];
static_assert(sizeof(GeometryBindingQuad) == 24 * sizeof(float),
"struct Quad should be densely packed");
static_assert(sizeof(GeometryBindingQuadIndex) == 6 * sizeof(uint16_t),
"struct QuadIndex should be densely packed");
+ memset(quads, 0x00, sizeof(quads));
+ memset(quads, 0x00, sizeof(quad_indices));
+
GLC(gl_, gl_->GenBuffers(1, &quad_vertices_vbo_));
GLC(gl_, gl_->GenBuffers(1, &quad_elements_vbo_));
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698