DescriptionAlways return ImageShader, even from SkShader::MakeBitmapShader
Lessons learned
1. ImageShader (correctly) always compresses (typically via PNG) during serialization. This has the surprise results of
- if the image was marked opaque, but has some non-opaque pixels (i.e. bug in blitter or caller), then compressing may "fix" those pixels, making the deserialized version draw differently. bug filed.
- 565 compressess/decompresses to 8888 (at least on Mac), which draws differently (esp. under some filters). bug filed.
2. BitmapShader did not enforce a copy for mutable bitmaps, but ImageShader does (since it creates an Image). Thus the former would see subsequent changes to the pixels after shader creation, while the latter does not, hence the change to the BlitRow test to avoid this modify-after-create pattern. I sure hope this prev. behavior was a bug/undefined-behavior, since this CL changes that.
BUG=skia:5595
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2195893002
Committed: https://skia.googlesource.com/skia/+/320a40d7733979703bdf675c31108255e011e34e
Patch Set 1 #Patch Set 2 : don't use bitmapprocshader #Patch Set 3 : rm bitmapprocshader #Patch Set 4 : update #Patch Set 5 : adsf #Patch Set 6 : rebase #Patch Set 7 : update shadertest #Patch Set 8 : make mesh/shader after we colorize the bitmap #Patch Set 9 : update serialize-8888 ignore list: skbug.com/5595 #
Total comments: 3
Messages
Total messages: 36 (27 generated)
|