diff options
author | kbr@google.com <kbr@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-22 02:34:20 +0000 |
---|---|---|
committer | kbr@google.com <kbr@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-22 02:34:20 +0000 |
commit | 986b1d4ee068ca1888a46bea7280017ee99feceb (patch) | |
tree | e0c897b88dc09831df39a07ed4de9ec000ab06af /o3d/samples/o3d-webgl/state_set.js | |
parent | 1da35175c66788af1312547ec24d6e36234a0aa5 (diff) | |
download | chromium_src-986b1d4ee068ca1888a46bea7280017ee99feceb.zip chromium_src-986b1d4ee068ca1888a46bea7280017ee99feceb.tar.gz chromium_src-986b1d4ee068ca1888a46bea7280017ee99feceb.tar.bz2 |
Changed the semantics of many fields throughout the o3d-webgl
implementation to be backed by Params using
o3d.ParamObject.setUpO3DParam_. This change was needed to maintain the
semantics of the plugin, where fetching a parameter of a certain name
and setting it is equivalent to setting the field against the object.
This change mandated moving all of the assignments of the form
"constructor.prototype.fieldName = defaultValue" into the constructor
function itself, so that the setter created by setUpO3DParam will be
properly called for those assignments. For all files touched by this
CL, moved all default field assignments, not just those associated
with Param-backed fields.
Incorporated petersont's setup of the dx_clipping uniform introduced
in amarinichev's cg_to_glsl converter. Commented out bogus
modification of projection matrix in o3d.Param.SAS.setProjection and
added TODO to modify all handwritten shaders. Fixed bug in
o3d.Buffer.prototype.resize where it needed to coerce the argument to
an integer, a bug in the type determination for arrays in param.js,
and a couple of other bugs.
Changed cg_to_glsl script to use the expected case for the SAS
matrices in the o3d-webgl backend. Hopefully this change will not
break the GLES2 backend.
Ran all o3d-webgl samples. All work except for shadow-map.html
(affected by https://bugs.webkit.org/show_bug.cgi?id=37963 ) and
helloworld.html, which now does not report any errors but also does
not display any output yet.
BUG=none
TEST=ran o3d-webgl samples
TBR=petersont,amarinichev
Review URL: http://codereview.chromium.org/1751006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45278 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'o3d/samples/o3d-webgl/state_set.js')
-rw-r--r-- | o3d/samples/o3d-webgl/state_set.js | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/o3d/samples/o3d-webgl/state_set.js b/o3d/samples/o3d-webgl/state_set.js index 054b5a8..e421622 100644 --- a/o3d/samples/o3d-webgl/state_set.js +++ b/o3d/samples/o3d-webgl/state_set.js @@ -40,16 +40,16 @@ */ o3d.StateSet = function(opt_state) { o3d.RenderNode.call(this); + + /** + * The State for this StateSet. + * @type {o3d.State} + */ this.state = opt_state || null; }; o3d.inherit('StateSet', 'RenderNode'); - -/** - * The State for this StateSet. - */ -o3d.StateSet.prototype.state = null; - +o3d.ParamObject.setUpO3DParam_(o3d.StateSet, 'state', 'ParamState'); /** * Sets the current state to the member state. @@ -59,4 +59,3 @@ o3d.StateSet.prototype.before = function() { this.state.set(); }; - |