Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upsupport color masking of images #2969
Conversation
webrender/src/batch.rs, line 726 at r1 (raw file):
How did this used to work previously and why do we need to change it now on types other than images? |
|
This basically looks good, but I'm somewhat confused about the shader color mode change on some of the batching code. If I'm reading it correctly it looks like it was wrong previously, and is now right? But if so, how come we don't have test failures from those? I feel like I'm mis-reading part of the patch :) We'll also need a try run before merging. |
|
It worked previously because we always passed in the premultiplied color white to the shader. The old shader color mode only accessed color.a, which if you squint at it, behaves exactly the same as the premultiplied color white, but would break if any other color was passed. So I had to change the color mode to access the RGB components of the color as well, not just the alpha component.
|
|
@lsalzman Ah that makes sense - so it was broken, but not in any user-visible way previously |
|
r=me once we have a try result posted here. |
|
Try run: https://treeherder.mozilla.org/#/jobs?repo=try&revision=f0115f48d25d10d55480f624368ce02e6d53113f
|
|
That looks like a lot of orange on the try - but it's also not the try configuration I normally use, so maybe those are expected. I leave it to your wise judgment :) @bors-servo delegate+ |
|
|
|
@bors-servo r+ |
|
|
support color masking of images This is to help support the necessary fixes for Gecko bug https://bugzilla.mozilla.org/show_bug.cgi?id=1479196 Tofu glyphs will be drawn out of an atlas, and to avoid the need to have to generate a new atlas for every single color or opacity combination, this just allows push_image to specify a color which can then be used for masking or opacity. Most of the plumbing is already there, just some parameters need to be added to support this. <!-- 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/2969) <!-- Reviewable:end -->
|
|
lsalzman commentedAug 13, 2018
•
edited by larsbergstrom
This is to help support the necessary fixes for Gecko bug https://bugzilla.mozilla.org/show_bug.cgi?id=1479196
Tofu glyphs will be drawn out of an atlas, and to avoid the need to have to generate a new atlas for every single color or opacity combination, this just allows push_image to specify a color which can then be used for masking or opacity.
Most of the plumbing is already there, just some parameters need to be added to support this.
This change is