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

Issue 722072 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: May 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug



Sign in to add a comment

APNG rendering appears broken for some files that other png decoders and firefox work with - might be handling of dispose_op=2 (APNG_DISPOSE_OP_PREVIOUS) or blend_op=1 (APNG_BLEND_OP_OVER) ?

Reported by james.ma...@gmail.com, May 14 2017

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.47 Safari/537.36

Example URL:
http://e.thumbs.redditmedia.com/LB4gDpfKRE0rGGbp.png

Steps to reproduce the problem:
1. open one of the sample images that shows the problem in a new tab

http://e.thumbs.redditmedia.com/LB4gDpfKRE0rGGbp.png

http://a.thumbs.redditmedia.com/BwLS9sniUFfgHT0CEXphTtIEphR274t4F1bvikqOt54.png

http://a.thumbs.redditmedia.com/YqlJ7XDSWT1uoEoFXWjvBZ8dsJSR_EjE4hSbQ7IIHm0.png

http://c.thumbs.redditmedia.com/xXzBeN2q35TZCrm8.png

http://b.thumbs.redditmedia.com/4fZyUyU5-SIQAmnS.png

http://f.thumbs.redditmedia.com/-PMOqZSeBWxYGn7w.png

http://b.thumbs.redditmedia.com/gwQ2obaz7eDVDPH9.png

What is the expected behavior?
should render like in other browsers without chunks of some frames missing

What went wrong?
parts of the rendered frames are missing.  Trying to ffprobe -v debug on the png files shows dispose_op=2 and blend_op=1 are being used across them, so one/both of them might be a cause, but that's just a guess.

Did this work before? N/A 

Is it a problem with Flash or HTML5? HTML5

Does this work in other browsers? Yes

Chrome version: 59.0.3071.47  Channel: beta
OS Version: 10.0
Flash Version: 

