forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement ImageBitmap options premultiplyAlpha for ImageBitmap
This CL implements the option for the case of createImageBitmap(ImageBitmap). We need to take care of a special case where the input ImageBitmap is already un-premultiplied, where we do not need to decode the input ImageBitmap, and instead just directly using its image data to create a new ImageBitmap. Also, we change the code in the case where the cropRect doesn't intesect the image region at all. In this case, it was returning a premul transparent black image no matter the premultiplyAlpha is true or false. In this CL, we change it to return a unpremul transparent image when the premultiplyAlpha is set to false. This CL doesn't include a layout test, because the case of ImageBitmap is already covered in canvas-createImageBitmap-drawImage-with-options.html, as long as this code change doesn't break the test, it should be fine. BUG=589124 Review URL: https://codereview.chromium.org/1686993002 Cr-Commit-Position: refs/heads/master@{#377044}
- Loading branch information
Showing
2 changed files
with
24 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters