Hi, How about changing AthensCairoSurface >> asForm into the following definition?:asForm "create a form and copy an image data there" | form | self checkSession. self flush. form := Form extent: (self width@self height) depth: 32. form unhibernate. LibC memCopy: self getDataPtr to: form bits size: self width*self height*4. ^ form Smalltalk compiler evaluate: ' | surface | surface := AthensCairoSurface extent: 640@480. surface drawDuring: [ :canvas | surface clear: Color blue. ]. surface asForm asMorph openInWindow ' asForm "create a form and copy an image data there" self checkSession. self flush. ^ (AthensCairoSurfaceForm extent: (self width@self height) depth: 32 bits: id) surface: self; yourself 2016-12-21 5:27 GMT-03:00 Esteban Lorenzano <[hidden email]>: would be possible to have one of your crashing images? AthensCairoSurface-asForm.st (520 bytes) Download Attachment AthensCairoSurfaceForm.st (2K) Download Attachment |
First option is clean but there is no way to get the surface back to do further things. Second keeps the surface around and this is pretty useful and the class name implies there is something about Athens in there. Now can't we have it both ways? By default it is the second option but when we, say, #withoutCairoDependency, we get the version 1 executed. and a #isCairoIndependent testing thing. anAthensCairoSurfaceForm asForm withoutCairoDependency -> aMundaneForm Phil On Mon, Feb 13, 2017 at 1:48 AM, Ronie Salgado <[hidden email]> wrote:
|
In reply to this post by Ronie Salgado
Hi Ronie,
Below you said: The problem with asForm, is that the form returned can be used after the cairo surface which holds the pixels is garbage collected. I cannot reproduce this case. You gave a script:
I see a blue window. Cheers, Alexandre
|
Hi Alex, I gave the following script:Smalltalk compiler evaluate: ' 2017-03-14 16:12 GMT-03:00 Alexandre Bergel <[hidden email]>:
|
Hi Ronie,
On Tue, Mar 14, 2017 at 5:08 PM, Ronie Salgado <[hidden email]> wrote:
Can you experiment with VMs at or later than VMMaker.oscog-eem.2156? I added a solution to the BitBlt primitives to detect GC occurring in a BitBlt primitive and for the Cairo surface callbacks returning errors. This is orthogonal to the GC issue you raise, but both issues need solutions. Hopefully we have them now. Another thing to note is that in my latest commit of the entire tree I modified the surface plugin to allow defaulting some of the functions (those for ioGetSurfaceFormat, isUnlockSurface & ioShowSurface), this means that one can default the null callbacks created in createShowSurfaceFn & createUnlockSurfaceFn to answer 0 (provided you change the installation code suitably to not send thunk when the argument is 0, not a Callback). This should speed up small Athens blits noticeably.
_,,,^..^,,,_ best, Eliot |
Free forum by Nabble | Edit this page |