The Trunk: GraphicsTests-dtl.15.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: GraphicsTests-dtl.15.mcz

commits-2
David T. Lewis uploaded a new version of GraphicsTests to project The Trunk:
http://source.squeak.org/trunk/GraphicsTests-dtl.15.mcz

==================== Summary ====================

Name: GraphicsTests-dtl.15
Author: dtl
Time: 29 October 2009, 9:16:43 am
UUID: 2aa5b047-b1fb-4712-8543-09ec8d2a04a0
Ancestors: GraphicsTests-ar.14

Add six new tests to BitBltTest provided by Juan Vuletich, reference Mantis 7407. These tests will fail until the necessary fixes have been applied to BitBltPlugin in the VM.

Two existing tests in BitBltTest (#testAlphaCompositingSimulated and #testAlphaCompositing2Simulated) should be moved to the VMMaker package as per Juan's recommendation, but are left here until the VMaker changes have been made (follow-up required).



=============== Diff against GraphicsTests-ar.14 ===============

Item was added:
+ ----- Method: BitBltTest>>testAllAlphasRgbAdd (in category 'bugs') -----
+ testAllAlphasRgbAdd
+ "self run: #testAllAlphasRgbAdd"
+ | sourceForm destForm blt correctAlphas |
+      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: 20. "rgbAdd"
+               blt copyBits.
+               correctAlphas := correctAlphas
+                 + (((blt destForm bits at: 1) digitAt: 4) = (destAlpha + sourceAlpha min: 255)
+                          ifTrue: [1]
+                          ifFalse: [0])
+       ]].
+      self assert: 65536 equals: correctAlphas!

Item was added:
+ ----- Method: BitBltTest>>testAllAlphasRgbMul (in category 'bugs') -----
+ testAllAlphasRgbMul
+ "self run: #testAllAlphasRgbMul"
+ | sourceForm destForm blt correctAlphas |
+      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+1) * (sourceAlpha+1)- 1 // 256)
+                          ifTrue: [1]
+                          ifFalse: [0])
+       ]].
+      self assert: 65536 equals: correctAlphas!

Item was added:
+ ----- Method: BitBltTest>>testAllAlphasRgbSub (in category 'bugs') -----
+ testAllAlphasRgbSub
+ "self run: #testAllAlphasRgbSub"
+ | sourceForm destForm blt correctAlphas |
+      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: 21. "rgbSub"
+               blt copyBits.
+               correctAlphas := correctAlphas
+                 + (((blt destForm bits at: 1) digitAt: 4) = (destAlpha - sourceAlpha) abs
+                          ifTrue: [1]
+                          ifFalse: [0])
+       ]].
+      self assert: 65536 equals: correctAlphas!

Item was added:
+ ----- Method: BitBltTest>>testAllAlphasRgbMin (in category 'bugs') -----
+ testAllAlphasRgbMin
+ "self run: #testAllAlphasRgbMin"
+ | sourceForm destForm blt correctAlphas |
+      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: 28. "rgbMin"
+               blt copyBits.
+               correctAlphas := correctAlphas
+                 + (((blt destForm bits at: 1) digitAt: 4) = (destAlpha min: sourceAlpha)
+                          ifTrue: [1]
+                          ifFalse: [0])
+       ]].
+      self assert: 65536 equals: correctAlphas!

Item was added:
+ ----- Method: BitBltTest>>testAllAlphasRgbMax (in category 'bugs') -----
+ testAllAlphasRgbMax
+ "self run: #testAllAlphasRgbMax"
+ | sourceForm destForm blt correctAlphas |
+      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: 27. "rgbMax"
+               blt copyBits.
+               correctAlphas := correctAlphas
+                 + (((blt destForm bits at: 1) digitAt: 4) = (destAlpha max: sourceAlpha)
+                          ifTrue: [1]
+                          ifFalse: [0])
+       ]].
+      self assert: 65536 equals: correctAlphas!

Item was added:
+ ----- Method: BitBltTest>>testAllAlphasRgbMinInvert (in category 'bugs') -----
+ testAllAlphasRgbMinInvert
+ "self run: #testAllAlphasRgbMinInvert"
+ | sourceForm destForm blt correctAlphas |
+      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: 29. "rgbMinInvert"
+               blt copyBits.
+               correctAlphas := correctAlphas
+                 + (((blt destForm bits at: 1) digitAt: 4) = (destAlpha min: 255-sourceAlpha)
+                          ifTrue: [1]
+                          ifFalse: [0])
+       ]].
+      self assert: 65536 equals: correctAlphas!