Recent

Author Topic: BGRAitmap TextOut Problem in multithreaded application.  (Read 2385 times)

Strunczez

  • Newbie
  • Posts: 4
BGRAitmap TextOut Problem in multithreaded application.
« on: May 14, 2013, 03:32:09 am »
Hello everyone.
I'm trying to Draw Text on 2 BGRABitmaps using TextRect in multithreading application.
I have 2 Bitmaps which I am drawing simultaneously by 2 threads.
so:
Thread 1
begin
...
BitmapA.TextRect(...)
...
end;

Thread 2
begin
...
BitmapB.TextRect(...)
...
end;
Differnt texts on different bitmaps and other parameters also differs.

When I start two threads at once i have SIGSEGV in file lclrescache.pas line 211

Is anything I'am missing?
I tried creating TBGRATextEffectFontRenderer for both bitmaps - same effect.

When I start those threads one by one it works, but i need to draw them faster and simultaneously.

Any Ideas?

Thanks!

circular

  • Hero Member
  • *****
  • Posts: 3508
    • Personal webpage
Re: BGRAitmap TextOut Problem in multithreaded application.
« Reply #1 on: May 18, 2013, 05:33:24 pm »
I understand, maybe you can try with a vectorized font. For this, use BGRAVectorize, create a TBGRAVectorizedFont object and prepare all the characters without using threads. To do that, access the Glyph property of all the characters you will use. Then you can draw on a Canvas2D, which is a property of all TBGRABitmap objects.
Conscience is the debugger of the mind

Strunczez

  • Newbie
  • Posts: 4
Re: BGRAitmap TextOut Problem in multithreaded application.
« Reply #2 on: May 20, 2013, 10:35:36 pm »
Thanks for a tip.
I made it another way (single threaded), but I'll try your solution in 2 weeks and I'll post my results here.

 

TinyPortal © 2005-2018