<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><div><div>On 20.12.2013, at 00:55, Nicolas Cellier <<a href="mailto:nicolas.cellier.aka.nice@gmail.com">nicolas.cellier.aka.nice@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">2013/12/13 Nicolas Cellier <span dir="ltr"><<a href="mailto:nicolas.cellier.aka.nice@gmail.com" target="_blank">nicolas.cellier.aka.nice@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">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...).<br>
<br>Maybe we could fail primitivePixelValueAt if receiver is Byte like, and unhibernate in fallback code.<br>We would let every other BitBlt primitives accept a ByteArray to allow BitBlt tricks.<br><br>Thoughts?<br></div>
<div class="gmail_extra"><br></div></blockquote><div><br></div><div>No one raised a comment so far.<br></div><div>Isn't it a good idea to fail the primitive?<br></div></div></div></div></blockquote><div><br></div><div>The primitive must fail, yes. That is simply a bug. Before that primitive existed, pixelValueAt: used BitBlt which did the unhibernate. </div><br><blockquote type="cite"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>If yes, then it's very simple to implement, just add:<br>
<br> (interpreterProxy isWords: bitmap) ifFalse:[interpreterProxy primitiveFail].<br></div></div></div></div></blockquote><div><br></div><div>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.</div><div><br></div><div>- Bert -</div><br><blockquote type="cite"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><br></div><div>somewhere in the preamble of BitBltSimulation>>primitivePixelValueAtX: xVal y: yVal <br><br></div><div>I check the senders of pixelValueAt:, and some of them would loop over each pixel.<br>
So sending unhibernate at each pixel does not seem a good idea anyway.</div></div></div></div></blockquote><br><blockquote type="cite"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>Leaking unhibernate sends out of the loop neither is, because then 3rd party classes must be aware of an implementation detail of Form.<br>
</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="gmail_extra"><div class="gmail_quote">2013/12/13 <span dir="ltr"><<a href="mailto:commits@source.squeak.org" target="_blank">commits@source.squeak.org</a>></span><div>
<div class="h5"><br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Nicolas Cellier uploaded a new version of MorphicExtras to project The Trunk:<br>
<a href="http://source.squeak.org/trunk/MorphicExtras-nice.137.mcz" target="_blank">http://source.squeak.org/trunk/MorphicExtras-nice.137.mcz</a><br>
<br>
==================== Summary ====================<br>
<br>
Name: MorphicExtras-nice.137<br>
Author: nice<br>
Time: 13 December 2013, 10:07:57.316 pm<br>
UUID: 127ce68e-b210-42a3-b0b3-b40c69941d02<br>
Ancestors: MorphicExtras-nice.136<br>
<br>
Correct an awfull bug in PaintBoxMorph>>showColor<br>
One should NEVER send pixelValueAt: nor colorAt: to an hibernated Form (or ColorForm).<br>
<br>
=============== Diff against MorphicExtras-nice.136 ===============<br>
<br>
Item was changed:<br>
----- Method: PaintBoxMorph>>showColor (in category 'actions') -----<br>
showColor<br>
"Display the current color in all brushes, both on and off."<br>
<br>
| offIndex onIndex center |<br>
currentColor ifNil: [^self].<br>
"colorPatch color: currentColor. May delete later"<br>
(brushes isNil or: [brushes first owner ~~ self])<br>
ifTrue:<br>
[brushes := OrderedCollection new.<br>
#(#brush1: #brush2: #brush3: #brush4: #brush5: #brush6:)<br>
do: [:sel | brushes addLast: (self submorphNamed: sel)]].<br>
+ brushes last offImage unhibernate.<br>
+ brushes last onImage unhibernate.<br>
+ brushes last pressedImage unhibernate.<br>
+ center := brushes last offImage extent // 2.<br>
+ offIndex := brushes last offImage pixelValueAt: center.<br>
+ onIndex := brushes last onImage pixelValueAt: center.<br>
- center := (brushes sixth) offImage extent // 2.<br>
- offIndex := (brushes sixth) offImage pixelValueAt: center.<br>
- onIndex := (brushes sixth) onImage pixelValueAt: center.<br>
brushes do:<br>
[:bb |<br>
bb offImage colors at: offIndex + 1 put: currentColor.<br>
bb offImage clearColormapCache.<br>
bb onImage colors at: onIndex + 1 put: currentColor.<br>
bb onImage clearColormapCache.<br>
bb invalidRect: bb bounds].<br>
self invalidRect: (brushes first topLeft rect: brushes last bottomRight)!<br>
<br>
<br>
</blockquote></div></div></div><br></div>
</blockquote></div><br></div></div>
<br></blockquote></div><br></body></html>