Bug 134346 - SVG graphics in LO Draw lose fidelity when using SKIA
Summary: SVG graphics in LO Draw lose fidelity when using SKIA
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Draw (show other bugs)
Version:
(earliest affected)
7.0.0.0.beta1+
Hardware: x86-64 (AMD64) All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:7.1.0 target:7.0.0.1 target:7.0.1
Keywords:
Depends on:
Blocks: Skia
  Show dependency treegraph
 
Reported: 2020-06-27 18:14 UTC by xordevoreaux
Modified: 2020-07-16 11:52 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
LO Draw file containing SVGs (20.71 KB, application/vnd.oasis.opendocument.graphics)
2020-06-27 18:15 UTC, xordevoreaux
Details
SVG file as save out from Inkscape (4.21 KB, image/svg+xml)
2020-06-27 18:15 UTC, xordevoreaux
Details

Note You need to log in before you can comment on or make changes to this bug.
Description xordevoreaux 2020-06-27 18:14:36 UTC
Description:
I create scaleable vector graphic files (SVGs) in InkScape and then import them into LO Draw, usually for logos and such.

I noticed that if I scale down an SVG in LO draw when using SKIA, the borders crap out.  This does not happen using hardware rendering. It's readily apparent not only in the exported PNG files but when viewing the SVGs in LO in both rendering modes.

This https://i.imgur.com/G79XokV.png is a side-by-side comparison of the two exports.  On the left is Skia, on the right is hardware rendering.  Not much difference on the larger SVG object, but compare the two smaller SVGs. The smaller the SVG, the worse the rendering gets on the SVG's borders. 

Not all SVGs are affected. I have a boy scout logo that imports and resizes just fine, but some of the other logos (I just created a random shape for this example) don't work, and I don't know the difference, or why Skia renders some poorly while hardware rendering is fine with all of the SVG files.

Not to distract from this bug, but my bug 117160 doesn't occur when using SKIA, just with hardware rendering.  



Steps to Reproduce:
1. Import an SVG file that has visible borders.
2. Scale the SVG file fairly small.
3. Select Skia as the rendering type.

Actual Results:
Borders don't render appropriately https://i.imgur.com/XW4eYi8.png

Expected Results:
Borders render appropriately https://i.imgur.com/Vta9bII.png


Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 7.0.0.0.beta2 (x64)
Build ID: 1c213561a365b5666167321de68c9977500c9612
CPU threads: 8; OS: Windows 10.0 Build 20152; UI render: default; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: CL
Comment 1 xordevoreaux 2020-06-27 18:15:14 UTC
Created attachment 162460 [details]
LO Draw file containing SVGs
Comment 2 xordevoreaux 2020-06-27 18:15:43 UTC
Created attachment 162461 [details]
SVG file as save out from Inkscape
Comment 3 xordevoreaux 2020-06-27 18:38:47 UTC
It's definitely something going on with the border property on the SVG.  The boy scout SVG logo that I mentioned originally didn't have borders, just fills, so it appeared fine. 

After adding borders to it, the logo did not render properly in Skia (unaffected using hardware rendering).
Comment 4 Telesto 2020-06-28 09:08:57 UTC
Repro with
Version: 7.1.0.0.alpha0+ (x64)
Build ID: 006c65bbd472cb1d7d44e095714e28190b76be0d
CPU threads: 4; OS: Windows 6.3 Build 9600; UI render: Skia/Raster; VCL: win
Locale: de-DE (nl_NL); UI: en-US
Calc: CL

And Vulkan

Apparently depending on zoom level; I did notice it first in the page pane
Comment 5 Commit Notification 2020-07-02 12:14:06 UTC
Luboš Luňák committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/52ccf06081d7aea3aefb7c582862987ec5380a45

