I feel like it would be better to change pixelValueAt: so as to always unhibernate, but I did not dare if ever someone had the idea of sending it in tight loops (one shouldn't, there is BitBlt for that purpose, but who knows...).
Maybe we could fail primitivePixelValueAt if receiver is Byte like, and unhibernate in fallback code. We would let every other BitBlt primitives accept a ByteArray to allow BitBlt tricks. Thoughts? 2013/12/13 <[hidden email]> Nicolas Cellier uploaded a new version of MorphicExtras to project The Trunk: |
2013/12/13 Nicolas Cellier <[hidden email]>
No one raised a comment so far. Isn't it a good idea to fail the primitive? If yes, then it's very simple to implement, just add: (interpreterProxy isWords: bitmap) ifFalse:[interpreterProxy primitiveFail]. somewhere in the preamble of BitBltSimulation>>primitivePixelValueAtX: xVal y: yVal I check the senders of pixelValueAt:, and some of them would loop over each pixel. So sending unhibernate at each pixel does not seem a good idea anyway. Leaking unhibernate sends out of the loop neither is, because then 3rd party classes must be aware of an implementation detail of Form.
|
On 20.12.2013, at 00:55, Nicolas Cellier <[hidden email]> wrote:
The primitive must fail, yes. That is simply a bug. Before that primitive existed, pixelValueAt: used BitBlt which did the unhibernate.
IMHO the primitive should do the same check as BitBlt: verify that the size of the bits is exactly right given width, height, and depth. - Bert -
|
Free forum by Nabble | Edit this page |