[LCP] Image: combine normal image and background image handling logic
LargestImagePaint handles both normal layout images and background images. Currently these two kinds of images are handled by two different functions. It poses a challenge for maintenance, as we need double effort in making change the handling logic. This CL combines the two. The main difference for the two kinds of images in LCP is that background image uses (node_id, cached_image) as the key for storage, whereas the normal image uses only node_id. It's based on the fact that we can use (node_id, cached_image) to identify normal image as well as background image. As a side effect, this change automatically solves crbug.com/965653, where the original version didn't handle the case where a layout image changed its src. A follow-up patch will correct the variable names. Bug: 965653, 972146 Change-Id: I33a7961c663b7a24b4116e23c4a2f1052c864ab6 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1692494Reviewed-by:Xianzhu Wang <wangxianzhu@chromium.org> Commit-Queue: Liquan (Max) Gu <maxlg@chromium.org> Cr-Commit-Position: refs/heads/master@{#675849}
Showing
Please register or sign in to comment