Webrender: Change clip masks to multiply alpha instead of using min()

Created on 10 Oct 2017  路  6Comments  路  Source: servo/webrender

We have this sort of code in a bunch of places:

  alpha = min(alpha, do_clip());

I'm surprised by this. Isn't applying a mask usually done by multiplying the alphas? If you use min(), aren't you going to lose some of the anti-aliasing of the shape if you apply the clip to something that's, say, only 10% opaque?

easy enhancement

Most helpful comment

All 6 comments

I don't think there's a specific reason. @kvark ? What does Gecko / Skia currently do - just multiply the alphas together or something more complicated?

IIRC, we had a few cases in mind when picking min but we should definitely just go with Gecko/Skia instead of it's different.

@jrmuizel says: "Skia uses a multiplication. Minimums aren't ever used."

Sounds good - updated the issue title to reflect what we want to do.

Taking.

Was this page helpful?
0 / 5 - 0 ratings