When setting Delphi to use a GPU canvas (FMX.Types.GlobalUseGPUCanvas := True), under windows and android there doesn't seem to be high quality downscale interpolation performed when calling TCanvas.DrawBitmap, instead the result looks pixelated (nearest neighbor scaler?).
Looking at the source code (FMX.Canvas.GPU.pas/DoDrawBitmap), the "HighSpeed" parameter is never used.
using TCanvas.DrawBitmap:
Using a software based bicubic scaler (a lot slower):
One would think that using the GPU would give access to a cheap (CPU-use wise) high quality scaler, but this does not seem to be the case.
Is there a way to access a good quality cross-platform hardware scaler using Delphi (or at least Delphi under Android)?
Edit:
The form's Quality property is set to "HighQuality" in these screenshots.
解决方案GlobalUseGPUCanvas := True on Desktops always draws all controls without AA. So do not use it on desktop. On Android/iOS it's a default method.
If you do not use GlobalUseGPUCanvas, but still have no AA. That is because of scaling - screen current global scale value.
If scale is 3, you should prepare you image in Photoshop with 3x scale (3 times more resolution, and your image will be with smoothed).
This code if you draw an image in runtime with canvas (e.g. diagram):
if Scene <> nil then
lScale := Scene.GetSceneScale
else
lScale := 1;
fBitmap.BitmapScale := lScale;
fBitmap.SetSize(Ceil(Width * lScale), Ceil(Height * lScale) );
To see a real image size on your device, set TImage.Wrapmode to Original.
P.s. Btw if you need to draw primitives like lines, circles etc with antialiasing on Android/iOS - use this native draw solution (On Android/iOS, FMX draws primitives without AA (btw this does not apply to images, all images are with AA on all platforms).