DescriptionTemplatize SkPMFloat to support both 1 and 255 biases.
We used to use a 255 bias. It was fast to convert up and down, but weird to
multiply (must remember to /255) and is just generally weird to think about.
We now use a 1 bias. That's a multiply slower on each side of SkPMColor
conversion, but makes future multiplies cheaper, and is easier to think about.
I think there a places where both are valuable, particularly in code where
we can either isolate the div 255 weirdness to one or two spots, or in code
that involves no component multiplication at all. Most code stays <1>.
PS2 is about a 15% speedup for the "colorcube" bench on my x86 desktop,
and about a 10% speedup on my ARMv7 Nexus 7 Mk.2.
The <255> roundtrip bench runs about 20% faster than the <1> bench on my
desktop, and about 30% faster on that N7.
No GM or SKP pixels change on my desktop.
BUG=skia:4117
Patch Set 1 #Patch Set 2 : use 255 #Patch Set 3 : misc #Patch Set 4 : pump the loops for Android #
Total comments: 2
Messages
Total messages: 13 (4 generated)
|