New issue
Advanced search Search tips

Issue 891316 link

Starred by 1 user

Issue metadata

Status: Fixed
Merged: issue 890745
Owner:
Closed: Nov 9
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 2
Type: Bug-Regression



Sign in to add a comment

Transparent line on right side of canvas

Reported by christop...@taopix.com, Oct 2

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36

Steps to reproduce the problem:
1. Download https://drive.google.com/file/d/1-zZeQRqYj6wuOp5K6QGXFuZ3adcKeSzT/view?usp=sharing
2. Open sample.html in Chrome

What is the expected behavior?
Image should go to the border. This worked in Chrome 68 and Firefox.

What went wrong?
Transparent line can be seen on the right side of the canvas causing a gap between the image and the border.

The image is 305 x 328 
The canvas is 47 x 47
The image is being scaled down to 185 x 200

Sizing the canvas anything below 50 width seems to trigger the gap.

Still an issue in 71.0.3568.0 Canary build.

Did this work before? Yes 68

Chrome version: 69.0.3497.100  Channel: stable
OS Version: OS X 10.12.6
Flash Version:
 
Chrome 30.png
14.8 KB View Download
FireFox.png
5.9 KB View Download
Components: -Blink Blink>Paint
Components: -Blink>Paint Internals>Compositing>Images
Owner: sdoyon@chromium.org
Status: Assigned (was: Unconfirmed)
Bisected to https://chromium.googlesource.com/chromium/src/+log/ace17b5d873af70823aa77ca6601d46c17929b05..a82f941966a82c1dd9d3b192b94355c0531df116

Maybe this: 
cc/blink: Use same rounding for cc and ImageDecoder mip level sizes. 
https://chromium.googlesource.com/chromium/src/+/75028fa6d6ca059d881fc4ed817c16f7692d11bb
Owner: khushals...@chromium.org
Mergedinto: 890745
Status: Duplicate (was: Assigned)
Status: Assigned (was: Duplicate)
khushalsagar@:

This issue ended up being unrelated to the one fixed in https://bugs.chromium.org/p/chromium/issues/detail?id=890745. You might want to look into this again.

I can confirm that if we don't use the rounding-up introduced in https://chromium.googlesource.com/chromium/src/+/75028fa6d6ca059d881fc4ed817c16f7692d11bb, the issue is fixed. I'm not completely sure of all the details, but here's what I've found:

In SoftwareImageDecodeCacheUtils::CacheKey::FromDrawImage(), we calculate the mip level based on the src_rect (185x200 for this bug) and the target_size (47x47). Before the CL, it would return 1. Now it returns 2 because ceil(185 / 4) = 47. Eventually, we get to the following fragment:

  SkSize mip_scale_adjustment =
      MipMapUtil::GetScaleAdjustmentForLevel(src_rect.size(), mip_level);
  target_size.set_width(src_rect.width() * mip_scale_adjustment.width());
  target_size.set_height(src_rect.height() * mip_scale_adjustment.height());

The last two calculations don't round up, so you would get 46x50 which is consistent with the reported gap. If you replace this fragment by:

  target_size = MipMapUtil::GetSizeForLevel(src_rect.size(), mip_level);

The gap disappears. This is cool, but I don't know if this is a hack or if it's actually fixing an inconsistency.

What do you think?
I think what you have is correct. We should use MipMapUtil::GetSizeForLevel to make sure the rounding is consistent with what we're doing for mip levels.
Owner: andrescj@chromium.org
Status: Started (was: Assigned)
Project Member

Comment 8 by bugdroid1@chromium.org, Nov 9

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

commit 1eb1dbc521da1a29571a98759ba86bbf6809bf06
Author: Andres Calderon Jaramillo <andrescj@chromium.org>
Date: Fri Nov 09 23:38:16 2018

cc: Fix target_size in SoftwareImageDecodeCacheUtils::CacheKey.

This CL fixes the computation of the target_size in FromDrawImage() when
the target_size is updated to the size of a mip level. Previously, the
computation rounded down which was inconsistent with the behavior
introduced in https://crrev.com/c/1107049.

