-
Notifications
You must be signed in to change notification settings - Fork 6k
Support configurable pixel formats for the embedder API sofware rendering backend #26995
Conversation
|
Sorry about the late response. I was on the fence on this one. We recommend that embedder API users use the GPU backends wherever possible. The software backend has many other obvious optimizations that we have not bothered with because we only ever use it in test contexts. So, using the software backend on an already underpowered device makes me nervous. Can you elaborate your use case a bit? Is GPU backend not an option at all? Which boards are you trying to support for example? Maybe we can tinker with them ourselves. OTOH supporting the most useful formats seems very reasonable. Can we just support popular formats like RGB 565 instead of exposing everything Skia supports? |
Yeah, I mean we could also look into using OpenGL via some kind of software emulation (llvmpipe, swift shader) but using the software rendering skia supports internally seemed like the most straightforward (and also least-overhead) way to go
Sure, concretely I'm working with an i.MX 6 ULL for example. That variant of the iMX 6 has no GPU, but sadly it's still used in lots of embedded projects. It does have some hardware acceleration for common 2D graphics operations with a hardware block called the PXP, but that's exposed via a vendor-specific API and skia can't make use of it (without modification). We did some testing and it's able to do 20- maybe 25FPS, but that's with manual conversion of the graphics buffers to RGB565 using NEON SIMD stuff, so maybe 30 might be possible with direct RGB565 rendering? 30FPS (even 20 actually) is good enough, you can't really expect more with that kind of hardware. AFAICT Qt won't do more than that as well.
sure, I'll update it |
|
Any updates on reducing the number of supported formats? |
|
@chinmaygarde thx for the ping! forgot about it. Removed the 10bit pixel formats |
|
@chinmaygarde ping. |
|
Sorry I was on vacation for a bit and couldn't get to this patch. I think the updated format list looks good. I'll make another pass over this patch to check the updates to the public embedder API. |
b1a8771 to
2962099
Compare
|
any news on this? @chinmaygarde |
|
This pull request executed golden file tests, but it has not been updated in a while (20+ days). Test results from Gold expire after as many days, so this pull request will need to be updated with a fresh commit in order to get results from Gold. |
|
@iskakaushik do you have some time to look at this? |
|
@chinmaygarde @iskakaushik After a rebase, it looks like this should get a review. |
|
From PR triage: The presubmit checks are failing due to a need to rebase. |
thx, rebased it |
iskakaushik
left a comment
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.
left some initial comments, looks good overall
|
From PR review triage: Is this PR ready for another review pass? |
|
@zanderso I addressed the review comments except for one, but I explained it. Maybe @iskakaushik can tell me if it's okay that way or if I should remove the last |
iskakaushik
left a comment
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, sorry for the delay here @ardera . If you fix the license issues we can land this!
|
@ardera Any updates on the licenses? Perhaps someone else can carry the patch to completion? |
- add new backing store type that contains struct_size and pixel format - add new public pixel format enum with the common pixel formats supported by skia
improve formatting
- move getSkColorType, getSkColorInfo to pixel_formats.cc - make them return optional so we can indicate an error - don't use abort there
cf8b1dd to
293ad69
Compare
|
Gold has detected about 12 new digest(s) on patchset 16. |
|
@chinmaygarde licenses should be fixed now. though don't know what that gold bot comment is about |
|
|
Validations Fail. |
…re rendering backend (flutter/engine#26995)
This PR adds the following things to the embedder API:
FlutterSoftwareBackingStore2, which is basically the same asFlutterSoftwareBackingStorebut with astruct_sizeandpixel_formatfieldFlutterSoftwarePixelFormatenum, containing a bunch of skia supported pixel formats, likekGray8,kRGBA8888,kRGB565fixes flutter/flutter#81332
One things I'm not sure of: Why is
kN32_SkColorTypeeven necessary? It just chooses BGRA8888 or RGBA8888 depending on OS (and CPU endianess I believe), could we just leave it away in this case?Pre-launch Checklist
writing and running engine tests.
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.