Jump to content
David_Lyon

ANN: Skia4Delphi 4.0.1 compilation error

Recommended Posts

Hi, 

 

I've recently installed Skia4Delphi 4.0.1 and could run the demo just fine. It looks great BTW!

 

However, when I enabled Skia4Delphi in my FMX project, I immediatly ran into a compilation error when building (see attached screenshot). Any idea where this could come from?

 

Regards, 

 

David

 

 

 

Skia4Delphi_error.JPG

Share this post


Link to post

Hi David! What is the exact version you are using? It looks like 11.2, but here on 11.2 Enterprise it works fine. Does this occur on a blank project? Have you tried deleting the output folder of the project? (maybe there is conflict with old dcu)

Share this post


Link to post

Hi,

 

Thank you for your quick reply. Yes, it's Delphi 11.2 Professional.

The problem did not occur on a blank project, that was the first thing I tried 😉

 

I deleted the Win32 and Win64 output folders as you suggested and I could compile successfully!

Thanks for your help, awesome project you have there.

 

  • Like 1

Share this post


Link to post

Quick follow-up. I've enabled Skia4Delphi, but it made my project incredibly slow, even to simply load an image into a TImageViewer.

The UI became very very sluggish and CPU usage was 25% (one core at full capacity).

I then tried with "GlobalUseSkiaRasterWhenAvailable := False;" and this helped. But rendering my buttons (that are rectangles with TPath) became aliased. And the UI still felt quite slower than pure FMX.

 

Any idea what might be causing the issue?

 

The only thing I can think of is that my whole UI is contained within a TLayout, so that I can scale everything.

Share this post


Link to post

@David_Lyon  We still don't have an ideal renderer, the complete and correct job would be to replace 25% of the FMX, that is, the entire rendering:

  • TCanvas (of screen and bitmaps),
  • TContext (rendering of 3D forms and shaders)
  • TTextLayout,
  • Codecs,
  • Shaders code (Filters and Effects),
  • Printers,
  • Backends graphic libraries (GLES, Metal, DirectX, ...),
  • Caching systems,
  • and others;

Making implementations that use Skia, because Skia is a layer that adds new features, quality, reliability and important optimizations.

Much of the work has already been done and works perfectly, and is already faster overall than the default system (see the Benchmark/FmxFPS project in your Skia4Delphi folder). But there are still parts that need to be improved, for example, the performance of bitmaps and effects.

 

About the quality, we did something that FMX should have done: we considered the already existing property Form.Quality to define the quality of the drawings, which can be HighPerformance, SystemDefault or HighQuality. Anti-alias is only disabled when Form.Quality = HighPerformance, which should be your case.

 

Over the past few months we have focused on full API stability, adding features and rendering reliability. It is likely that the performance is in the next targets but, as I said, in the current implementation there are already some gains in the main operations, mainly in the texts, and only some types of applications or hardware show worsening.

 

Note: do not use VM or Debug mode to run the benchmark and I advise leaving Form.Quality = SystemDefault.

Furthermore, Skia4Delphi's renderer is optional, that is, you can disable it and use only the library controls for example. In this case, just remove the "GlobalUseSkia := True;" make your .dpr.

Edited by vfbb

Share this post


Link to post

@vfbb

Thank you for your reply. I think something in my code does not agree with Skia4Delphi, but after having no problem with new projects using Skia4Delphi, I'll have to investigate more.

I've been doing quite a few tricky things with my UI, so I'll simplify my code and try again. Hopefully, I'll be able to rebuild on more solid ground.

 

Thanks for your help.

 

  • Like 1

Share this post


Link to post

@vfbb Just a quick update. I've noticed that what seemed to be causing problems was the couple of TImageViewers I have in my interface.

They have a tiled background (the tile is a small png, so not a huge image). When I uncheck Showbackground on both TImageviewers, my program becomes responsive again and CPU usage goes back to normal.

Don't hesitate to let me know if you want me to send you a test project which reproduces the issue.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×