Contents of chrome://gpu: 
Graphics Feature Status
Canvas: Hardware accelerated
Flash: Hardware accelerated
Flash Stage3D: Hardware accelerated
Flash Stage3D Baseline profile: Hardware accelerated
Compositing: Hardware accelerated
Multiple Raster Threads: Enabled
Native GpuMemoryBuffers: Software only. Hardware acceleration disabled
Rasterization: Hardware accelerated
Video Decode: Hardware accelerated
Video Encode: Hardware accelerated
VPx Video Decode: Software only, hardware acceleration unavailable
WebGL: Hardware accelerated
WebGL2: Hardware accelerated
Driver Bug Workarounds
clear_uniforms_before_first_program_use
decode_encode_srgb_for_generatemipmap
disable_discard_framebuffer
disable_framebuffer_cmaa
exit_on_context_lost
force_cube_complete
msaa_is_slow
scalarize_vec_and_mat_constructor_args
texsubimage_faster_than_teximage
Problems Detected
Accelerated VPx decoding is hanging on some videos.: 654111
Disabled Features: accelerated_vpx_decode
Some drivers are unable to reset the D3D device in the GPU process sandbox
Applied Workarounds: exit_on_context_lost
TexSubImage is faster for full uploads on ANGLE
Applied Workarounds: texsubimage_faster_than_teximage
Clear uniforms before first program use on all platforms: 124764, 349137
Applied Workarounds: clear_uniforms_before_first_program_use
Always rewrite vec/mat constructors to be consistent: 398694
Applied Workarounds: scalarize_vec_and_mat_constructor_args
ANGLE crash on glReadPixels from incomplete cube map texture: 518889
Applied Workarounds: force_cube_complete
On Intel GPUs MSAA performance is not acceptable for GPU rasterization: 527565
Applied Workarounds: msaa_is_slow
Framebuffer discarding can hurt performance on non-tilers: 570897
Applied Workarounds: disable_discard_framebuffer
Limited enabling of Chromium GL_INTEL_framebuffer_CMAA: 535198
Applied Workarounds: disable_framebuffer_cmaa
Disable KHR_blend_equation_advanced until cc shaders are updated: 661715
Decode and Encode before generateMipmap for srgb format textures on Windows: 634519
Applied Workarounds: decode_encode_srgb_for_generatemipmap
Native GpuMemoryBuffers have been disabled, either via about:flags or command line.
Disabled Features: native_gpu_memory_buffers
Version Information
Data exported	5/13/2017, 7:39:54 PM
Chrome version	Chrome/59.0.3071.47
Operating system	Windows NT 10.0.15063
Software rendering list version	13.4
Driver bug list version	10.5
ANGLE commit id	a9042d3c1952
2D graphics backend	Skia/59 3027fda3cfe425b6fae53ef59923d554402c1414
Command Line Args	Files (x86)\Google\Chrome\Application\chrome.exe" --flag-switches-begin --flag-switches-end
Driver Information
Initialization time	159
In-process GPU	false
Passthrough Command Decoder	false
Supports overlays	false
Sandboxed	false
GPU0	VENDOR = 0x8086, DEVICE= 0x0166 *ACTIVE*
GPU1	VENDOR = 0x10de, DEVICE= 0x0dfc
Optimus	false
Optimus	false
AMD switchable	false
Desktop compositing	Aero Glass
Diagonal Monitor Size of \\.\DISPLAY4	21.5"
Driver vendor	Intel Corporation
Driver version	10.18.10.4425
Driver date	4-4-2016
Pixel shader version	5.0
Vertex shader version	5.0
Max. MSAA samples	8
Machine model name	
Machine model version	
GL_VENDOR	Google Inc.
GL_RENDERER	ANGLE (Intel(R) HD Graphics 4000 Direct3D11 vs_5_0 ps_5_0)
GL_VERSION	OpenGL ES 3.0 (ANGLE 2.1.0.a9042d3c1952)
GL_EXTENSIONS	GL_ANGLE_client_arrays GL_ANGLE_depth_texture GL_ANGLE_framebuffer_blit GL_ANGLE_framebuffer_multisample GL_ANGLE_instanced_arrays GL_ANGLE_lossy_etc_decode GL_ANGLE_pack_reverse_row_order GL_ANGLE_request_extension GL_ANGLE_robust_client_memory GL_ANGLE_robust_resource_initialization GL_ANGLE_texture_compression_dxt3 GL_ANGLE_texture_compression_dxt5 GL_ANGLE_texture_usage GL_ANGLE_translated_shader_source GL_CHROMIUM_bind_generates_resource GL_CHROMIUM_bind_uniform_location GL_CHROMIUM_copy_compressed_texture GL_CHROMIUM_copy_texture GL_CHROMIUM_sync_query GL_EXT_blend_minmax GL_EXT_color_buffer_float GL_EXT_color_buffer_half_float GL_EXT_debug_marker GL_EXT_discard_framebuffer GL_EXT_disjoint_timer_query GL_EXT_draw_buffers GL_EXT_frag_depth GL_EXT_map_buffer_range GL_EXT_occlusion_query_boolean GL_EXT_read_format_bgra GL_EXT_robustness GL_EXT_sRGB GL_EXT_shader_texture_lod GL_EXT_texture_compression_dxt1 GL_EXT_texture_compression_s3tc_srgb GL_EXT_texture_filter_anisotropic GL_EXT_texture_format_BGRA8888 GL_EXT_texture_norm16 GL_EXT_texture_rg GL_EXT_texture_storage GL_EXT_unpack_subimage GL_KHR_debug GL_NV_EGL_stream_consumer_external GL_NV_fence GL_NV_pack_subimage GL_NV_pixel_buffer_object GL_OES_EGL_image GL_OES_EGL_image_external GL_OES_EGL_image_external_essl3 GL_OES_compressed_ETC1_RGB8_texture GL_OES_depth32 GL_OES_element_index_uint GL_OES_get_program_binary GL_OES_mapbuffer GL_OES_packed_depth_stencil GL_OES_rgb8_rgba8 GL_OES_standard_derivatives GL_OES_texture_float GL_OES_texture_float_linear GL_OES_texture_half_float GL_OES_texture_half_float_linear GL_OES_texture_npot GL_OES_vertex_array_object
Disabled Extensions	GL_KHR_blend_equation_advanced GL_KHR_blend_equation_advanced_coherent
Window system binding vendor	Google Inc. (adapter LUID: 000000000001029b)
Window system binding version	1.4 (ANGLE 2.1.0.a9042d3c1952)
Window system binding extensions	EGL_EXT_create_context_robustness EGL_ANGLE_d3d_share_handle_client_buffer EGL_ANGLE_d3d_texture_client_buffer EGL_ANGLE_surface_d3d_texture_2d_share_handle EGL_ANGLE_query_surface_pointer EGL_ANGLE_window_fixed_size EGL_ANGLE_keyed_mutex EGL_ANGLE_surface_orientation EGL_ANGLE_direct_composition EGL_NV_post_sub_buffer EGL_KHR_create_context EGL_EXT_device_query EGL_KHR_image EGL_KHR_image_base EGL_KHR_gl_texture_2D_image EGL_KHR_gl_texture_cubemap_image EGL_KHR_gl_renderbuffer_image EGL_KHR_get_all_proc_addresses EGL_KHR_stream EGL_KHR_stream_consumer_gltexture EGL_NV_stream_consumer_gltexture_yuv EGL_ANGLE_flexible_surface_compatibility EGL_ANGLE_stream_producer_d3d_texture_nv12 EGL_ANGLE_create_context_webgl_compatibility EGL_CHROMIUM_create_context_bind_generates_resource EGL_CHROMIUM_sync_control EGL_EXT_pixel_format_float EGL_ANGLE_display_texture_share_group EGL_ANGLE_create_context_client_arrays EGL_ANGLE_create_context_robust_resource_initialization
Direct rendering	Yes
Reset notification strategy	0x8252
GPU process crash count	0
Compositor Information
Tile Update Mode	One-copy
Partial Raster	Enabled
GpuMemoryBuffers Status
ATC	Software only
ATCIA	Software only
DXT1	Software only
DXT5	Software only
ETC1	Software only
R_8	Software only
RG_88	Software only
BGR_565	Software only
RGBA_4444	Software only
RGBX_8888	Software only
RGBA_8888	Software only
BGRX_8888	Software only
BGRA_8888	Software only
RGBA_F16	Software only
YVU_420	Software only
YUV_420_BIPLANAR	Software only
UYVY_422	Software only
Diagnostics
0
b3DAccelerationEnabled	true
b3DAccelerationExists	true
bAGPEnabled	true
bAGPExistenceValid	true
bAGPExists	true
bCanRenderWindow	true
bDDAccelerationEnabled	true
bDriverBeta	false
bDriverDebug	false
bDriverSigned	false
bDriverSignedValid	false
bNoHardware	false
dwBpp	32
dwDDIVersion	11
dwHeight	1080
dwRefreshRate	60
dwWHQLLevel	0
dwWidth	1920
iAdapter	0
lDriverSize	11051456
lMiniVddSize	0
szAGPStatusEnglish	Enabled
szAGPStatusLocalized	Enabled
szChipType	Intel(R) HD Graphics Family
szD3DStatusEnglish	Enabled
szD3DStatusLocalized	Enabled
szDACType	Internal
szDDIVersionEnglish	11.2
szDDIVersionLocalized	11.2
szDDStatusEnglish	Enabled
szDDStatusLocalized	Enabled
szDXVAHDEnglish	Supported
szDXVAModes	ModeMPEG2_A ModeMPEG2_C ModeWMV9_C ModeVC1_C
szDescription	Intel(R) HD Graphics 4000
szDeviceId	0x0166
szDeviceIdentifier	{D7B78E66-4226-11CF-D162-3F25B4C2C735}
szDeviceName	\\.\DISPLAY1
szDisplayMemoryEnglish	1792 MB
szDisplayMemoryLocalized	1792 MB
szDisplayModeEnglish	1920 x 1080 (32 bit) (60Hz)
szDisplayModeLocalized	1920 x 1080 (32 bit) (60Hz)
szDriverAssemblyVersion	10.18.10.4425
szDriverAttributes	Final Retail
szDriverDateEnglish	4/3/2016 8:00:00 PM
szDriverDateLocalized	4/3/2016 20:00:00
szDriverLanguageEnglish	English
szDriverLanguageLocalized	English
szDriverModelEnglish	WDDM 1.3
szDriverModelLocalized	WDDM 1.3
szDriverName	igdumdim64.dll,igd10iumd64.dll,igd10iumd64.dll
szDriverNodeStrongName	oem64.inf:5f63e5341859ec8c:iIVBM_w10:10.18.10.4425:pci\ven_8086&dev_0166&subsys_05351028
szDriverSignDate	Unknown
szDriverVersion	10.18.0010.4425
szKeyDeviceID	Enum\PCI\VEN_8086&DEV_0166&SUBSYS_05351028&REV_09
szKeyDeviceKey	\Registry\Machine\System\CurrentControlSet\Control\Video\{FBD53C57-B020-4179-A1B7-465E882B61AB}\0000
szManufacturer	Intel Corporation
szMiniVdd	unknown
szMiniVddDateEnglish	Unknown
szMiniVddDateLocalized	unknown
szMonitorMaxRes	Unknown
szMonitorName	Unknown
szNotesEnglish	No problems found.
szNotesLocalized	No problems found.
szOverlayEnglish	Supported
szRankOfInstalledDriver	00D10001
szRegHelpText	Unknown
szRevision	Unknown
szRevisionId	0x0009
szSubSysId	0x05351028
szTestResultD3D7English	Not run
szTestResultD3D7Localized	Not run
szTestResultD3D8English	Not run
szTestResultD3D8Localized	Not run
szTestResultD3D9English	Not run
szTestResultD3D9Localized	Not run
szTestResultDDEnglish	Not run
szTestResultDDLocalized	Not run
szVdd	unknown
szVendorId	0x8086
1
b3DAccelerationEnabled	true
b3DAccelerationExists	true
bAGPEnabled	true
bAGPExistenceValid	true
bAGPExists	true
bCanRenderWindow	true
bDDAccelerationEnabled	true
bDriverBeta	false
bDriverDebug	false
bDriverSigned	false
bDriverSignedValid	false
bNoHardware	false
dwBpp	32
dwDDIVersion	11
dwHeight	1080
dwRefreshRate	60
dwWHQLLevel	0
dwWidth	1920
iAdapter	1
lDriverSize	17753968
lMiniVddSize	0
szAGPStatusEnglish	Enabled
szAGPStatusLocalized	Enabled
szChipType	NVS 5200M
szD3DStatusEnglish	Enabled
szD3DStatusLocalized	Enabled
szDACType	Integrated RAMDAC
szDDIVersionEnglish	11.4
szDDIVersionLocalized	11.4
szDDStatusEnglish	Enabled
szDDStatusLocalized	Enabled
szDXVAHDEnglish	Supported
szDXVAModes	ModeMPEG2_A ModeMPEG2_C ModeVC1_C ModeWMV9_C
szDescription	NVIDIA NVS 5200M
szDeviceId	0x0DFC
szDeviceIdentifier	{D7B71E3E-4EBC-11CF-7E6E-38351BC2D835}
szDeviceName	\\.\DISPLAY3
szDisplayMemoryEnglish	4095 MB
szDisplayMemoryLocalized	4095 MB
szDisplayModeEnglish	1920 x 1080 (32 bit) (60Hz)
szDisplayModeLocalized	1920 x 1080 (32 bit) (60Hz)
szDriverAssemblyVersion	21.21.13.7654
szDriverAttributes	Final Retail
szDriverDateEnglish	12/28/2016 8:00:00 PM
szDriverDateLocalized	12/28/2016 20:00:00
szDriverLanguageEnglish	English
szDriverLanguageLocalized	English
szDriverModelEnglish	WDDM 2.1
szDriverModelLocalized	WDDM 2.1
szDriverName	C:\WINDOWS\System32\DriverStore\FileRepository\nvdm.inf_amd64_72f356f138a86324\nvd3dumx.dll,C:\WINDOWS\System32\DriverStore\FileRepository\nvdm.inf_amd64_72f356f138a86324\nvwgf2umx.dll,C:\WINDOWS\System32\DriverStore\FileRepository\nvdm.inf_amd64_72f356f138a86324\nvwgf2umx.dll,C:\WINDOWS\System32\DriverStore\FileRepository\nvdm.inf_amd64_72f356f138a86324\nvwgf2umx.dll
szDriverNodeStrongName	oem50.inf:0f066de370aaddbd:Section042:21.21.13.7654:pci\ven_10de&dev_0dfc&subsys_15351028
szDriverSignDate	Unknown
szDriverVersion	21.21.0013.7654
szKeyDeviceID	Enum\PCI\VEN_10DE&DEV_0DFC&SUBSYS_15351028&REV_A1
szKeyDeviceKey	\Registry\Machine\System\CurrentControlSet\Control\Video\{88CDDD9A-5BE8-4CAC-9169-5E071E2A6724}\0000
szManufacturer	NVIDIA
szMiniVdd	unknown
szMiniVddDateEnglish	Unknown
szMiniVddDateLocalized	unknown
szMonitorMaxRes	Unknown
szMonitorName	Unknown
szNotesEnglish	No problems found.
szNotesLocalized	No problems found.
szOverlayEnglish	Supported
szRankOfInstalledDriver	00D10001
szRegHelpText	Unknown
szRevision	Unknown
szRevisionId	0x00A1
szSubSysId	0x15351028
szTestResultD3D7English	Not run
szTestResultD3D7Localized	Not run
szTestResultD3D8English	Not run
szTestResultD3D8Localized	Not run
szTestResultD3D9English	Not run
szTestResultD3D9Localized	Not run
szTestResultDDEnglish	Not run
szTestResultDDLocalized	Not run
szVdd	unknown
szVendorId	0x10DE
2
b3DAccelerationEnabled	true
b3DAccelerationExists	true
bAGPEnabled	true
bAGPExistenceValid	true
bAGPExists	true
bCanRenderWindow	true
bDDAccelerationEnabled	true
bDriverBeta	false
bDriverDebug	false
bDriverSigned	false
bDriverSignedValid	false
bNoHardware	false
dwBpp	32
dwDDIVersion	11
dwHeight	1080
dwRefreshRate	60
dwWHQLLevel	0
dwWidth	1920
iAdapter	2
lDriverSize	17753968
lMiniVddSize	0
szAGPStatusEnglish	Enabled
szAGPStatusLocalized	Enabled
szChipType	NVS 5200M
szD3DStatusEnglish	Enabled
szD3DStatusLocalized	Enabled
szDACType	Integrated RAMDAC
szDDIVersionEnglish	11.4
szDDIVersionLocalized	11.4
szDDStatusEnglish	Enabled
szDDStatusLocalized	Enabled
szDXVAHDEnglish	Supported
szDXVAModes	ModeMPEG2_A ModeMPEG2_C ModeVC1_C ModeWMV9_C
szDescription	NVIDIA NVS 5200M
szDeviceId	0x0DFC
szDeviceIdentifier	{D7B71E3E-4EBC-11CF-7E6E-38351BC2D835}
szDeviceName	\\.\DISPLAY4
szDisplayMemoryEnglish	4095 MB
szDisplayMemoryLocalized	4095 MB
szDisplayModeEnglish	1920 x 1080 (32 bit) (60Hz)
szDisplayModeLocalized	1920 x 1080 (32 bit) (60Hz)
szDriverAssemblyVersion	21.21.13.7654
szDriverAttributes	Final Retail
szDriverDateEnglish	12/28/2016 8:00:00 PM
szDriverDateLocalized	12/28/2016 20:00:00
szDriverLanguageEnglish	English
szDriverLanguageLocalized	English
szDriverModelEnglish	WDDM 2.1
szDriverModelLocalized	WDDM 2.1
szDriverName	C:\WINDOWS\System32\DriverStore\FileRepository\nvdm.inf_amd64_72f356f138a86324\nvd3dumx.dll,C:\WINDOWS\System32\DriverStore\FileRepository\nvdm.inf_amd64_72f356f138a86324\nvwgf2umx.dll,C:\WINDOWS\System32\DriverStore\FileRepository\nvdm.inf_amd64_72f356f138a86324\nvwgf2umx.dll,C:\WINDOWS\System32\DriverStore\FileRepository\nvdm.inf_amd64_72f356f138a86324\nvwgf2umx.dll
szDriverNodeStrongName	oem50.inf:0f066de370aaddbd:Section042:21.21.13.7654:pci\ven_10de&dev_0dfc&subsys_15351028
szDriverSignDate	Unknown
szDriverVersion	21.21.0013.7654
szKeyDeviceID	Enum\PCI\VEN_10DE&DEV_0DFC&SUBSYS_15351028&REV_A1
szKeyDeviceKey	\Registry\Machine\System\CurrentControlSet\Control\Video\{88CDDD9A-5BE8-4CAC-9169-5E071E2A6724}\0001
szManufacturer	NVIDIA
szMiniVdd	unknown
szMiniVddDateEnglish	Unknown
szMiniVddDateLocalized	unknown
szMonitorMaxRes	Unknown
szMonitorName	Dell P2210H(Digital)
szNotesEnglish	No problems found.
szNotesLocalized	No problems found.
szOverlayEnglish	Supported
szRankOfInstalledDriver	00D10001
szRegHelpText	Unknown
szRevision	Unknown
szRevisionId	0x00A1
szSubSysId	0x15351028
szTestResultD3D7English	Not run
szTestResultD3D7Localized	Not run
szTestResultD3D8English	Not run
szTestResultD3D8Localized	Not run
szTestResultD3D9English	Not run
szTestResultD3D9Localized	Not run
szTestResultDDEnglish	Not run
szTestResultDDLocalized	Not run
szVdd	unknown
szVendorId	0x10DE
Log Messages
[4200:12312:0513/190522.928:WARNING:angle_platform_impl.cc(41)] : rx::RendererD3D::skipDraw(186): Point rendering without writing to gl_PointSize.
GpuProcessHostUIShim: The GPU process exited normally. Everything is okay.

