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 uptext antialiasing issue with opacity < 1 #166
Comments
|
$10 says it's one of those annoying |
|
Yep, this is occurring on Linux as well, so probably an issue like @pcwalton mentioned above rather than an issue with the platform font rasterizing. |
|
@pcwalton Changing https://github.com/glennw/webrender/blob/master/src/renderer.rs#L988 from 0,0,0,0 -> 1,1,1,0 fixes this issue. However, it introduces artifacts into the box shadows in the ref tests. I think this is a correct fix - any thoughts on what effect that would have on box shadow and if it can be worked around? I'll investigate further - just posting this in case you know straight away what the issue might be? |
|
Interestingly the blur on text_shadow_blur_a.html remains the same with that change (which is a text-shadow), but the blur on text_shadow_blur_ref.html (which is a box shadow) is what starts to show artifacts. |
|
@glennw Hmm, but I think our blend mode is wrong if we're relying on (1,1,1,0) instead of (0,0,0,0). |
|
I'm not sure what blend mode you would use. A traditional alpha blend is: Result.rgb = Dest.rgb*(1-Source.alpha) + Source.rgb * Source.alpha. Pre-multipled alpha blend is: Result.rgb = Dest.rgb*(1-Source.alpha) + Source.rgb. In both cases, the destination color is going to be modulated by the inverse source alpha, so you will get black fringing if drawing text with alpha on a black FBO, which is the case for text with opacity at the moment. Or is there another alternative? |
|
Hmmm, perhaps we could make of separate blend func to store the alpha but just use the color. I'll try that. |
|
I have a fix for this, but it exposes an unrelated issue in the texture cache - working on fixing that now. |
It was disabled as a fix for servo#166, but that caused regressions on pages that depend on blending. The issues related to the blur on box shadows discussed in that issue seem to be resolved now, so the clear-color solution works fine. Addresses browserhtml/browserhtml#1068.
I guess it's an antialiasing issue. The top text here has a dark outline. That makes text opacity animations very ugly.