-
Notifications
You must be signed in to change notification settings - Fork 6k
[impeller] Use mapping based 'Texture::SetContents' in image decoder and text render context #33477
Conversation
|
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat (don't just cc him here, he won't see it! He's on Discord!). If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
chinmaygarde
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.
I don't think we should land this. Depending on the backend, a copy may or may not be necessary. And, if a copy is not necessary in the SetContents call but the API only takes mappings, then a caller who cannot transfer ownership of the data into the backend will have no choice but to perform a copy speculatively. If there are both APIs, the caller must prefer mapping but can provide raw pointers. And some backends will be able to avoid copies in those cases as well.
76bf2e8 to
b976e3f
Compare
I got it, I changed this PR, replace raw pointers with mappings in some places to avoid unnecessary copies, WDYT? |
b976e3f to
456ad78
Compare
chinmaygarde
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.
This version of the patch makes sense and we should go ahead. I guess the commit message is misleading now though. Can you reword the commit to say something to the effect of "use mapping based SetContexts in image decoder and text render context"?
| return nullptr; | ||
| } | ||
|
|
||
| const auto& pixmap = bitmap.pixmap(); |
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.
There is a missing null check here now.
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.
Done. It looks like the bitmap here must not be null, so I added a FML_DCHECK here.
…and text render context
456ad78 to
79c35f3
Compare
Done |
…decoder and text render context (flutter/engine#33477)
…decoder and text render context (flutter/engine#33477)
Fixes the textures portion of flutter/flutter#102262.
cc @chinmaygarde @dnfield
Pre-launch Checklist
writing and running engine tests.
///).