Commit Graph

3 Commits

Author SHA1 Message Date
Mike Reed
627778d5ba isABitmap is deprecated, use isAImage
BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2748

Change-Id: I7006a3231ff0e9e39b187deae550364bc97f49d6
Reviewed-on: https://skia-review.googlesource.com/2748
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2016-09-28 21:42:04 +00:00
reed
320a40d773 Always 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

Review-Url: https://codereview.chromium.org/2195893002
2016-08-02 06:12:06 -07:00
reed
f1ac18229c implement isABitmap for imageshader, return localmatrix for bitmap's impl
For imageshader, I only return true if the image is explicitly raster-backed. I do not return true for texture, nor for generator (i.e. lazy/picture) backed. Is that ok?

BUG=skia:5592
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2197323002

Review-Url: https://codereview.chromium.org/2197323002
2016-08-01 11:24:14 -07:00