I'm assuming the regression state is 'Not applicable' since the APNG support is new in 59.

It's certainly possible all of these images are broken and the apng decoding is doing the right thing, but given that they look correct in other browsers I'm hoping it's either a bug in the (still quite new) APNG decoding code in chromium or maybe something the current APNG specification isn't clear enough about and needs to be more explicit.
 
Labels: Needs-Triage-M59
Cc: dalecur...@chromium.org yini...@chromium.org
Status: Available (was: Unconfirmed)
I can repro this bug. some frames are missing in APNG. there are serious artifacts in APNG file.
Dale, can you assign appropriately? I am not sure which component animated gif e.g APNG or gifv belongs to. 
Cc: scroggo@chromium.org noel@chromium.org
Components: -Internals>Media Blink>Image
+apng folk
Owner: scroggo@chromium.org
Components: -Blink>Image Internals>Images>Codecs
Labels: -Needs-Triage-M59 PaintTeamTriaged-20170517 BugSource-User
Status: Assigned (was: Available)
Status: Started (was: Assigned)
> parts of the rendered frames are missing.  Trying to ffprobe -v debug on the
> png files shows dispose_op=2 and blend_op=1 are being used across them, so
> one/both of them might be a cause, but that's just a guess.

You are correct - it is the combination of blend_ops and dispose_ops that trigger a bug in the Chromium code.

