diff options
| author | Leon Scroggins III <scroggo@google.com> | 2017-11-17 08:07:32 -0500 |
|---|---|---|
| committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-11-17 13:28:45 +0000 |
| commit | 03588412c89899fba09893e1812866f0069fc6f6 (patch) | |
| tree | a333b3ed734de13f9ff8d31412a7d1bf3d0e964b /tools/gpu/gl/command_buffer/GLTestContext_command_buffer.cpp | |
| parent | 57e0828fade9270f1fd3abf32f4e27b108c4bc1a (diff) | |
Fix webp bug compositing alpha frames on opaque (better fix)
The old code made the wrong assumptions about premultiplication.
There are three relevant steps here for decoding a webp frame:
1 tell libwebp to decode
2 colorXform the result (sometimes)
3 blend with the prior frame (sometimes)
Rearrange the code to premultiply at the blend step, in a linear space.
If the client wants unpremul, the blend step will unpremul after.
If there is no blending, the colorXform (if any) will premultiply.
If only step 1 is necessary, let libwebp premultiply.
This fixes an animated image that has an opaque frame 0 followed by a
frame with alpha that blends with it.
Add the test image that failed (https://mathiasbynens.be/demo/animated-webp)
The prior fix is in 42bae8faa4b9b6a3341b15c6ac7c6b466e95625c. It did
not properly handle the colorXform when there was no blending step.
Change-Id: I2b9d265ba162eaf7e55a106c8f79341826cee0d3
Reviewed-on: https://skia-review.googlesource.com/72281
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Diffstat (limited to 'tools/gpu/gl/command_buffer/GLTestContext_command_buffer.cpp')
0 files changed, 0 insertions, 0 deletions
