Microsoft.Maui.Graphics.Controls icon indicating copy to clipboard operation
Microsoft.Maui.Graphics.Controls copied to clipboard

[Enhancement] RenderMode property

Open jsuarezruiz opened this issue 2 years ago • 1 comments

Include a RenderMode property.

RenderMode = "Native|Skia"

This way we allow to choose if render the control using the native drawing APIs or SkiaSharp.

Use native drawing APIs

Pros

  • Does not require adding any extra library, the size of the App package is not increased.
  • Pixel perfect mostly all the cases.

Cons

  • In a really high number of cases, we can achieve exactly the same rendering results. However, in specific cases, for example in some cases rendering text, pixel perfect is not achieved. There are small differences between platforms.
  • The performance, especially on Android, is somewhat lower than when using SkiaSharp.

Use SkiaSharp

Pros

  • High performance and 100% pixel perfect in all cases and platforms.

Cons

  • Increase the size of the App package.

jsuarezruiz avatar Oct 13 '21 08:10 jsuarezruiz

In my UC, the canvas will already be created for rendering primitives in general, and we need to add controls onto the existing canvas after the fact. Which rendering backend Maui.Graphics will be using would already be determined in that situation. Please make sure there's an ability to draw these controls on an existing canvas, and the "RenderMode" should have some type of default "UseExisting".

RChrisCoble avatar Oct 13 '21 14:10 RChrisCoble