Recent

Author Topic: Lazarus3.0RC1 on Mint behaves differently than on Rock ARM board  (Read 850 times)

ermeneuta

  • Jr. Member
  • **
  • Posts: 64
Lazarus3.0RC1 on Mint behaves differently than on Rock ARM board
« on: September 17, 2023, 06:31:42 pm »
Installed Lazarus 3.0RC1 and fpc 3.2.2 on my new Rock 5A ARM board.
I wrote in the past a few LCL graphical components to suit my needs, and they work without glitches on Lazarus 3.0RC1 on my PC with Linux Mint.

I ported those components on the Debian 11 of the Rock board.
They compiled without problems, and I find them in the components list of Lazarus.
Also the program that uses them does compile with no errors.

But executing it, strange artifacts show on the screen... it looks like the screen is not refreshed correctly...
I wrote a simple test program. There is a slider, and a meter with a needle.
When I move the slider, the position of the needle changes.
On Linux Mint, it works perfectly. On the Debian 11 of the Rock board, the old position of the needle is not erased, it continues to be shown on the screen.
See the attached image.

Are there known incompatibilities between Lazarus on Mint and Lazarus on ARM ?

Thanks

jamie

  • Hero Member
  • *****
  • Posts: 6734
Re: Lazarus3.0RC1 on Mint behaves differently than on Rock ARM board
« Reply #1 on: September 17, 2023, 09:11:53 pm »
Speed issue maybe?
 without seeing the code that implements the meter face, I would say that maybe if a INVALIDATE is being used before painting over with the needle, it would be getting removed and never processed.

 what you should be doing is drawing a master image of the face on the screen and then overwrite the image with a line, or draw it on a background bitmap  and then simply display the bitmap when that area needs to be redisplayed.
The only true wisdom is knowing you know nothing

ermeneuta

  • Jr. Member
  • **
  • Posts: 64
Re: Lazarus3.0RC1 on Mint behaves differently than on Rock ARM board
« Reply #2 on: September 18, 2023, 03:07:45 pm »
Thanks for your suggestions. What I did forget to say is that same component, with the same test program, runs perfectly on an old Raspberry Pi 3B with Lazarus 1.8.4, under Raspbian...

ermeneuta

  • Jr. Member
  • **
  • Posts: 64
Re: Lazarus3.0RC1 on Mint behaves differently than on Rock ARM board
« Reply #3 on: September 18, 2023, 03:11:36 pm »
BTW, I have no problems is posting here the code that implements the meter, in case somebody is feeling so helpful to give it a look... Just ask.

ermeneuta

  • Jr. Member
  • **
  • Posts: 64
Re: Lazarus3.0RC1 on Mint behaves differently than on Rock ARM board
« Reply #4 on: September 18, 2023, 03:20:54 pm »
... and, as a matter of facts, I do a bitblt of the background on a temporary bitamp, draw on it the arrow, then do a final bitblt of the temporary bitmap on the screen canvas...


Code: Pascal  [Select][+][-]
  1.   BitBlt(FFaceBitmap.Canvas.Handle, 0, 0, FBackBitmap.Width,
  2.     FBackBitmap.Height, FBackBitmap.Canvas.Handle, 0, 0, SRCCOPY);
  3.   DrawArrow(FFaceBitmap, GetAAMultipler);

Code: Pascal  [Select][+][-]
  1.      begin
  2.       Canvas.Clear;
  3.       BitBlt(Canvas.Handle, 0, 0, FFaceBitmap.Width,
  4.       FFaceBitmap.Height,FFaceBitmap.Canvas.Handle, 0, 0, SRCCOPY);
  5.      end

This works on both Linux Mint and the Raspbian of Raspberry Pi 3B, but not on the Debian 11 of the Rock board...

« Last Edit: September 18, 2023, 03:22:28 pm by ermeneuta »

jamie

  • Hero Member
  • *****
  • Posts: 6734
Re: Lazarus3.0RC1 on Mint behaves differently than on Rock ARM board
« Reply #5 on: September 19, 2023, 01:19:40 am »
You may want to test the width and height of the canvas before using the CLEAR member. Here it's 0 and there for the clear serves no purpose.

 maybe you should be using the FillRect instead.
The only true wisdom is knowing you know nothing

 

TinyPortal © 2005-2018