Frame 5 (like all the frames before it) is set to APNG_DISPOSE_OP_NONE (kDisposeKeep, in Chromium's parlance). Meaning we should leave the frame in the buffer. Frame 6 is set to APNG_DISPOSE_OP_PREVIOUS (kDisposeOverwritePrevious), meaning we should render it and then discard it, making the next frame (7) draw on top of 5. The tricky bit is that 6's blend_op is APNG_BLEND_OP_SOURCE (kBlendAtopBgcolor), so it is independent.

The bug is that when Chromium wants to determine the required frame for 7, it looks at 6, which is kDisposeOverwritePrevious, so it sets 7's required frame to the same one as 6, which is independent. So 7 is drawn on top of a transparent background, not showing most of the frame.

The problem predated APNG support, but I suppose no webps or gifs demonstrated it (or if they did, no one reported a bug). gif does not have an equivalent of APNG_BLEND_OP_SOURCE, but the same bug could occur if 6 had simply filled the screen and been opaque.

The fix is in https://codereview.chromium.org/2887123003. I need to write a layout test that will demonstrate it, for which I'll need to construct some images that fail without the fix.

> It's certainly possible all of these images are broken and the apng decoding is doing the
> right thing, but given that they look correct in other browsers I'm hoping it's either a bug
> in the (still quite new) APNG decoding code in chromium or maybe something the current APNG
> specification isn't clear enough about and needs to be more explicit.

No, these images all look valid to me. Thanks for giving us the benefit of the doubt :)
> The problem predated APNG support, but I suppose no webps or gifs demonstrated
> it (or if they did, no one reported a bug). gif does not have an equivalent of
> APNG_BLEND_OP_SOURCE, but the same bug could occur if 6 had simply filled the
> screen and been opaque.

