Faculty of Information Technology
Software Engineering Group

Opened 3 years ago

Last modified 3 years ago

#88 new defect

UIPainter canvas with grid on shows artefacts when restarted from a snapshot.

Reported by: Jan Vrany Owned by:
Priority: major Milestone:
Component: default Keywords:
Cc: Also affects CVS HEAD (eXept version): no


This is a follow up for #86

Very good, that should help. The raster thing is indeed fishy and I > feel is first symptom.
The raster is implemented as on-the-fly generated bitmap which is then set as canvas background. So perhaps upon snapshot restart, something gets terribly wrong. Will see.


As for the raster issue: the problem is likely that the raster pixmap is created from scratch by drawing onto a Windowx bitmap. When an image is saved, the Form has not backing data so upon snapshot restart, the form is recreated but with random data (what used to be at place where Windows allocated them).
So, we need to save the data by #getBits before image is saved. That should fix it.

Change History (7)

comment:1 Changed 3 years ago by Jan Vrany

Under X11 it works just fine, so it's Windows-specific.

comment:2 Changed 3 years ago by Patrik Svestka

Yes it works correctly on my Archlinux instance too, so it will be Windows-specific issue.

comment:3 Changed 3 years ago by Jan Vrany

Observation: after more research, the problem is much more complex than I thought. Form data are remembered but not properly recreated, i.e., not properly copied from Smalltalk ByteArray? to GDI's bitmap object. Follow the code path from Form>>recreate

comment:4 Changed 3 years ago by Patrik Svestka

Observation too: The artifacts are not random. They are connected to the correct "original dots". My guess would be that the recreate ignores masking of the x, y placements (calculation) and place them in everywhere in the x, y axes.

in the

Form > initialize 
maskedPixelsAre0 := false. 

Maybe this gets ignored and maskedPixelsAre0 remains false.

comment:5 Changed 3 years ago by Jan Vrany

I think the problem is that when form is recreated, a wrong depth is used. When Form is created with depth specified (see Form>>width:height:depth:).

But the From itself does not know the it's depth, it's not stored anywhere, so when recreated it has to be computed from data bytearray size. It all ends up in WinWorkstation>>primCreateBitmapFromArray:width:height: so this method has to be checked whether it's correct and does the depth computation right.

Will have a look it later.

Note: See TracTickets for help on using tickets.