New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 683154 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Jan 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 1
Type: Bug

Blocking:
issue 634542



Sign in to add a comment

Refactor createImageBitmap to stop using Unpremul

Project Member Reported by junov@chromium.org, Jan 20 2017

Issue description

Skia 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.

 

Comment 1 by junov@chromium.org, Jan 20 2017

Cc: reed@chromium.org
Components: Blink>Canvas

Comment 2 by junov@chromium.org, Jan 20 2017

Labels: -Pri-3 Pri-1

Comment 3 by junov@chromium.org, 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/

Comment 4 by junov@chromium.org, 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
Status: Fixed (was: Assigned)
CL landed @ https://codereview.chromium.org/2641393002/.
Blocking: 634542

Sign in to add a comment