Bug 190513

Summary: [Cairo] Incorrect rendering for 135-deg skews
Product: WebKit Reporter: Yoshiaki Jitsukawa <yoshiaki.jitsukawa>
Component: New BugsAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: cgarcia, commit-queue, ews-watchlist, magomez, mcatanzaro, rniwa, webkit-bug-importer, yoshiaki.jitsukawa, zan
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
layout tests
none
Patch
none
Archive of layout-test-results from ews101 for mac-sierra
none
Archive of layout-test-results from ews106 for mac-sierra-wk2
none
Archive of layout-test-results from ews112 for mac-sierra
none
Archive of layout-test-results from ews125 for ios-simulator-wk2
none
Archive of layout-test-results from ews126 for ios-simulator-wk2
none
Archive of layout-test-results from ews205 for win-future
none
diff image
none
Patch none

Description Yoshiaki Jitsukawa 2018-10-12 00:52:07 PDT
Transforming with 135 deg skew results in incorrect rendering.

With a 135 deg skew, transformation matrix is { xx=1, xy=-1, yx=0, yy=1 } and here
the xScale becomes 0, which causes a division-by-zero.
https://github.com/WebKit/webkit/blob/523cf6b5bbafa7394699a0b3b52f13265174cff6/Source/WebCore/platform/graphics/cairo/CairoUtilities.cpp#L245

This behavior has been introduced with bug 154283.
Comment 2 Yoshiaki Jitsukawa 2018-10-12 01:03:48 PDT
Created attachment 352150 [details]
layout tests
Comment 3 Yoshiaki Jitsukawa 2018-10-12 02:33:04 PDT
Created attachment 352152 [details]
Patch
Comment 4 Yoshiaki Jitsukawa 2018-10-12 02:47:32 PDT
Provided R=(ctm.xx, ctm.xy, ctm.yx, ctm.yy), T=(ctm.x0, ctm.y0), D=(-dx, -dy),
the translation components (x0, y0) after cairo_translate(-dx, -dy) will be
 (x0, y0) = R*D + T
so D to zero (x0, y0) is:
 D = -R^-1* T

With (xy = 0, yx = 0), D is:
 D = -(x0, y0) * (yy, xx) / det: where det = xx * yy
so
 (dx, dy) = (x0 / xx, y0 / yy)

This is the same result as before.
Comment 5 EWS Watchlist 2018-10-12 03:36:45 PDT
Comment on attachment 352152 [details]
Patch

Attachment 352152 [details] did not pass mac-ews (mac):
Output: https://webkit-queues.webkit.org/results/9549433

New failing tests:
fast/transforms/skew-y-135deg-with-gradient.html
fast/transforms/skew-x-135deg-with-gradient.html
Comment 6 EWS Watchlist 2018-10-12 03:36:47 PDT
Created attachment 352153 [details]
Archive of layout-test-results from ews101 for mac-sierra

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews101  Port: mac-sierra  Platform: Mac OS X 10.12.6
Comment 7 EWS Watchlist 2018-10-12 03:46:49 PDT
Comment on attachment 352152 [details]
Patch

Attachment 352152 [details] did not pass mac-wk2-ews (mac-wk2):
Output: https://webkit-queues.webkit.org/results/9549446

New failing tests:
fast/transforms/skew-y-135deg-with-gradient.html
fast/transforms/skew-x-135deg-with-gradient.html
Comment 8 EWS Watchlist 2018-10-12 03:46:50 PDT
Created attachment 352154 [details]
Archive of layout-test-results from ews106 for mac-sierra-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews106  Port: mac-sierra-wk2  Platform: Mac OS X 10.12.6
Comment 9 EWS Watchlist 2018-10-12 04:32:05 PDT
Comment on attachment 352152 [details]
Patch

Attachment 352152 [details] did not pass mac-debug-ews (mac):
Output: https://webkit-queues.webkit.org/results/9549511

New failing tests:
fast/transforms/skew-y-135deg-with-gradient.html
fast/transforms/skew-x-135deg-with-gradient.html
Comment 10 EWS Watchlist 2018-10-12 04:32:07 PDT
Created attachment 352157 [details]
Archive of layout-test-results from ews112 for mac-sierra

