New issue
Advanced search Search tips

Issue 696575 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Mar 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 3
Type: Compat



Sign in to add a comment

svg background images get bad aliasing when border-radius is applied

Reported by samyalza...@gmail.com, Feb 27 2017

Issue description

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

Example URL:
http://codepen.io/anon/pen/peJVpr

Steps to reproduce the problem:
1. visit http://codepen.io/anon/pen/peJVpr
2. compare both icons on standard or retina screens
3. 

What is the expected behavior?
should look identical

What went wrong?
the second icon which has border-radius applied loses fidelity

Does it occur on multiple sites: N/A

Is it a problem with a plugin? No 

Did this work before? N/A 

Does this work in other browsers? Yes

Chrome version: 56.0.2924.87  Channel: stable
OS Version: OS X 10.12.3
Flash Version:

 

Comment 1 by a...@chromium.org, Feb 27 2017

Components: Blink
Components: -Blink Blink>SVG Blink>Paint
Labels: -Pri-2 Pri-3
Status: Available (was: Unconfirmed)
I can reproduce on 58.0.3013.3 / Mac.
Labels: ComponentLabelSource-User
I'm not seeing it on Linux M57.
Cc: reed@google.com
Owner: fmalita@chromium.org
Note: this only repros without --enable-use-zoom-for-dsf (enabled by default on Win/Linux).

Most likely a side effect of the border-radius background image fast path (drawing the image via a shader to avoid clipping).

What I think is going on: SVGImage -> SkPictureImage -> SkImageShader -> drawRRect().

Skia provides both picture shader and picture image abstractions, to support wrapping of arbitrary draw content.  The semantic difference is that a picture *image* is locked to its intrinsic resolution, while a picture shader will always rasterize at the native (CTM-derived) resolution.

In this case we're going through a picture image, so we're locking the resolution prematurely.  I think it should be straightforward to refactor the fast path as a picture shader for SVG images: SVGImage -> SkPictureShader -> drawRRect().


postscaled_svg.png
10.1 KB View Download
Labels: -ComponentLabelSource-User PaintTeamTriaged-20170227 BugSource-User

Sign in to add a comment