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

Unified Diff: samples/o3djs/canvas.js

Issue 150131: Some minor JS fixes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/o3d/
Patch Set: Created 11 years, 6 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: samples/o3djs/canvas.js
===================================================================
--- samples/o3djs/canvas.js (revision 19574)
+++ samples/o3djs/canvas.js (working copy)
@@ -285,13 +285,16 @@
this.scaleTransform = canvasInfo.pack.createObject('Transform');
this.scaleTransform.parent = this.transform;
- // create the texture the canvas will draw on.
- this.texture = canvasInfo.pack.createTexture2D(
+ /**
+ * The texture the canvas will draw on.
+ * @type {!o3d.Texture2D}
+ */
+ this.texture = /** @type {!o3d.Texture2D} */ (canvasInfo.pack.createTexture2D(
width,
height,
o3djs.base.o3d.Texture.ARGB8,
1, // mipmap levels
- false);
+ false));
// Create a Canvas object to go with the quad.
@@ -302,14 +305,23 @@
this.canvas = canvasInfo.pack.createObject('Canvas');
this.canvas.setSize(width, height);
- // setup the sampler for the texture
+ /**
+ * The sampler for the texture.
+ * @type {!o3d.Sampler}
+ */
this.sampler = canvasInfo.pack.createObject('Sampler');
this.sampler.addressModeU = o3djs.base.o3d.Sampler.CLAMP;
this.sampler.addressModeV = o3djs.base.o3d.Sampler.CLAMP;
- this.paramSampler = this.scaleTransform.createParam('texSampler0',
- 'ParamSampler');
- this.paramSampler.value = this.sampler;
+ /**
+ * The param sampler for this transform.
+ * @private
+ * @type {!o3d.ParamSampler}
+ */
+ this.paramSampler_ = this.scaleTransform.createParam('texSampler0',
+ 'ParamSampler');
+ this.paramSampler_.value = this.sampler;
+
this.sampler.texture = this.texture;
if (transparent) {
this.scaleTransform.addShape(canvasInfo.transparentQuadShape);
« 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