New issue
Advanced search Search tips

Issue 845931 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: May 2018
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

APNGs with a ColorProfileTransform may not blend properly

Project Member Reported by scroggo@chromium.org, May 23 2018

Issue description

See [1]. In this case, we intend to blend src_ptr onto dst_row, either premultiplying with ImageFrame::BlendRGBAPremultiplied or not with ImageFrame::BlendRGBARaw.

But above [2], if there is a ColorProfileTransform, src_ptr is set to point to dst_row, after doing color conversion and copying into dst_row. Meaning that we skipped actual blending, and then attempt to blend the src onto itself.

This looks to have been a problem since APNG code was added. We've likely never noticed because the following combination of features would be necessary:

- APNG image with a frame that blends onto a prior frame and has alpha
- a color profile that requires conversion

[1] https://chromium.googlesource.com/chromium/src/+/b7a3fd5d28f223b18d5d8660aa57ce190678b921/third_party/blink/renderer/platform/image-decoders/png/png_image_decoder.cc#625
[2] https://chromium.googlesource.com/chromium/src/+/b7a3fd5d28f223b18d5d8660aa57ce190678b921/third_party/blink/renderer/platform/image-decoders/png/png_image_decoder.cc#595

brianosman@ noticed this and said he would fix it up as he changed some code in this area.
 
Project Member

Comment 1 by bugdroid1@chromium.org, May 24 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/028cbb7d3a185a8564eda3a85dee31e0906886e3

commit 028cbb7d3a185a8564eda3a85dee31e0906886e3
Author: Brian Osman <brianosman@google.com>
Date: Thu May 24 15:04:22 2018

Color transform APNG frames that blend over previous to a temp buffer

I have an APNG with an embedded complex (A2B) profile that previously
rendered as garbage, and now renders correctly.

Bug:  chromium:845931 
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: Ia592323db44fba12b45e158fd6b1f3025ed17953
Reviewed-on: https://chromium-review.googlesource.com/1069614
Reviewed-by: Leon Scroggins <scroggo@chromium.org>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Brian Osman <brianosman@google.com>
Cr-Commit-Position: refs/heads/master@{#561504}
[add] https://crrev.com/028cbb7d3a185a8564eda3a85dee31e0906886e3/third_party/WebKit/LayoutTests/images/resources/apng19-ref.png
[add] https://crrev.com/028cbb7d3a185a8564eda3a85dee31e0906886e3/third_party/WebKit/LayoutTests/images/resources/apng19.png
[modify] https://crrev.com/028cbb7d3a185a8564eda3a85dee31e0906886e3/third_party/blink/renderer/platform/graphics/bitmap_image_test.cc
[modify] https://crrev.com/028cbb7d3a185a8564eda3a85dee31e0906886e3/third_party/blink/renderer/platform/image-decoders/png/png_image_decoder.cc
[modify] https://crrev.com/028cbb7d3a185a8564eda3a85dee31e0906886e3/third_party/blink/renderer/platform/image-decoders/png/png_image_decoder.h

Status: Fixed (was: Assigned)

Sign in to add a comment