My mistake; neither gif nor webp have this bug:
- webp cannot, because it has no equivalent of APNG_DISPOSE_OP_PREVIOUS.
- gif *could* have exhibited the bug, if our gif decoder ever called FindRequiredPreviousFrameIndex with frame_rect_is_opaque set to true, but it does not. (I'm not sure why that is the case; if there is no transparent index, or it's outside of the range of the color map, the frame rect is known to be opaque. Maybe this is for the exception of "do-nothing frames" [1]. In that case, the frame is fully transparent, despite not having a valid transparent index. I'm not sure we handle that case properly, though; we'll immediately call CorrectAlphaWhenFrameBufferSawNoAlpha, which does not do the right thing if the frame didn't change anything.)

[1] https://cs.chromium.org/chromium/src/third_party/WebKit/Source/platform/image-decoders/gif/GIFImageDecoder.cpp?l=189
Project Member

Comment 8 by bugdroid1@chromium.org, May 18 2017

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

commit 55b2599c12a1f482bf13f07f855f6caf643af390
Author: scroggo <scroggo@chromium.org>
Date: Thu May 18 19:19:29 2017

Fix required frame bug in APNGs

If frame |i|'s disposal method is kDisposeOverwritePrevious, frame
|i+1| does not necessarily share |i|'s required frame. If |i| is
independent (e.g. by filling the screen and being opaque or using
kBlendAtopBgcolor), |i+1| may still depend on |i-1|.

When looking for the required frame, skip over frames marked
kDisposeOverwritePrevious. This fixes a bug where frames are drawn on
top of transparent instead of the appropriate prior frame.

Add a LayoutTest that exercises the problem.

BUG= 722072 

Review-Url: https://codereview.chromium.org/2887123003
Cr-Commit-Position: refs/heads/master@{#472897}

[add] https://crrev.com/55b2599c12a1f482bf13f07f855f6caf643af390/third_party/WebKit/LayoutTests/images/dispose-previous-expected.html
[add] https://crrev.com/55b2599c12a1f482bf13f07f855f6caf643af390/third_party/WebKit/LayoutTests/images/dispose-previous.html
[add] https://crrev.com/55b2599c12a1f482bf13f07f855f6caf643af390/third_party/WebKit/LayoutTests/images/resources/crbug722072.png
[add] https://crrev.com/55b2599c12a1f482bf13f07f855f6caf643af390/third_party/WebKit/LayoutTests/images/resources/green.png
[modify] https://crrev.com/55b2599c12a1f482bf13f07f855f6caf643af390/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp

Status: Fixed (was: Started)
Fixed.

I filed issue 724088 for my concerns in comment #7.

Sign in to add a comment