The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews112  Port: mac-sierra  Platform: Mac OS X 10.12.6
Comment 11 EWS Watchlist 2018-10-12 06:32:10 PDT
Comment on attachment 352152 [details]
Patch

Attachment 352152 [details] did not pass ios-sim-ews (ios-simulator-wk2):
Output: https://webkit-queues.webkit.org/results/9549724

New failing tests:
fast/transforms/skew-y-135deg-with-gradient.html
fast/transforms/skew-x-135deg-with-gradient.html
Comment 12 EWS Watchlist 2018-10-12 06:32:12 PDT
Created attachment 352164 [details]
Archive of layout-test-results from ews125 for ios-simulator-wk2

The attached test failures were seen while running run-webkit-tests on the ios-sim-ews.
Bot: ews125  Port: ios-simulator-wk2  Platform: Mac OS X 10.13.6
Comment 13 EWS Watchlist 2018-10-12 07:58:01 PDT
Comment on attachment 352152 [details]
Patch

Attachment 352152 [details] did not pass ios-sim-ews (ios-simulator-wk2):
Output: https://webkit-queues.webkit.org/results/9550617

New failing tests:
fast/transforms/skew-y-135deg-with-gradient.html
fast/transforms/skew-x-135deg-with-gradient.html
Comment 14 EWS Watchlist 2018-10-12 07:58:03 PDT
Created attachment 352167 [details]
Archive of layout-test-results from ews126 for ios-simulator-wk2

The attached test failures were seen while running run-webkit-tests on the ios-sim-ews.
Bot: ews126  Port: ios-simulator-wk2  Platform: Mac OS X 10.13.6
Comment 15 EWS Watchlist 2018-10-12 08:04:00 PDT
Comment on attachment 352152 [details]
Patch

Attachment 352152 [details] did not pass win-ews (win):
Output: https://webkit-queues.webkit.org/results/9551304

New failing tests:
fast/transforms/skew-y-135deg-with-gradient.html
fast/transforms/skew-x-135deg-with-gradient.html
Comment 16 EWS Watchlist 2018-10-12 08:04:12 PDT
Created attachment 352168 [details]
Archive of layout-test-results from ews205 for win-future

The attached test failures were seen while running run-webkit-tests on the win-ews.
Bot: ews205  Port: win-future  Platform: CYGWIN_NT-6.1-2.9.0-0.318-5-3-x86_64-64bit
Comment 17 Michael Catanzaro 2018-10-12 14:30:04 PDT
Thanks!

You'll investigate why the EWS are failing?
Comment 18 Yoshiaki Jitsukawa 2018-10-14 17:20:28 PDT
(In reply to Michael Catanzaro from comment #17)
> Thanks!
> 
> You'll investigate why the EWS are failing?

Yes, let me check.
Comment 19 Yoshiaki Jitsukawa 2018-10-14 17:29:57 PDT
Created attachment 352286 [details]
diff image

Looks like solid color and gradient make slightly different results. The tests need to improve.
Comment 20 Yoshiaki Jitsukawa 2018-10-14 20:35:38 PDT
Created attachment 352294 [details]
Patch
Comment 21 Yoshiaki Jitsukawa 2018-10-14 20:43:58 PDT
(In reply to Yoshiaki Jitsukawa from comment #19)
> Looks like solid color and gradient make slightly different results. The
> tests need to improve.

10px border lines now cover the edges rendered (antialiased?) in a platform-specific way.
Comment 22 Zan Dobersek 2018-10-15 09:25:18 PDT
Comment on attachment 352294 [details]
Patch

r=me
Comment 23 WebKit Commit Bot 2018-10-15 09:50:41 PDT
Comment on attachment 352294 [details]
Patch

Clearing flags on attachment: 352294

Committed r237119: <https://trac.webkit.org/changeset/237119>
Comment 24 WebKit Commit Bot 2018-10-15 09:50:43 PDT
All reviewed patches have been landed.  Closing bug.
Comment 25 Radar WebKit Bug Importer 2018-10-15 09:51:34 PDT
<rdar://problem/45274028>