Refactor createImageBitmap to stop using Unpremul |
|||
Issue descriptionSkia is deprecation the use of Unpremultiplied alpha with SkImage. Soon, the Unpremultiplied alpha type will only be supported by readPixels/writePixels. The conversion performed by createImageBitmap therefore need to be re-written. The plan is to use a new API SkImage::makeScaled that will take care of resizin, format conversion and colorspace conversion. https://skia-review.googlesource.com/c/7222/ Cropping can be performed using SkImage::makeSubset The notion of whether pixel values are unpremultipled will have to be stored outside of SkImage (a member of ImageBitmap). SkImage will still be able to store Unpremultiplied pixel values, but it will not do the right thing for drawing to an SkCanvas, so it will be necessary to bootstrap a premul conversion to support that use case.
,
Jan 20 2017
,
Jan 20 2017
To test your CL with the new skia behavior, you can apply this patch locally in third_party/skia: https://skia-review.googlesource.com/c/7304/
,
Jan 20 2017
To unblock landing this change in skia, I think all we have to do is bootstrap the premultiplication in the case where an unpremultiplied ImageBitmap is used as a CanvasImageSource. I think that is mostly just a change to ImageBitmap::getSourceImageForCanvas
,
Jan 24 2017
,
Nov 27 2017
|
|||
►
Sign in to add a comment |
|||
Comment 1 by junov@chromium.org
, Jan 20 2017Components: Blink>Canvas