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

Renderer architechure of composable Maui.Graphics.Controls

Open redradist opened this issue 2 years ago • 14 comments

Hi all,

I have found this project recently and I am curious is there an architecture for rendering of Graphics Controls in this repo ?

For example Avalonia doing the something similar, they use underlying draw system, but they have composability of graphic controls and due to this they have renderer architecture (Main Thread and Renderer Thread)

Do you have already specified the renderer architecture for composable Graphic Controls ?

Such kind of architecture will allow deterministically (not relying on underlying platform) propagate event in Tree like structure of composable Controls

redradist avatar Nov 20 '21 13:11 redradist

Looks like these controls do not allow something like in Flutter/Avalonia - Widget architecture (full UI is drawn) Do you have plans to add such support ?

redradist avatar Dec 08 '21 20:12 redradist

Could you share links to review what other frameworks are doing?.

jsuarezruiz avatar Dec 09 '21 10:12 jsuarezruiz

Yes, of course:

  1. Uno Platform https://platform.uno/pixel-perfect
  2. Flutter https://www.youtube.com/watch?v=996ZgFRENMs, there are much more other links
  3. Avalonia UI https://youtu.be/RTXNJ0vENlA?t=1155 (video in Russian, but I hope auto-translation and timestamp will help to understand rendering mechanism)

redradist avatar Dec 09 '21 21:12 redradist

@redradist - such a hierarchy is in MAUI itself. Would be redundant to have that here, IMHO.

The outcome I want is Maui > these Graphics.Controls > Maui.Graphics > bitmap > everywhere.

That is, instead of rendering Maui to native controls, render Maui directly to a bitmap, using this library as one of the steps.

ToolmakerSteve avatar Dec 17 '21 20:12 ToolmakerSteve

@redradist - such a hierarchy is in MAUI itself. Would be redundant to have that here, IMHO.

The outcome I want is Maui > these Graphics.Controls > Maui.Graphics > bitmap > everywhere.

That is, instead of rendering Maui to native controls, render Maui directly to a bitmap, using this library as one of the steps.

@ToolmakerSteve I do not think it is the case in MAUI, because for Xamarin all controls was wrappers around native components and all event propagation relies on Android or iOS and it make difficult to propagate event in hierarchic components ... In contrast, in Flutter, JetPack Compose, Qt it much simpler, becaue all event propagate hierarchically and handled from child to parent

redradist avatar Apr 29 '22 21:04 redradist

Actually, Xamarin Forms had the Visual property that supported various drawn controls, such as Material, Fluent, and Cupertino. These were intended to be implemented as drawn controls that could be used on any platform. It strikes me that this project offers an alternative approach.

I'm very much n favorite of this project as it offers me a way to create some drawn controls, like custom ColorPickers and Sliders.

IndianaGary avatar May 10 '22 01:05 IndianaGary

@jsuarezruiz Do you know something from Microsoft about implementation completely its own render system based on Microsoft.Maui.Graphics ?

Something that will draw on single canvas and works similar way it is done in Flutter, JetPack Compose (new Android approach, similar to Flutter) or Avalonia ?

Is there internal thought about it ?

I am very interested in such approach because in Xamarin I was tired of platform specific issues and due to this only platform specific features: event propagation, changing how to customize something on each platform separately, platform specific bug and due to this workaround for this particular platforms, - all it make hard to customize and support the application

redradist avatar May 21 '22 20:05 redradist

Here is also link to Avalonia implementation architecture: https://dev.to/avalonia/avalonia-platform-support-why-its-simple-cjd

redradist avatar Aug 11 '22 12:08 redradist

Are they related?

