DescriptionConvert Color32 code to perfect blend.
Before we commit to blend_256_round_alt, let's make sure blend_perfect is
really slower in practice (i.e. regresses on perf.skia.org).
blend_perfect is really the most desirable algorithm if we can afford it. Not
only is it correct, but it's easy to think about and break into correct pieces:
for instance, its div255() doesn't require any coordination with the multiply.
This looks like a 30% hit according to microbenches. That said, microbenches
said my previous change would be a 20-25% perf improvement, but it didn't end
up showing a significant effect at a high level.
As for correctness, I see a bunch of off-by-1 compared to blend_256_round_alt
(exactly what we'd expect), and one off-by-3 in a GM that looks like it has a
bunch of overdraw.
BUG=skia:
Committed: https://skia.googlesource.com/skia/+/61221e7f87a99765b0e034020e06bb018e2a08c2
Patch Set 1 #Patch Set 2 : fix portable rounding #Patch Set 3 : ugh, really fix #Patch Set 4 : fix portable math #Patch Set 5 : back to vaddhn #Patch Set 6 : revert back to make more similar #
Messages
Total messages: 21 (6 generated)
|