Test: the artifact in the referenced bug is no longer present.
Bug:  891316 
Change-Id: If8838c1501cbbcedd8261ddf6eac81f21cdca947
Reviewed-on: https://chromium-review.googlesource.com/c/1321774
Commit-Queue: Andres Calderon Jaramillo <andrescj@chromium.org>
Reviewed-by: Philip Rogers <pdr@chromium.org>
Reviewed-by: Khushal <khushalsagar@chromium.org>
Cr-Commit-Position: refs/heads/master@{#607032}
[modify] https://crrev.com/1eb1dbc521da1a29571a98759ba86bbf6809bf06/cc/tiles/software_image_decode_cache_unittest.cc
[modify] https://crrev.com/1eb1dbc521da1a29571a98759ba86bbf6809bf06/cc/tiles/software_image_decode_cache_utils.cc
[modify] https://crrev.com/1eb1dbc521da1a29571a98759ba86bbf6809bf06/third_party/WebKit/LayoutTests/css3/blending/mix-blend-mode-isolated-group-2-expected.png
[modify] https://crrev.com/1eb1dbc521da1a29571a98759ba86bbf6809bf06/third_party/WebKit/LayoutTests/images/exif-orientation-height-image-document-expected.png
[modify] https://crrev.com/1eb1dbc521da1a29571a98759ba86bbf6809bf06/third_party/WebKit/LayoutTests/platform/linux/media/controls/paint-controls-webkit-appearance-none-custom-bg-expected.png
[modify] https://crrev.com/1eb1dbc521da1a29571a98759ba86bbf6809bf06/third_party/WebKit/LayoutTests/platform/linux/svg/hixie/perf/004-expected.png
[modify] https://crrev.com/1eb1dbc521da1a29571a98759ba86bbf6809bf06/third_party/WebKit/LayoutTests/platform/linux/virtual/new-remote-playback-pipeline/media/controls/paint-controls-webkit-appearance-none-custom-bg-expected.png
[modify] https://crrev.com/1eb1dbc521da1a29571a98759ba86bbf6809bf06/third_party/WebKit/LayoutTests/platform/mac-mac10.12/media/controls/paint-controls-webkit-appearance-none-custom-bg-expected.png
[modify] https://crrev.com/1eb1dbc521da1a29571a98759ba86bbf6809bf06/third_party/WebKit/LayoutTests/platform/mac-mac10.12/virtual/new-remote-playback-pipeline/media/controls/paint-controls-webkit-appearance-none-custom-bg-expected.png
[modify] https://crrev.com/1eb1dbc521da1a29571a98759ba86bbf6809bf06/third_party/WebKit/LayoutTests/platform/mac/fast/backgrounds/size/backgroundSize15-expected.png
[modify] https://crrev.com/1eb1dbc521da1a29571a98759ba86bbf6809bf06/third_party/WebKit/LayoutTests/platform/mac/images/sprite-no-bleed-expected.png
[modify] https://crrev.com/1eb1dbc521da1a29571a98759ba86bbf6809bf06/third_party/WebKit/LayoutTests/platform/mac/media/controls/paint-controls-webkit-appearance-none-custom-bg-expected.png
[modify] https://crrev.com/1eb1dbc521da1a29571a98759ba86bbf6809bf06/third_party/WebKit/LayoutTests/platform/mac/svg/hixie/perf/004-expected.png
[modify] https://crrev.com/1eb1dbc521da1a29571a98759ba86bbf6809bf06/third_party/WebKit/LayoutTests/platform/mac/virtual/exotic-color-space/images/sprite-no-bleed-expected.png
[add] https://crrev.com/1eb1dbc521da1a29571a98759ba86bbf6809bf06/third_party/WebKit/LayoutTests/platform/win/css3/blending/mix-blend-mode-isolated-group-1-expected.png
[add] https://crrev.com/1eb1dbc521da1a29571a98759ba86bbf6809bf06/third_party/WebKit/LayoutTests/platform/win/css3/blending/mix-blend-mode-isolated-group-3-expected.png
[modify] https://crrev.com/1eb1dbc521da1a29571a98759ba86bbf6809bf06/third_party/WebKit/LayoutTests/platform/win/fast/backgrounds/size/backgroundSize15-expected.png
[modify] https://crrev.com/1eb1dbc521da1a29571a98759ba86bbf6809bf06/third_party/WebKit/LayoutTests/platform/win/images/sprite-no-bleed-expected.png
[modify] https://crrev.com/1eb1dbc521da1a29571a98759ba86bbf6809bf06/third_party/WebKit/LayoutTests/platform/win/media/controls/paint-controls-webkit-appearance-none-custom-bg-expected.png
[modify] https://crrev.com/1eb1dbc521da1a29571a98759ba86bbf6809bf06/third_party/WebKit/LayoutTests/platform/win/svg/hixie/perf/004-expected.png
[modify] https://crrev.com/1eb1dbc521da1a29571a98759ba86bbf6809bf06/third_party/WebKit/LayoutTests/platform/win/virtual/exotic-color-space/images/sprite-no-bleed-expected.png
[modify] https://crrev.com/1eb1dbc521da1a29571a98759ba86bbf6809bf06/third_party/WebKit/LayoutTests/virtual/exotic-color-space/images/exif-orientation-height-image-document-expected.png

Status: Fixed (was: Started)

Sign in to add a comment