The current implementation of skia::ImageOperations::Resize() doesn't seem to support unpremultipled alpha correctly. In https://crbug.com/829517 a webcursor image with transparency becomes fully opaque after it's resized. If I convert the SkBitmap to premultiplied alpha before calling ImageOperations::Resize() then it works as expected.
bungeman@ suggested checking if SkImage::scalePixels() would handle unpremultiplied alpha correctly and it seems to. I'm not sure if ImageOperations::Resize() could be rewritten to use SkImage::scalePixels() instead of BGRAConvolve2D()?
There is also a different enum used to select the resize quality/algorithm, ResizeMethod vs SkFilterQuality, along with general performance concerns. ImageOperations::Resize() is pretty widely used in Chrome.
Comment 1 by bugdroid1@chromium.org
, Jan 16 (6 days ago)