Need to fix layout test failures and re-enable Skia auto-roller |
|||
Issue descriptionIn Issue 796769 Skia had to be rolled back because somehow one of the auto-rolls caused reliable layout test failures on all platforms: https://chromium-review.googlesource.com/836413 The failing tests were: * fast/webgl/texImage-imageBitmap-from-canvas-resize.html * fast/webgl/texImage-imageBitmap-from-image-resize.html * fast/webgl/texImage-imageBitmap-from-imageData-resize.html * fast/webgl/texImage-imageBitmap-from-offscreen-canvas-resize.html The Skia auto-roller was stopped in response to this. Need to figure out what change broke these tests before re-enabling it. Ideally, we'd also figure out how the roll made it through the CQ cleanly; these failures only showed up starting on the waterfall. Maybe there was a collision with another patch that landed at close to the same time. CC'ing some authors of patches that landed in that roll.
,
Dec 21 2017
Agreed. Any idea of the spread of platforms those 4 tests were failing on? I don't think we saw any failure like that when flipping this feature on here: https://chromium-review.googlesource.com/c/chromium/src/+/836807
,
Dec 21 2017
I caught one in Mac (https://ci.chromium.org/buildbot/tryserver.chromium.mac/mac_chromium_rel_ng/616587) and can reproduce it in my Linux machine. So I guess it is an all-platform issue. Btw I'm trying to remove the suppression of these 4 tests in TestExpectations in https://chromium-review.googlesource.com/c/chromium/src/+/839968. They should be all green after the revert now.
,
Dec 21 2017
The reason that they are not failing anymore also might be the fact that I flagged them as flaky to release the bots. Regarding the spread of platforms, they were failing on Mac, Win7 and Linux. See crbug.com/796760 .
,
Dec 21 2017
Thanks Olivia for removing the suppression on the tests.
,
Dec 21 2017
I did a little bit of investigation. My first impression was that the change may have result in a slight variance in color values of resized pixels, and this breaks the tests. However, the effect seems to be strange. For premul case, the resized pixels slightly change, which is expected, I assume. But for unpremul case, the results gets very different: Source unpremul pixels (2 pixels): 255,0,0,255 255,0,0,26 Resized pixels before Skia CL (4 pixels): 255,0,0,255 255,0,0,200 255,0,0,81 255,0,0,21 Resized pixels after Skia CL: 255,0,0,255, 4,0,0,200, 5,0,0,81, 255,0,0,21
,
Dec 21 2017
It is worthy to mention that unpremul resize code path in ImageBitmap is not allowed to premul the pixels. Due to the alpha clamping issue that we had when the resize quality was set to high, the code path is doing the resize on alpha channel and color channels separately and merges the result using SkImageFilters. Please see the code here: https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/imagebitmap/ImageBitmap.cpp?q=imagebitmap.cpp&sq=package:chromium&dr&l=376
,
Dec 21 2017
Correction. SkImagFilter used only to separate alpha from color components. Also fwiw, when doing that, we set the alpha of the color components to 255: https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/imagebitmap/ImageBitmap.cpp?q=imagebitmap.cpp&sq=package:chromium&dr&l=381
,
Dec 21 2017
I'm not sure I can picture in my head the change. Are those a,r,g,b? Are these unit tests? If so what are they trying to assert? Can they be re-written as things that can be looked at and rebaselined? The Skia change in question should allow native high-quality scaling of unpremul bitmaps, without going through the split-filter-twice image filter strategy.
,
Dec 21 2017
These are RGBA, sorry for not mentioning. I remove the branch and report the result here.
,
Dec 21 2017
These are layout tests and check different combination of ImageBitmapOptions and resize (2x2 pixels -> 4x4 pixels). The failing configuration is when the user asks to not premul the unpremul source pixels in any operation, including resize.
,
Dec 21 2017
Are you sure? This CL _removed_ that [0,a] clamp.
,
Dec 21 2017
The blink code still uses the old way. I'm testing to see what happens with the new code path. I'll report in a couple of minutes.
,
Dec 21 2017
I removed the branch and merged the code path for "unpremul, high" with other filter qualities. Unpremul "pixelated, low, medium" pass, but unpremul high still fails. Fwiw, these are the pixels in RGBA: Source: 255,0,0,255 255,0,0,26 0,255,0,255 0,255,0,26 Expected resized pixels: 255,0,0,255, 255,0,0,200, 255,0,0,81, 255,0,0,21, 198,63,0,255, 194,61,0,200, 195,63,0,81, 194,61,0,21, 63,198,0,255, 61,194,0,200, 63,195,0,81, 61,194,0,21, 0,255,0,255, 0,255,0,200, 0,255,0,81, 0,255,0,21 Generated result: 255,0,0,255, 4,0,0,200, 5,0,0,81, 255,0,0,21, 198,63,0,255, 194,61,0,200, 195,63,0,81, 194,61,0,21, 63,198,0,255, 61,194,0,200, 63,195,0,81, 61,194,0,21, 0,255,0,255, 0,4,0,200, 0,5,0,81, 0,255,0,21
,
Dec 21 2017
In the merged code path we simply call SkImage->scalePixels: https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/imagebitmap/ImageBitmap.cpp?q=imagebitmap.cpp&sq=package:chromium&dr&l=344
,
Dec 21 2017
So the "Expected resized pixels:" pixels are coming from the version that splits into two images (rgb1, 000a), upscales each image with a premul HQ scalePixels(), and remerges the results, and the "Generated result:" pixels are coming from a path that's just doing a single unpremul HQ scalePixels() call?
,
Dec 21 2017
Yes. You also can see the expected pixels for unpremul low quality resize here: https://cs.chromium.org/chromium/src/third_party/WebKit/LayoutTests/fast/webgl/resources/tex-image-and-sub-image-image-bitmap-utils-resize.js?type=cs&q=/WebKit/LayoutTests/fast/webgl/resources/tex-image-and-sub-image-image-bitmap-utils-resize.js&sq=package:chromium&l=33 As you can see it is very close to the expected pixels for unpremul high quality resize. Unpremul low quality uses a single scalePixels() call.
,
Dec 21 2017
If it helps you at all, I wrote a fiddle earlier to check the unpremul high quality filter: https://fiddle.skia.org/c/285f4fb5b7f19041db4d222e8df41cba If your change makes this fiddle work and generate similar results for high quality filter, then the problem should be somewhere in Blink.
,
Dec 21 2017
What are you expecting to see in that fiddle? It prints this out for me: Color Space: Legacy, Unpremul [ 0 0 255 255 ][ 0 0 255 26 ] [ 0 255 0 255 ][ 0 255 0 26 ] Color Space: Legacy, Premul [ 0 0 255 255 ][ 0 0 255 26 ] [ 0 255 0 255 ][ 0 255 0 26 ] Color Space: Legacy, Unpremul, kNone_SkFilterQuality [ 0 0 255 255 ][ 0 0 255 255 ][ 0 0 255 26 ][ 0 0 255 26 ] [ 0 0 255 255 ][ 0 0 255 255 ][ 0 0 255 26 ][ 0 0 255 26 ] [ 0 255 0 255 ][ 0 255 0 255 ][ 0 255 0 26 ][ 0 255 0 26 ] [ 0 255 0 255 ][ 0 255 0 255 ][ 0 255 0 26 ][ 0 255 0 26 ] Color Space: Legacy, Unpremul, kLow_SkFilterQuality [ 0 0 255 255 ][ 0 0 255 197 ][ 0 0 255 83 ][ 0 0 255 26 ] [ 0 63 191 255 ][ 0 63 191 197 ][ 0 63 191 83 ][ 0 63 191 26 ] [ 0 191 63 255 ][ 0 191 63 197 ][ 0 191 63 83 ][ 0 191 63 26 ] [ 0 255 0 255 ][ 0 255 0 197 ][ 0 255 0 83 ][ 0 255 0 26 ] Color Space: Legacy, Unpremul, kMedium_SkFilterQuality [ 0 0 255 255 ][ 0 0 255 197 ][ 0 0 255 83 ][ 0 0 255 26 ] [ 0 63 191 255 ][ 0 63 191 197 ][ 0 63 191 83 ][ 0 63 191 26 ] [ 0 191 63 255 ][ 0 191 63 197 ][ 0 191 63 83 ][ 0 191 63 26 ] [ 0 255 0 255 ][ 0 255 0 197 ][ 0 255 0 83 ][ 0 255 0 26 ] Color Space: Legacy, Unpremul, kHigh_SkFilterQuality [ 0 0 255 255 ][ 0 0 255 200 ][ 0 0 255 81 ][ 0 0 255 21 ] [ 0 62 193 255 ][ 0 62 193 200 ][ 0 62 193 81 ][ 0 62 193 21 ] [ 0 193 62 255 ][ 0 193 62 200 ][ 0 193 62 81 ][ 0 193 62 21 ] [ 0 255 0 255 ][ 0 255 0 200 ][ 0 255 0 81 ][ 0 255 0 21 ] That's Skia built at https://skia.googlesource.com/skia/+/16c81a1ee9e2b90b97d73a1f08b03bebfadfbc81 yesterday, which includes active "bc9f349 remove bicubic clamp in SkImageShader". That all looks about expected to me.
,
Dec 21 2017
Interesting. Let me check the blink code again.
,
Dec 21 2017
Okay, I can confirm that something is conflicting in the logic in ImageBitmap resize code (to be exact, when the source is premul and the flag in ImageBitmapOptions is set to unpremul). Please go ahead and land your CL. I'll keep the tests suppressed for now and will fix them after your CL was rolled.
,
Dec 21 2017
Thanks! We're rolling again now with the CL out (https://chromium-review.googlesource.com/c/chromium/src/+/839982), and then I'll re-land it in Skia and we'll roll again with that patch. We can set a #define to disable this feature in Chromium if necessary, by reverting https://chromium-review.googlesource.com/c/chromium/src/+/836807. That might be a more focused relief valve than reverting the whole roll, should the need come up again. I'll make sure to leave support for that #define in until this is all sorted out.
,
Dec 21 2017
Thanks everyone for investigating. Reza, assigning to you to follow up.
,
Dec 21 2017
Issue 796766 has been merged into this issue.
,
Dec 21 2017
The CL to fix this is ready at https://chromium-review.googlesource.com/c/chromium/src/+/840829. I'll try to land after the Skia change rolled.
,
Dec 22 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/a52f6b77d5a4ac517e850d08005262d7d74c9d7b commit a52f6b77d5a4ac517e850d08005262d7d74c9d7b Author: Reza.Zakerinasab <zakerinasab@chromium.org> Date: Fri Dec 22 18:07:00 2017 Unify ImageBitmap resize code path for premul and unpremul After Skia rolls this recent CL to fix the alpha clamping issue in high filter quality (https://skia-review.googlesource.com/c/skia/+/87000), we can refactor ImageBitmap code path to unify high quality premul and unpremul. Bug: 787034 , 796797 Change-Id: I2efc0c86b15b2f182e4af99afc538918d11f2f0d Reviewed-on: https://chromium-review.googlesource.com/840829 Reviewed-by: Olivia Lai <xlai@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Mohammad Reza Zakerinasab <zakerinasab@chromium.org> Cr-Commit-Position: refs/heads/master@{#526021} [modify] https://crrev.com/a52f6b77d5a4ac517e850d08005262d7d74c9d7b/third_party/WebKit/LayoutTests/TestExpectations [modify] https://crrev.com/a52f6b77d5a4ac517e850d08005262d7d74c9d7b/third_party/WebKit/LayoutTests/fast/webgl/resources/tex-image-and-sub-image-image-bitmap-utils-resize.js [modify] https://crrev.com/a52f6b77d5a4ac517e850d08005262d7d74c9d7b/third_party/WebKit/Source/core/imagebitmap/ImageBitmap.cpp
,
Dec 22 2017
|
|||
►
Sign in to add a comment |
|||
Comment 1 by xlai@chromium.org
, Dec 21 2017