[Vm-dev] VM Maker: VMMaker-tpr.325.mcz
commits at source.squeak.org
commits at source.squeak.org
Wed Sep 18 00:25:36 UTC 2013
tim Rowledge uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker-tpr.325.mcz
==================== Summary ====================
Name: VMMaker-tpr.325
Author: tpr
Time: 17 September 2013, 5:24:10.53 pm
UUID: 98b93ca5-c360-48e2-8fda-fc64fb165085
Ancestors: VMMaker-dtl.324
(probable) fix for Mantis http://bugs.squeak.org/view.php?id=7247 BitBlt Bug in alphaSourceBlendBits8
=============== Diff against VMMaker-dtl.324 ===============
Item was changed:
----- Method: BitBltSimulation>>alphaSourceBlendBits8 (in category 'inner loop') -----
alphaSourceBlendBits8
"This version assumes
combinationRule = 34
sourcePixSize = 32
destPixSize = 8
sourceForm ~= destForm.
Note: This is not real blending since we don't have the source colors available.
"
| srcIndex dstIndex sourceWord srcAlpha destWord deltaX deltaY
srcY dstY dstMask srcShift adjust mappingTable mapperFlags |
<inline: false>
<var: #mappingTable type:'unsigned int *'>
mappingTable := self default8To32Table.
mapperFlags := cmFlags bitAnd: ColorMapNewStyle bitInvert32.
deltaY := bbH + 1. "So we can pre-decrement"
srcY := sy.
dstY := dy.
mask1 := ((dx bitAnd: 3) * 8).
destMSB ifTrue:[mask1 := 24 - mask1].
mask2 := AllOnes bitXor:(16rFF << mask1).
(dx bitAnd: 1) = 0
ifTrue:[adjust := 0]
ifFalse:[adjust := 16r1F1F1F1F].
(dy bitAnd: 1) = 0
ifTrue:[adjust := adjust bitXor: 16r1F1F1F1F].
"This is the outer loop"
[(deltaY := deltaY - 1) ~= 0] whileTrue:[
adjust := adjust bitXor: 16r1F1F1F1F.
srcIndex := sourceBits + (srcY * sourcePitch) + (sx * 4).
dstIndex := destBits + (dstY * destPitch) + (dx // 4 * 4).
deltaX := bbW + 1. "So we can pre-decrement"
srcShift := mask1.
dstMask := mask2.
"This is the inner loop"
[(deltaX := deltaX - 1) ~= 0] whileTrue:[
sourceWord := ((self srcLongAt: srcIndex) bitAnd: (adjust bitInvert32)) + adjust.
srcAlpha := sourceWord >> 24.
srcAlpha > 31 ifTrue:["Everything below 31 is transparent"
srcAlpha < 224 ifTrue:["Everything above 224 is opaque"
destWord := self dstLongAt: dstIndex.
destWord := destWord bitAnd: dstMask bitInvert32.
destWord := destWord >> srcShift.
destWord := mappingTable at: destWord.
sourceWord := self alphaBlendScaled: sourceWord with: destWord.
].
sourceWord := self mapPixel: sourceWord flags: mapperFlags.
sourceWord := sourceWord << srcShift.
"Store back"
self dstLongAt: dstIndex put: sourceWord mask: dstMask.
].
srcIndex := srcIndex + 4.
destMSB ifTrue:[
srcShift = 0
ifTrue:[dstIndex := dstIndex + 4.
srcShift := 24.
dstMask := 16r00FFFFFF]
ifFalse:[srcShift := srcShift - 8.
dstMask := (dstMask >> 8) bitOr: 16rFF000000].
] ifFalse:[
+ srcShift = 24
- srcShift = 32
ifTrue:[dstIndex := dstIndex + 4.
srcShift := 0.
dstMask := 16rFFFFFF00]
ifFalse:[srcShift := srcShift + 8.
dstMask := dstMask << 8 bitOr: 255].
].
adjust := adjust bitXor: 16r1F1F1F1F.
].
srcY := srcY + 1.
dstY := dstY + 1.
].!
More information about the Vm-dev
mailing list