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

Unified Diff: samples/o3d-webgl/shape.js

Issue 1092003: Fixed a lot of bugs with render surfaces and bitmaps. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/o3d/
Patch Set: '' Created 10 years, 9 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 | « samples/o3d-webgl/render_surface_set.js ('k') | samples/o3d-webgl/state.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samples/o3d-webgl/shape.js
===================================================================
--- samples/o3d-webgl/shape.js (revision 41482)
+++ samples/o3d-webgl/shape.js (working copy)
@@ -94,7 +94,7 @@
* @param {o3d.Element} element The element to add.
*/
o3d.Shape.prototype.removeElement = function(element) {
-
+ o3d.removeFromArray(this.elements, element);
};
@@ -108,15 +108,25 @@
o3d.Shape.prototype.writeToDrawLists =
function(drawListInfos, world, transform) {
var elements = this.elements;
+
+ // Iterate through elements of this shape.
for (var i = 0; i < elements.length; ++i) {
var element = elements[i];
+
+ // For each element look at the DrawElements for that element.
for (var j = 0; j < element.drawElements.length; ++j) {
var drawElement = element.drawElements[j];
- var materialDrawList = drawElement.material.drawList;
+ var material = drawElement.material || drawElement.owner.material;
+ var materialDrawList = material.drawList;
+
+ // Iterate through the drawlists we might write to.
for (var k = 0; k < drawListInfos.length; ++k) {
var drawListInfo = drawListInfos[k];
var list = drawListInfo.list;
var context = drawListInfo.context;
+
+ // If any of those drawlists matches the material on the drawElement,
+ // add the drawElement to the list.
if (materialDrawList == list) {
list.list_.push({
view: context.view,
@@ -130,3 +140,5 @@
}
}
};
+
+
« no previous file with comments | « samples/o3d-webgl/render_surface_set.js ('k') | samples/o3d-webgl/state.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698