[squeak-dev] The Trunk: GraphicsTests-nice.62.mcz
commits at source.squeak.org
commits at source.squeak.org
Mon Feb 27 16:05:17 UTC 2023
Nicolas Cellier uploaded a new version of GraphicsTests to project The Trunk:
http://source.squeak.org/trunk/GraphicsTests-nice.62.mcz
==================== Summary ====================
Name: GraphicsTests-nice.62
Author: nice
Time: 27 February 2023, 5:05:11.232119 pm
UUID: 1490c410-0f9a-a749-a2e2-d8b5539d582f
Ancestors: GraphicsTests-mt.60
Fix testAllAlphasRgbMul
The BitBlt primitive for rgbMul rule has been fixed so as to round to nearest paint. The test must reflect this.
=============== Diff against GraphicsTests-mt.60 ===============
Item was changed:
----- Method: BitBltTest>>testAllAlphasRgbMul (in category 'tests') -----
testAllAlphasRgbMul
"self run: #testAllAlphasRgbMul"
| sourceForm destForm blt correctAlphas |
<timeout: 10>
correctAlphas := 0.
0 to: 255 do: [:sourceAlpha |
sourceForm := Form extent: 1 @ 1 depth: 32.
sourceForm bits at: 1 put: sourceAlpha << 24 + (33 << 16) + (25 << 8) + 27.
0 to: 255 do: [:destAlpha |
destForm := Form extent: 1 @ 1 depth: 32.
destForm bits at: 1 put: destAlpha << 24 + (255 << 16) + (255 << 8) + 255.
blt := BitBlt new.
blt sourceForm: sourceForm.
blt sourceOrigin: 0 @ 0.
blt setDestForm: destForm.
blt destOrigin: 0 @ 0.
blt combinationRule: 37. "rgbMul"
blt copyBits.
correctAlphas := correctAlphas
+ + (((blt destForm bits at: 1) digitAt: 4) = (((destAlpha) * (sourceAlpha) / 255) rounded)
- + (((blt destForm bits at: 1) digitAt: 4) = ((destAlpha+1) * (sourceAlpha+1)- 1 // 256)
ifTrue: [1]
ifFalse: [0])
]].
self assert: 65536 equals: correctAlphas!
More information about the Squeak-dev
mailing list
|