makeWithLocalMatrix() API does not mirror correctly

24 views
Skip to first unread message

Abhishek Pandey

unread,
May 11, 2021, 4:50:36 AMMay 11
to skia-discuss
Hi,

We were facing some rendering bug on our application and narrowed it down to Skia's makeWithLocalMatrix API. Please find the minimal reproducible example and expected output below:

Minimally Reproducible Example (via makeWithLocalMatrix)

On that note, setting the matrix on canvas also performs mirroring incorrectly, similar to makeWithLocalMatrix API. Example . On some investigation, we found that mirroring happens correctly on canvas if the skew component is not 0. Example

Can somebody look into this and suggest fixes? 

Michael Ludwig

unread,
May 12, 2021, 1:12:07 PMMay 12
to skia-discuss
I believe it's a bug here https://source.chromium.org/chromium/chromium/src/+/main:third_party/skia/src/effects/imagefilters/SkImageImageFilter.cpp;drc=91bfda0ac81914652dc89d56220d8f6db5ad0140;l=113 in the implementation of SkImageFilters::Image.

The local matrix maps it to the same rectangle although the image has flipped left and right edges, which is not detected in the current code. A fix should be easy enough. Thank you for the bug report!

-Michael

Michael Ludwig

unread,
May 12, 2021, 1:15:10 PMMay 12
to skia-discuss

Abhishek Pandey

unread,
May 14, 2021, 1:02:07 PMMay 14
to skia-discuss

Thanks a lot Michael!
Reply all
Reply to author
Forward
0 new messages