Revert "implement Skia workaround for ... (tdf#133016)" (tdf#134346)

It will be available in 7.1.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 6 Commit Notification 2020-07-02 18:47:30 UTC
Luboš Luňák committed a patch related to this issue.
It has been pushed to "libreoffice-7-0":

https://git.libreoffice.org/core/commit/bbcc31c7261daba266b31a8d7d58fe0c1c87febe

Revert "implement Skia workaround for ... (tdf#133016)" (tdf#134346)

It will be available in 7.0.0.1.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 7 xordevoreaux 2020-07-03 09:40:07 UTC
I wanted to test this so I tried downloading 

https://dev-builds.libreoffice.org/daily/master/Win-x86_64@tb77-TDF/2020-07-03_04.49.35/LibreOfficeDev_7.1.0.0.alpha0_Win_x64.msi

to test but it won't download. Starts to and dies almost immediately.
I've tried several times. I'll try again tomorrow or something.
Comment 8 xordevoreaux 2020-07-04 06:25:20 UTC
---Not fixed---

https://i.imgur.com/9r23HFB.png

Not even close.  Artifacts / sloppy border remain.


Tested with:

Version: 7.1.0.0.alpha0+ (x64)
Build ID: 92c2318db92c3f102243ef1f8a9a492796932ff6
CPU threads: 8; OS: Windows 10.0 Build 20161; UI render: default; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: CL
Comment 9 Buovjaga 2020-07-06 12:03:28 UTC
(In reply to mwtjunkmail from comment #8)
> ---Not fixed---
> 
> https://i.imgur.com/9r23HFB.png
> 
> Not even close.  Artifacts / sloppy border remain.

I see some very slight fringing with zoom level 90% and smaller, but it is extremely hard to notice. Which zoom level are you using in this screenshot?

Would be great to find some example graphic that would make it easier to spot.

Version: 7.1.0.0.alpha0+ (x64)
Build ID: 9af38b4504ccda57a0c32eb8bdd03e5a8ca29ddc
CPU threads: 4; OS: Windows 10.0 Build 18362; UI render: Skia/Raster; VCL: win
Locale: fi-FI (fi_FI); UI: en-US
Calc: threaded
Comment 10 xordevoreaux 2020-07-06 12:22:34 UTC
(In reply to Buovjaga from comment #9)
> (In reply to mwtjunkmail from comment #8)
> > ---Not fixed---
> > 
> > https://i.imgur.com/9r23HFB.png
> > 
> > Not even close.  Artifacts / sloppy border remain.
> 
> I see some very slight fringing with zoom level 90% and smaller, but it is
> extremely hard to notice. Which zoom level are you using in this screenshot?
> 
> Would be great to find some example graphic that would make it easier to
> spot.
> 
> Version: 7.1.0.0.alpha0+ (x64)
> Build ID: 9af38b4504ccda57a0c32eb8bdd03e5a8ca29ddc
> CPU threads: 4; OS: Windows 10.0 Build 18362; UI render: Skia/Raster; VCL:
> win
> Locale: fi-FI (fi_FI); UI: en-US
> Calc: threaded

I look at high-resolution art all day long. It's very easy for me to notice. I'll see if I can get the BSA logo to do the same thing. To compare apples to apples I'll have to reinstall 7.1.0.0 rather than this bug fest version of 7.0.0.1 so it'll be a while.
Comment 11 xordevoreaux 2020-07-06 12:30:54 UTC
7.1.x daily build is downloading, very slow.

Meanwhile, https://sims4studio.com/post/137599 is an example of how I use LibreOffice draw to supply artwork templates to users. 

These users need to know that when they use my templates they can be assured nothing about the template when they use it will degrade what they're doing in any way.

This bug, coupled with the transparency bug:
https://bugs.documentfoundation.org/show_bug.cgi?id=134213
will be a complete nightmare for the users of my templates when people move away from 6.4.x and adopt 7.x of LO.
Comment 12 xordevoreaux 2020-07-06 12:47:13 UTC
Not at all better when using the 7/6 daily build

Version: 7.1.0.0.alpha0+ (x64)
Build ID: 9af38b4504ccda57a0c32eb8bdd03e5a8ca29ddc
CPU threads: 8; OS: Windows 10.0 Build 20161; UI render: Skia/Vulkan; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: CL

I'll try to get the BSA vector logo or another picture to do the same as the original sample so that it's abundantly obvious what's going on. Borders seem to be the problem.  


Hardware rendering is fine, Skia isn't, but hardware rendering has its own set of issues: https://bugs.documentfoundation.org/show_bug.cgi?id=117160

that Skia doesn't, so it's hard at the point to find a good win-win between the rendering methods.

I'll try to supply another example shortly.
Comment 13 xordevoreaux 2020-07-06 13:23:40 UTC
(In reply to mwtjunkmail from comment #12)
> Not at all better when using the 7/6 daily build
> 
> Version: 7.1.0.0.alpha0+ (x64)
> Build ID: 9af38b4504ccda57a0c32eb8bdd03e5a8ca29ddc
> CPU threads: 8; OS: Windows 10.0 Build 20161; UI render: Skia/Vulkan; VCL:
> win
> Locale: en-US (en_US); UI: en-US
> Calc: CL
> 
> I'll try to get the BSA vector logo or another picture to do the same as the
> original sample so that it's abundantly obvious what's going on. Borders
> seem to be the problem.  
> 
> 
> Hardware rendering is fine, Skia isn't, but hardware rendering has its own
> set of issues: https://bugs.documentfoundation.org/show_bug.cgi?id=117160
> 
> that Skia doesn't, so it's hard at the point to find a good win-win between
> the rendering methods.
> 
> I'll try to supply another example shortly.

I've tried a few different things and none of them were less subtle than the original example, sorry.
Comment 14 Commit Notification 2020-07-16 09:56:58 UTC
Luboš Luňák committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/4bb931a488b8fe7a0b4961956252f667b683a630

use consistent Skia pixel position adjustments (tdf#134346)

It will be available in 7.1.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 15 Commit Notification 2020-07-16 11:52:34 UTC
Luboš Luňák committed a patch related to this issue.
It has been pushed to "libreoffice-7-0":

https://git.libreoffice.org/core/commit/468ef8e3cb8746bc072cf8608465fd93375f90c6

use consistent Skia pixel position adjustments (tdf#134346)

It will be available in 7.0.1.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.