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

Unified Diff: samples/o3d-webgl/state.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/shape.js ('k') | samples/o3d-webgl/texture.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samples/o3d-webgl/state.js
===================================================================
--- samples/o3d-webgl/state.js (revision 40133)
+++ samples/o3d-webgl/state.js (working copy)
@@ -252,7 +252,7 @@
* Returns a Param for a given state. If the param does not already exist it
* will be created. If the state_name is invalid it will return null.
* @param {string} state_name name of the state
- * @returns {o3d.Param} param or null if no matching state.
+ * @return {o3d.Param} param or null if no matching state.
*
* Example:
*
@@ -501,9 +501,9 @@
var stateParams = this.state_params_;
if (stateParams['AlphaBlendEnable'].value) {
- this.gl.enable(this.gl.ALPHA);
+ this.gl.enable(this.gl.BLEND);
} else {
- this.gl.disable(this.gl.ALPHA);
+ this.gl.disable(this.gl.BLEND);
}
if (stateParams['SeparateAlphaBlendEnable'].value) {
@@ -513,10 +513,15 @@
this.convertBlendFunc(stateParams['SourceBlendAlphaFunction'].value),
this.convertBlendFunc(
stateParams['DestinationBlendAlphaFunction'].value));
+ this.gl.blendEquationSeparate(
+ this.convertBlendEquation(stateParams['BlendEquation'].value),
+ this.convertBlendEquation(stateParams['BlendAlphaEquation'].value));
} else {
- this.gl.blendFuncSeparate(
+ this.gl.blendFunc(
this.convertBlendFunc(stateParams['SourceBlendFunction'].value),
this.convertBlendFunc(stateParams['DestinationBlendFunction'].value));
+ this.gl.blendEquation(
+ this.convertBlendEquation(stateParams['BlendEquation'].value));
}
switch (stateParams['CullMode'].value) {
@@ -533,15 +538,6 @@
break;
}
- if (stateParams['SeparateAlphaBlendEnable'].value) {
- this.gl.blendEquationSeparate(
- this.convertBlendEquation(stateParams['BlendEquation'].value),
- this.convertBlendEquation(stateParams['BlendAlphaEquation'].value));
- } else {
- this.gl.blendEquation(
- this.convertBlendEquation(stateParams['BlendEquation'].value));
- }
-
if (stateParams['DitherEnable'].value) {
this.gl.enable(this.gl.DITHER);
} else {
« no previous file with comments | « samples/o3d-webgl/shape.js ('k') | samples/o3d-webgl/texture.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698