Skip to content
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

fast-shadows of apple emoji aren't colored #1959

Closed
Gankra opened this issue Oct 28, 2017 · 3 comments
Closed

fast-shadows of apple emoji aren't colored #1959

Gankra opened this issue Oct 28, 2017 · 3 comments

Comments

@Gankra
Copy link
Contributor

@Gankra Gankra commented Oct 28, 2017

Now that we correctly prevent emoji from being effected by colors, the colors we try to apply to them as fast shadows get ignored.

test case:

<span style="text-shadow: 2px 2px 0px red">
    Shadow
    <span style="color: blue">🎉</span>
    <span style="color: rgba(0,0,0,0.7)">🎉</span>
    <span style="color: rgba(0,0,255,0.4)">🎉</span>
    <span style="color: transparent">🎉</span>
</span>

screen shot (with blurred version for reference)

screen shot 2017-10-27 at 11 29 31 pm

@Gankra
Copy link
Contributor Author

@Gankra Gankra commented Oct 28, 2017

live version is near the top of https://gankro.github.io/blah/webtests/text.html

@lsalzman
Copy link
Contributor

@lsalzman lsalzman commented Dec 13, 2017

bors-servo added a commit that referenced this issue Dec 18, 2017
ignore glyph color data when doing fast shadows

This addresses issues #1959 and #1917. We need to swizzle away the glyph's color data for emoji fast shadows. Rather than introducing more shaders/ifdefs to deal with this, I added a reasonably cheap programmable swizzle in the shader to control this. A side benefit of this is that we also get rid of the need for the separate shader with the subpixel-with-bg-color blending passes as they now just use the swizzle mechanism.

In the process of this I noticed that the idea of directly stuffing the shadow color into the font on the cloned text run primitive for the fast shadow has a downside: it will usually cause the font to hash differently and so make duplicate entries in the glyph cache. So I added a shadow_color field back onto TextRunPrimitiveCpu, serving dual purposes that 1) lets the font itself hash the same while also 2) indicating down to the batching code that we have to use shadows in the first place (and thus need to enable the swizzle).

<!-- 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/2223)
<!-- Reviewable:end -->
@glennw
Copy link
Member

@glennw glennw commented Dec 19, 2017

Fixed in #2223.

@glennw glennw closed this Dec 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.