-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding generic display driver #118
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this is a work in progress as I can't see the calls to a native method.
One thing to note, I found that the use of properties when compiled into native stubs causes every property to have two NULL entries on the method call which I assume takes 8 bytes.
Using fields eliminates this.
I usually use properties as it allows extra code checking if required and I'm sure the compiler optimises it all, but, in this situation the stubs become much much larger than required.
Its a shame that everything needs to be cast as byte on the call since we can call the init code with different drivers which have different enums and they can't by definition be related.
An alternate, maybe a little cleaner is to use a class instead of an enum and create a series of public const byte fields. This way you can reference the codes without the case
Also, would this be a good time to start the split up into DisplayController, Primitives and optionally nanoPresentation, Touch?
So the DisplayController could also have a basic embedded font for a minimal system, requiring no bitmaps etc.
I have a basic font and writing direct to display working
There is no call to native methods. There is a generic driver on the native side. See the native PR.
It's a matter of optimization. 1 class, few arrays and all is there. Then the magic happens fully transparently on the native side. With a normal driver or a generic ones, there is no difference at all. No breaking changes neither from existing code (OK, I renamed the orientation enum but should not be too damageable on the managed side. For the rest of the remarks, it's in the backlog to be optimized. |
For some reasons, the pragma did not solve the code smell which is only on auto properties. So I'll leave it like this! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Worth noting that there are several enums being passed to the native declaration that aren't used there. |
@Ellerbach check this out on how to exclude enums that are not used in native. With this they are not added to the stubs. I'm not familiar with the code, so please check if any of these should indeed be there. And, of course, do add all the others that don't need to be there.
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Description
Adding generic display driver
Motivation and Context
How Has This Been Tested?
On real devices with real screen
Screenshots
Types of changes
Checklist: