-
Notifications
You must be signed in to change notification settings - Fork 279
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
Allow updating images that are not raw buffers #1004
Conversation
This PR is written on top of PR #1003, so the latter will show up in the diff until it lands. r? @glennw |
@nical Could you rebase this on master to remove that extra commit? |
The extra commit is the followup nit fix from PR #1003, it is very small and somewhat close to what's happening in this PR so I put it here. Do you want me to extract it in a separate pull request ? How do you feel about removing the assertion in resource_cache that prevents from updating an external image? I'd be happy to do it in this PR. |
@nical |
I clarified things a bit by asserting that the format and size don't change, and I fixed the way tiling is passed: if the size was larger than the maximum texture size we used to force the tile size at 512 instead of using the tiling parameter, we also used to loose the tiling information in update_image. r? @glennw |
// Tiled external images are not implemented. | ||
&ImageData::ExternalHandle(_) => false, | ||
&ImageData::ExternalBuffer(_) => false, | ||
_ => { descriptor.width > limit || descriptor.height > limit } |
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.
As a follow up, could we explicitly list all the variations here rather than _ ? I like the safety of a compiler bug when new enum variants are introduced.
@bors-servo r+ |
📌 Commit 086f912 has been approved by |
@bors-servo r+ |
📌 Commit 80b500a has been approved by |
Allow updating images that are not raw buffers ```update_image``` currently takes a vector of bytes and the implementation expects this vector to be regular image data. We need to be able to update blob images as well. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/webrender/1004) <!-- Reviewable:end -->
☀️ Test successful - status-travis |
Tile external buffer images when they exceed the maximum texture size. Fixes issue #1027, and addresses a review comment from PR #1004 about explicitly enumerating all variants instead of using ```_ => { ... }``` in this match expression. r? @kvark <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/webrender/1036) <!-- Reviewable:end -->
update_image
currently takes a vector of bytes and the implementation expects this vector to be regular image data. We need to be able to update blob images as well.This change is