Change 20100623-maxcarlson-M by maxcarl...@friendly on 2010-06-23 16:46:00 PDT
    in /Users/maxcarlson/openlaszlo/trunk-clean
    for http://svn.openlaszlo.org/openlaszlo/trunk

Summary: UPDATED: Correct basecomponent tinting.

Bugs Fixed: LPP-9132 - Regression: 
examples/animation/animation.lzx?lzr=swf8&debug=true failing to start up

Technical Reviewer: ptw
QA Reviewer: hminsky, mdemmon

Details: Updating to address Tucker's comments:

1) I'd like to see us use a more modern format like the as3 colorTransform 
(i.e., name the fields {red,green,blue}{offset,multiplier} instead of 
{r,g,b}{a,b}).  Since you are adding a new API here (the colortransform 
attribute), let's use the opportunity to make the type saner.  The old, 
deprecated API can still take the old format -- it should be simple to map to 
the new format.

Done.

2) I think in rgbatoint you should clip each of the input values (& 0xff) just 
for cleanliness.

Done.

3) findAlpha looks wrong.  Elsewhere alpha is encoded by `fraction = alpha / 
25500` but in findAlpha you are decoding with `alpha = fraction * 25600`.

This breaks the rounding, which is quite fragile.  I added a comment about 
needing to do this.

Otherwise:

Updating to address comments from Andre and Tucker.  Since there is no good 
replacement for LzView.setColorTransform(), I moved it to a setter.  I also 
fixed the tinting implementation to work consistently across swf8 and swf10.

LzUtils - Ensure LzColorUtils.fromrgb() returns integers when no alpha 
component is supplied.

LzUtils - Update/refactor LzColorUtils

swf/LzSprite - setColorTransform() converts multipliers to percentage

swf9/LzSprite - setColorTransform() takes values literally

LaszloView - Update docs, add colortransform setter to be used in place of 
setColorTransform(), update tintcolor when possible.  Update tintcolor setter 
to tint correctly in swf8 and swf10.

basecomponent - Use LzView.colortransform instead of setColorTransform().

Tests: See LPP-9132 for a testcase that passes in swf8 and swf10.  
test/lfc/lzunit-lzutils.lzx passes across all runtimes.

Files:
M       WEB-INF/lps/lfc/kernel/swf/LzSprite.as
M       WEB-INF/lps/lfc/kernel/swf9/LzSprite.as
M       WEB-INF/lps/lfc/services/LzUtils.lzs
M       WEB-INF/lps/lfc/views/LaszloView.lzs
M       lps/components/base/basecomponent.lzx

Changeset: 
http://svn.openlaszlo.org/openlaszlo/patches/20100623-maxcarlson-M.tar

Reply via email to