I
I
Igor2019-06-24 20:35:41
Delphi
Igor, 2019-06-24 20:35:41

Delphi TChromium, hidden rendering, how to reduce graphics quality and make it run faster?

Colleagues, please tell me how to improve browser performance by reducing quality and other bells and whistles in CEF?
Here is some code

begin
  if not DirectoryExists('.\cache') then
    ForceDirectories('.\cache');
  if not DirectoryExists('.\cookie') then
    ForceDirectories('.\cookie');

  INISetting := TINISetting.Create('.\setting.ini');

  CurrentParsingProject := TProject.Create;
  CurrentParsingProject.id := INISetting.Read('CurrentParsingProject', 'id', 0);
  CurrentParsingProject.name := INISetting.Read('CurrentParsingProject', 'name', '');
  CurrentParsingProject.comment := INISetting.Read('CurrentParsingProject', 'comment', '');
  CurrentParsingProject.create_at := INISetting.Read('CurrentParsingProject', 'create_at', '');

  GlobalCEFApp := TCefApplication.Create;
  GlobalCEFApp.EnableGPU := true;
  GlobalCEFApp.FastUnload := true;
  GlobalCEFApp.WindowlessRenderingEnabled := true;
  GlobalCEFApp.RemoteDebuggingPort := 9000;
  GlobalCEFApp.OnProcessMessageReceived := GlobalCEFApp_OnProcessMessageReceived;
  GlobalCEFApp.LogFile := 'debug.log';
  GlobalCEFApp.LogSeverity := LOGSEVERITY_INFO;
  GlobalCEFApp.Cache := '.\cache\';
  GlobalCEFApp.EnableHighDPISupport := false;
  GlobalCEFApp.Cookies := '.\cookie\';
  GlobalCEFApp.EnableMediaStream := false;
  GlobalCEFApp.SitePerProcess := false;
  GlobalCEFApp.IgnoreCertificateErrors := true;


  if GlobalCEFApp.StartMainProcess then
  begin
    Application.Initialize;
    Application.CreateForm(TFormMain, FormMain);
    Application.CreateForm(TFormSetting, FormSetting);
    Application.CreateForm(TFormProjects, FormProjects);
    Application.CreateForm(TFormNewProject, FormNewProject);
    Application.Run;
  end;

  GlobalCEFApp.Free;
  GlobalCEFApp := nil;
  INISetting.Update;
  INISetting.Free;
  CurrentParsingProject.Free;
end.

GlobalCEFApp is the framework's global application.
In which you can twist the settings.
What to turn off to improve the quality?
For example, disable image loading and so on...

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question