Skip to content

Conversation

@zabackary
Copy link
Contributor

There's a couple of changes going on here:

  1. I updated vexDisplayCopyRect invocations to properly add 0x20 for the header bar to y2 as well as y1.

  2. I modified <DisplayDriver as DrawTarget>::draw_iter to fill individual pixels. I think that was the intention of embedded-graphics and it vastly improves performance.

  3. I implemented fill_contiguous which is intended to be used for copying images and such to use vexDisplayCopyRect. I re-used the slice in DisplayDriver to save allocations all the time, but it might be better to just dynamically allocate instead of allocating a buffer of the max size up front.

  4. I implemented fill_solid to fill rectanges the usual way.

  5. I added methods to update the rendering mode of the display.

Essentially, the original implementation just copied the entire buffer over at once, which wasn't very good for performance since embedded-graphics calls draw_iter several times per frame typically, making for slow frame rates on complex scenes.

it's probably being inlined anyway but using `into_storage` removes a
layer of unnecessary indirection.
also removes buffering as embedded-graphics is intended to be immediate
Copy link
Member

@tropicaaal tropicaaal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tropicaaal tropicaaal merged commit 014559a into vexide:main Apr 20, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants