Small canvases have poor text antialiasing
Reported by
jes...@twitter.com,
Jan 18 2017
|
|||||||||||
Issue descriptionUserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.95 Safari/537.36 Steps to reproduce the problem: Reduced test case: https://jsfiddle.net/neonsilk/s4zyz6y7/ 1. Create a small canvas (e.g. 400x50px). 2. fillText What is the expected behavior? Text is legible What went wrong? Text is barely legible due to poor antialiasing Did this work before? N/A Does this work in other browsers? N/A Chrome version: 55.0.2883.95 Channel: stable OS Version: OS X 10.11.6 Flash Version: Shockwave Flash 24.0 r0 - Increasing the canvas size fixes issue. - Using fillText on white rect fixes issue.
,
Mar 1 2017
Adding people who actually know things. It appears that Skia is being asked to draw a textBlob that has a run with LCD text specified. Unfortunately, the surface it is being drawn into isn't opaque which winds up altering the pixels around the text. AFAIK Skia always trusts the caller to only use LCD text when the destination is known to be opaque. Note that this will repro on Linux if "--force-gpu-rasterization" is used.
,
Mar 1 2017
I think we also look at the SkPixelGeometry on the SkSurface's SkSurfaceProps. But if the client specifies a SkPixelGeometry other than kUnknown and sets the blob to be LCD then we don't question it.
,
Mar 1 2017
On Linux with force-gpu-rasterization, the SkGpuDevice is reporting a pixelGeometry of kRGB_H_SkPixelGeometry right before diving into the drawTextBlob method.
,
Mar 1 2017
In general, we are supposed to disable LCD text for all non-opaque surfaces - e.g.: https://cs.chromium.org/chromium/src/third_party/WebKit/Source/platform/graphics/gpu/AcceleratedImageBufferSurface.cpp?rcl=70fb26c9646660021ce780f6e4849b22688975c9&l=58 Sounds like some surface factory is missing this logic?
,
Mar 1 2017
It may have something to do with the new 'alpha' parameter to getContext
,
Mar 2 2017
,
Apr 28 2017
Can we get some action on this. Seem fairly simple to fix and we now have a 30-day SLA for P1 issues. If you point me to the right surface creation method, I can try to fix it.
,
May 1 2017
Issue 714428 has been merged into this issue.
,
May 1 2017
According to duplicate issue, regression range is: https://chromium.googlesource.com/chromium/src/+log/52.0.2743.0..53.0.2744.0?pretty=fuller&n=10000 A narrower range would be useful.
,
May 1 2017
I can get a narrower range.
,
May 1 2017
I don't think this is a regression. On linux, when using --force-gpu-rasterization this reproduces all the way back to M-53. I suspect the test teams' bisects are just finding the time that their machine was whitelisted for GPU raster, or something like that. I can't repro on my Mac at all. Reducing the priority accordingly.
,
May 11 2017
Disabling deferral for text rendering should fix this for now.
,
May 15 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/ee1c820d0133c0536a55b5a0aaf808a97c471bde commit ee1c820d0133c0536a55b5a0aaf808a97c471bde Author: fserb <fserb@chromium.org> Date: Mon May 15 17:07:12 2017 Disable 2D canvas deferral on text rendering when compositing SkPicture currently has a hard time realizing a surface change may mean a LCD font rendering change. So we can't send deferred SkPicture when drawing texts BUG= 682074 Review-Url: https://codereview.chromium.org/2877833002 Cr-Commit-Position: refs/heads/master@{#471808} [modify] https://crrev.com/ee1c820d0133c0536a55b5a0aaf808a97c471bde/third_party/WebKit/LayoutTests/TestExpectations [modify] https://crrev.com/ee1c820d0133c0536a55b5a0aaf808a97c471bde/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp [modify] https://crrev.com/ee1c820d0133c0536a55b5a0aaf808a97c471bde/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DTest.cpp
,
May 15 2017
Please double check on ToT, or on canary in a couple days. It should be perfect. ;) Reopen if anything seems weird. PEACE!
,
Jun 5 2017
Issue 729363 has been merged into this issue.
,
Jun 5 2017
Issue 718113 has been merged into this issue.
,
Jun 28 2017
|
|||||||||||
►
Sign in to add a comment |
|||||||||||
Comment 1 by tkonch...@chromium.org
, Jan 18 2017Labels: -Type-Bug -Pri-2 M-56 Pri-1 Type-Bug-Regression
Owner: robertphillips@chromium.org
Status: Assigned (was: Unconfirmed)