From: Denis @.> Sent: Thursday, August 11, 2022 5:11 AM To: dotnet/Microsoft.Maui.Graphics.Controls @.> Cc: Gary Lewis @.>; Comment @.> Subject: Re: [dotnet/Microsoft.Maui.Graphics.Controls] Renderer architechure of composable Maui.Graphics.Controls (Issue #91)

Here is also link to Avalonia implementation architecture: https://dev.to/avalonia/avalonia-platform-support-why-its-simple-cjdhttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdev.to%2Favalonia%2Favalonia-platform-support-why-its-simple-cjd&data=05%7C01%7C%7Caccbc4c0b0804424a1e708da7b9298e9%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637958166806867664%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=R1oR%2FOrJNvJyWGz9mTf1pOQhjJCuwKmrrvTadT18QO0%3D&reserved=0

Reply to this email directly, view it on GitHubhttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fdotnet%2FMicrosoft.Maui.Graphics.Controls%2Fissues%2F91%23issuecomment-1211905398&data=05%7C01%7C%7Caccbc4c0b0804424a1e708da7b9298e9%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637958166806867664%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=YKyb5mqgh%2BBxBFeyOoG7XqJd6FniiafII%2B0SyjXJYmk%3D&reserved=0, or unsubscribehttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FADFAH7HB4VYPD4PKTY66UV3VYTUWNANCNFSM5IN6TBLA&data=05%7C01%7C%7Caccbc4c0b0804424a1e708da7b9298e9%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637958166806867664%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=dZ3bQSG2lupHZxWfvi258NXXqp0HYgeYkckIsBg6V3Y%3D&reserved=0. You are receiving this because you commented.Message ID: @.@.>>

IndianaGary avatar Aug 13 '22 15:08 IndianaGary

@IndianaGary

Are they related? From: Denis @.> Sent: Thursday, August 11, 2022 5:11 AM To: dotnet/Microsoft.Maui.Graphics.Controls @.> Cc: Gary Lewis @.>; Comment @.> Subject: Re: [dotnet/Microsoft.Maui.Graphics.Controls] Renderer architechure of composable Maui.Graphics.Controls (Issue #91) Here is also link to Avalonia implementation architecture: https://dev.to/avalonia/avalonia-platform-support-why-its-simple-cjdhttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdev.to%2Favalonia%2Favalonia-platform-support-why-its-simple-cjd&data=05%7C01%7C%7Caccbc4c0b0804424a1e708da7b9298e9%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637958166806867664%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=R1oR%2FOrJNvJyWGz9mTf1pOQhjJCuwKmrrvTadT18QO0%3D&reserved=0 - Reply to this email directly, view it on GitHubhttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fdotnet%2FMicrosoft.Maui.Graphics.Controls%2Fissues%2F91%23issuecomment-1211905398&data=05%7C01%7C%7Caccbc4c0b0804424a1e708da7b9298e9%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637958166806867664%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=YKyb5mqgh%2BBxBFeyOoG7XqJd6FniiafII%2B0SyjXJYmk%3D&reserved=0, or unsubscribehttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FADFAH7HB4VYPD4PKTY66UV3VYTUWNANCNFSM5IN6TBLA&data=05%7C01%7C%7Caccbc4c0b0804424a1e708da7b9298e9%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637958166806867664%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=dZ3bQSG2lupHZxWfvi258NXXqp0HYgeYkckIsBg6V3Y%3D&reserved=0. You are receiving this because you commented.Message ID: @.@.>>

Links are not available for now

redradist avatar Nov 24 '22 17:11 redradist

@jsuarezruiz Do you know if there some people who working on such rendering mechanism ?

Because without such rendering mechanism, ф performance would be very pure for application with lots of drawn controls

redradist avatar Nov 24 '22 17:11 redradist

Maui does not use renderers, it uses handlers. That said, Javier has a library showing how to draw controls here: https://github.com/jsuarezruiz/AlohaKit.Controls

Get Outlook for Androidhttps://aka.ms/ghei36


From: Denis @.> Sent: Thursday, November 24, 2022 9:28:43 AM To: dotnet/Microsoft.Maui.Graphics.Controls @.> Cc: Gary Lewis @.>; Mention @.> Subject: Re: [dotnet/Microsoft.Maui.Graphics.Controls] Renderer architechure of composable Maui.Graphics.Controls (Issue #91)

@jsuarezruizhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fjsuarezruiz&data=05%7C01%7C%7C4a540f89c81a44e5c6da08dace415695%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638049077270740323%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=yXXrFKg%2Fn%2B3Thyl%2FC%2FR6FgmFz31oPmKr0qtH1LJvTEE%3D&reserved=0 Do you know if there some people who working on such rendering mechanism ?

Because without such rendering mechanism, ф performance would be very pure for application with lots of drawn controls

— Reply to this email directly, view it on GitHubhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fdotnet%2FMicrosoft.Maui.Graphics.Controls%2Fissues%2F91%23issuecomment-1326717694&data=05%7C01%7C%7C4a540f89c81a44e5c6da08dace415695%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638049077270740323%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=G%2B5XAzfjBjAVA2xmoCm9OGxZuvDHvC4Q26t85AU4XbQ%3D&reserved=0, or unsubscribehttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FADFAH7E4FQ4UCYLXZ4TWI2DWJ6QUXANCNFSM5IN6TBLA&data=05%7C01%7C%7C4a540f89c81a44e5c6da08dace415695%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638049077270740323%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=d%2BZvaox1fj4hsTBgXtqBBhjRUtxicU43aBYjfNUpAwk%3D&reserved=0. You are receiving this because you were mentioned.Message ID: @.***>

IndianaGary avatar Nov 24 '22 20:11 IndianaGary

Maui does not use renderers, it uses handlers. That said, Javier has a library showing how to draw controls here: https://github.com/jsuarezruiz/AlohaKit.Controls Get Outlook for Androidhttps://aka.ms/ghei36 ________________________________ From: Denis @.> Sent: Thursday, November 24, 2022 9:28:43 AM To: dotnet/Microsoft.Maui.Graphics.Controls @.> Cc: Gary Lewis @.>; Mention @.> Subject: Re: [dotnet/Microsoft.Maui.Graphics.Controls] Renderer architechure of composable Maui.Graphics.Controls (Issue #91) @jsuarezruizhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fjsuarezruiz&data=05%7C01%7C%7C4a540f89c81a44e5c6da08dace415695%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638049077270740323%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=yXXrFKg%2Fn%2B3Thyl%2FC%2FR6FgmFz31oPmKr0qtH1LJvTEE%3D&reserved=0 Do you know if there some people who working on such rendering mechanism ? Because without such rendering mechanism, ф performance would be very pure for application with lots of drawn controls — Reply to this email directly, view it on GitHubhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fdotnet%2FMicrosoft.Maui.Graphics.Controls%2Fissues%2F91%23issuecomment-1326717694&data=05%7C01%7C%7C4a540f89c81a44e5c6da08dace415695%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638049077270740323%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=G%2B5XAzfjBjAVA2xmoCm9OGxZuvDHvC4Q26t85AU4XbQ%3D&reserved=0, or unsubscribehttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FADFAH7E4FQ4UCYLXZ4TWI2DWJ6QUXANCNFSM5IN6TBLA&data=05%7C01%7C%7C4a540f89c81a44e5c6da08dace415695%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638049077270740323%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=d%2BZvaox1fj4hsTBgXtqBBhjRUtxicU43aBYjfNUpAwk%3D&reserved=0. You are receiving this because you were mentioned.Message ID: @.***>

@IndianaGary Okay, it does not matter how it is called in MAUI ... Something that allow to draw composition controls, when on inside of another one

redradist avatar Nov 24 '22 21:11 redradist

See the referenced library...

IndianaGary avatar Nov 25 '22 07:11 IndianaGary