[squeak-dev] Form>asFormOfDepth: appears to break transparency

tim Rowledge tim at rowledge.org
Sun Oct 12 05:49:30 UTC 2014


On 11-10-2014, at 12:23 PM, J. Vuletich (mail lists) <juanlists at jvuletich.org> wrote:
> Yes. In Squeak there is a bug in #asFormOfDepth: . The last lines are:
> 
> 	"Special case: For a 16 -> 32 bit conversion fill the alpha channel because it gets lost in translation."
> 	(self depth = 16 and:[d= 32]) ifTrue:[newForm fillAlpha: 255].
> 
> But they should be as in Cuis:
> 
> 	"If we build a 32bpp from one of smaller depth,
> 	it will have zero in the alpha channel (until BitBlt is fixed!)"
> 	d = 32 ifTrue: [
> 		newForm fixAlpha ].
> 
> I think this should fix your problem.

Yup. Given that there is a bitblt rule specifically to fix this problem, and a method specifically provided to use said bitblt to specifically fix this problem, I’m more than a bit puzzled as to why the most important bit of code (to be specific) in the image that needs this specific bit of code, doesn’t, specifically, have it. Even weirder is that Andreas wrote it and five years later carefully rewrote asFormOfDepth: to deal with this problem *and didn’t use his own careful fix*.

> 
> Besides, the sample code I sent gets transparent, although the stuff in the Form, 16rFF000000, is opaque black. This is because of another bug, this one at #colorFromPixelValue:depth: . I suggest taking the code verbatim from Cuis.

Probably a good idea.

tim
--
tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
Useful random insult:- Can't find log base two of 65536 without a calculator.




More information about the Squeak-dev mailing list