Recent

Author Topic: TextOut is based on gdk_draw_layout_with_colors  (Read 1128 times)

AlexTP

  • Hero Member
  • *****
  • Posts: 2457
    • UVviewsoft
TextOut is based on gdk_draw_layout_with_colors
« on: January 02, 2024, 09:28:38 am »
GTK2 TextOut/ExtTextOut is based on TGtkDeviceContext.DrawTextWithColors
which is based on API
Code: Pascal  [Select][+][-]
  1. gdk_draw_layout_with_colors(drawable, GC, X, Y, AFont^.GDIFontObject, FGColor, BGColor);  
       

I made the timings for my app and see that _many_ calls of gdk_draw_layout_with_colors are slow. (This is the case for ATSynEdit when text lines have many 'tokens').

Anybody tried to change to different GTK2 API? What I see by Lazarus auto-completion:

gdk2_draw_layout
gdk2_draw_layout_line
gdk2_draw_layout_line_with_colors
gdk2_draw_text (edited: this is deprecated since gtk 2.4)
gdk2_draw_text_wc (edited: this is deprecated since gtk 2.4)

Are they slow too? What if one of them is 10x faster? I cannot measure it because I don't know how to call them properly.
« Last Edit: January 02, 2024, 11:06:16 am by AlexTP »

 

TinyPortal © 2005-2018