[Vm-dev] BUG? A problem with callbacks that shows up in 64bits (but is on 32bits too)

Bert Freudenberg bert at freudenbergs.de
Tue Mar 14 18:47:56 UTC 2017


On Sun, Mar 12, 2017 at 4:53 AM, Esteban Lorenzano <estebanlm at gmail.com>
wrote:

>
> Hi,
>
> this is lockSurfaceFn:
>
> createLockSurfaceFn
> ^ FFICallback
> signature: #(void * (void *handle, int *pitch, int x, int y, int w, int h))
> block: [ :handle :pitch :x :y :w :h |
> pitch signedLongAt: 1 put: (self get_stride: handle).
> self get_data: handle ]
>
> and
>
> createUnlockSurfaceFn
> ^ FFICallback
> signature: #(int (void *handle, int x, int y, int w, int h))
> block: [ :handle :x :y :w :h | 0 "Do nothing” ]
>
> cheers!
> Esteban
>


Just as an aside: I think in lockSurface you might want to do a
cairo_surface_flush before accessing the data. Otherwise Cairo might still
be accessing the bits while they get moved around by the GC - not a good
idea. And unlockSurface should use cairo_surface_mark_dirty_rectangle.

See RomePlugin>>showSurface:x:y:w:h: and unlockSurface:x:y:w:h: (
http://www.squeaksource.com/Rome.html)

- Bert -
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20170314/1d413fbc/attachment.html>


More information about the Vm-dev mailing list