Which feature of the graphics card is effective in canvas drawing? lazarus / 39-Graphics ---------------------------------------------------------------------- loaded · 2019-04-09 12:00 Hi Everyone, This is an interesting situation I have encountered with the image canvas, I wrote a small canvas speed test program; i3 2350M Processor, Nvidia GT520MX Graphics Card i3 4150   Processor, Intel    HD 4400  Graphics Card i5 8250u Processor, Intel    UHD 620  Graphics Card The time of drawing is almost the same. But in 3D graphic applications and tests, the time is changing. Is there something wrong with me? Or what is the reason? ---------------------------------------------------------------------- Handoko · 2019-04-09 12:13 Did you meant you used TCanvas? As far as I know TCanvas is not hardware accelerated graphics library. It is not optimized for performance and the performance depends on the processor not the graphics card. For GUI applications and simple games, TCanvas should perform good on modern processor. If you want to get the performance benefit from the graphics card, the you should use graphics libraries or game engines that are hardware accelerated. Like: OpenGL, DirectX, Vulcan, SDL, Allegro, Irrlich, etc. If your test shows that the canvas drawing performance is almost the same running on i3 and i5 ... well, that's interesting. I wrote some demo games using only TCanvas line drawing feature, it runs much faster on my Core2 Quad computer than Dual Core laptop. Maybe you can show us the code. ---------------------------------------------------------------------- loaded · 2019-04-09 12:45 Thank you very much for your reply, Handoko I use canvas from the image object. May be true. But ,  i5 8250u is twice as fast as i3 2350M but I can't understand that the Image.Canvas drawing times are the same. Simple program that tests the processor and graphics card I created Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i unit Unit1; {$mode objfpc}{$H+} interface uses  Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, ExtCtrls; type   { TForm1 }   TForm1 = class(TForm)    Button1: TButton;    Button2: TButton;    Image1: TImage;    procedure Button1Click(Sender: TObject);    procedure Button2Click(Sender: TObject);  private   public   end; var  Form1: TForm1;  crono:cardinal;implementation {$R *.lfm} { TForm1 } procedure TForm1.Button1Click(Sender: TObject);var  i:integer;begin  crono:=GetTickCount;  for i:=0 to high(integer) do  begin   end;  button1.Caption:=FloatToStr((GetTickCount-crono)/1000) ;   // result in 3.822 second (i3 4150)end; procedure TForm1.Button2Click(Sender: TObject);varx,y:integer;begin  crono:=GetTickCount;  image1.Width:=756;  image1.Height:=425;  image1.Picture.Bitmap.SetSize(756,425);  for x:=0 to image1.Width do   begin     for y:=0 to image1.Height do      begin      image1.Canvas.Pen.Color:=x*y mod 65535;      image1.Canvas.Line(0,0,x,y);      end;   end;  button2.Caption:=FloatToStr((GetTickCount-crono)/1000) ;  // result in 1.716 ( İntel Hd 4400)end; end. ---------------------------------------------------------------------- Mr.Madguy · 2019-04-10 06:19 There were dedicated 2D accelerators in the past, but not now. But it doesn't mean, canvas isn't hardware accelerated now. It's 2D trough 3D now, cuz 2D is just a special case of 3D. ---------------------------------------------------------------------- loaded · 2019-04-10 10:32 Mr.Madguy ,Thank you for your answer. ---------------------------------------------------------------------- Handoko · 2019-04-13 17:49 I just tested on my Core2 Quad Q6600 Ubuntu Mate 64-bit Lazarus 1.8.4 GTK2 computer. The result shows there is no any significant performance difference running loaded's code using its Intel GMA 3100 (G31) integrated VGA and NVidia GeForce 210 PCIe VGA. So, it means TCanvas of GTK2 isn't hardware accelerated. Maybe future versions of GTK's canvas will be hardware accelerated when performing 2D drawing. ----- I forgot to mention, the computer has NVidia driver installed properly. ---------------------------------------------------------------------- lucamar · 2019-04-13 18:03 Quote from: Handoko on April 13, 2019, 07:49:46 pmSo, it means TCanvas of GTK2 isn't hardware accelerated. Maybe future versions of GTK's canvas will be hardware accelerated when performing 2D drawing. It depends also on the x-server video driver: to have hardware acceleration some(/most?) cards require privative drivers. GTK2 is quite hardware agnostic in this respect. ---------------------------------------------------------------------- loaded · 2019-04-14 09:05 Handoko and lucamar,  Thank you for your answers. I think ; the end of this work will end at opengl ---------------------------------------------------------------------- Thaddy · 2019-04-14 09:24 Quote from: Handoko on April 13, 2019, 07:49:46 pmSo, it means TCanvas of GTK2 isn't hardware accelerated. Maybe future versions of GTK's canvas will be hardware accelerated when performing 2D drawing.Did you try and disable the Intel driver and hardware? Because GTK definitely supports the NVIDEA card if that is installed properly. It's not GTK btw, but the X-server. You may be able to force X-server to use the NVIDEA card in the linux driver configuration. ---------------------------------------------------------------------- Handoko · 2019-04-14 15:10 I plugged the monitor cable to the NVidia card and the driver from NVidia was properly installed. I sometimes play some 3D games. So I believe the card was installed properly. Maybe the test wasn't use any of the hardware-accelerated features. ---------------------------------------------------------------------- Thaddy · 2019-04-14 17:35 The X-server capabilities are usually chosen at install time. You need to configure an additional graphic cards.