New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 731693 link

Starred by 4 users

Issue metadata

Status: Fixed
Owner:
Closed: Jun 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug



Sign in to add a comment

Gradients are not dithered with Ganesh

Project Member Reported by fmalita@chromium.org, Jun 9 2017

Issue description

We disable Ganesh dithering explicitly, in SkUserConfig.h: https://cs.chromium.org/chromium/src/skia/config/SkUserConfig.h?rcl=3eb67a8404b818203d0498faf86438681c4a6c97&l=201

This yields visible banding for shallow gradients - e.g. https://bugs.chromium.org/p/chromium/issues/detail?id=41756#c100.

Let's look into switching dithering on for GPU.
 
We should definitely try this, but I'd be very careful to watch performance metrics after switching this on.

Do we know why this was ever disabled in the first place?
Cc: robertphillips@chromium.org
I can't remember but some guesses:

1) Didn't want to deal with layout test rebaselines
2) Bad performance
or
3) Bad quality

Adding Rob in case he remembers
IIRC it was #1 plus not wanting to change existing behavior. I believe the gpu dithering looked good and was performant but wasn't tremendously great.

Comment 4 by reed@google.com, Jun 9 2017

To be fair, in the new (higher precision) raster world, dithering has a measurable cost for cpu gradients as well...
Since it sounds like performance is pretty good, I agree that we should probably just turn this on. Definitely for low-end Android, which uses ARGB_4444, and benefits a lot from dithering.

Comment 6 by ericrk@chromium.org, Jun 15 2017

Labels: -Pri-3 M-61 Pri-2
This would be really great to get in for M61, which is when we plan a full roll-out of GPU raster on low-end Android (which uses RGBA_4444).

Does the dithering described here only impact gradients? Or other things as well (blurs for instance)?
AFAIK Ganesh will apply the dither effect to everything, when the paint flag is set, but Blink only ever sets the flag for gradients.

I'm working on the CL, and the diffs look good -- just need to clean up some canvas2s tests which assert exact pixel values: https://chromium-review.googlesource.com/c/535714/

Comment 8 by ericrk@chromium.org, Jun 16 2017

Ah, perfect... so we could probably apply the dither more widely in CC if we decided it was appropriate (4444 color) by updating the paint flags. Thanks for looking at this!

Comment 9 by bsalo...@google.com, Jun 16 2017

Would Chrome be open to rasterizing in 8888 and then downgrading with dither to 4444? We think that'd look a whole lot better.
I wasn't planning on it, but we could do this - I assume it will come at significant cost (but this is what SW does, so maybe it's ~equivalent)? I'll try some benchmarks.
Project Member

Comment 11 by bugdroid1@chromium.org, Jun 20 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/2c7ac296e83c249dfa537962210fe4e48822488d

commit 2c7ac296e83c249dfa537962210fe4e48822488d
Author: Florin Malita <fmalita@chromium.org>
Date: Tue Jun 20 23:50:43 2017

Enable Ganesh dithering

We currently build Skia with SK_IGNORE_GPU_DITHER, effectively disabling GPU dithering.

Remove the build flag to align Ganesh with the sw rasterizer dithering behavior.

Note: Blink only sets the SkPaint dither flag for gradients at this time.

Aside from the flag change, this CL includes:

  * a handful of trivial layout tests rebaselines
  * some Canvas layout/unit test adjustments (relaxed exact pixel value checks to
    accommodate dithering)
  * a couple of trivial GPU pixel test rebaselines

BUG= 731693 

Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
Change-Id: I2fc6f8d23272504838c55427c48c4ea7d641deae
Reviewed-on: https://chromium-review.googlesource.com/535714
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Reviewed-by: Mike Reed <reed@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
Cr-Commit-Position: refs/heads/master@{#481033}
[modify] https://crrev.com/2c7ac296e83c249dfa537962210fe4e48822488d/content/test/gpu/gpu_tests/pixel_expectations.py
[modify] https://crrev.com/2c7ac296e83c249dfa537962210fe4e48822488d/content/test/gpu/gpu_tests/pixel_test_pages.py
[modify] https://crrev.com/2c7ac296e83c249dfa537962210fe4e48822488d/skia/config/SkUserConfig.h
[modify] https://crrev.com/2c7ac296e83c249dfa537962210fe4e48822488d/third_party/WebKit/LayoutTests/fast/canvas/canvas-fillPath-gradient-shadow.html
[delete] https://crrev.com/c2e0203b34c677befb95b244de7cc4da07089497/third_party/WebKit/LayoutTests/fast/canvas/canvas-fillRect-gradient-shadow-expected.txt
[modify] https://crrev.com/2c7ac296e83c249dfa537962210fe4e48822488d/third_party/WebKit/LayoutTests/fast/canvas/canvas-fillRect-gradient-shadow.html
[modify] https://crrev.com/2c7ac296e83c249dfa537962210fe4e48822488d/third_party/WebKit/LayoutTests/fast/canvas/canvas-strokePath-gradient-shadow.html
[modify] https://crrev.com/2c7ac296e83c249dfa537962210fe4e48822488d/third_party/WebKit/LayoutTests/fast/canvas/canvas-strokeRect-gradient-shadow.html
[add] https://crrev.com/2c7ac296e83c249dfa537962210fe4e48822488d/third_party/WebKit/LayoutTests/platform/linux/virtual/gpu-rasterization/images/cross-fade-overflow-position-expected.png
[modify] https://crrev.com/2c7ac296e83c249dfa537962210fe4e48822488d/third_party/WebKit/LayoutTests/platform/linux/virtual/gpu/fast/canvas/canvas-text-alignment-expected.png
[modify] https://crrev.com/2c7ac296e83c249dfa537962210fe4e48822488d/third_party/WebKit/LayoutTests/platform/linux/virtual/gpu/fast/canvas/fillrect_gradient-expected.png
[add] https://crrev.com/2c7ac296e83c249dfa537962210fe4e48822488d/third_party/WebKit/LayoutTests/platform/linux/virtual/gpu/fast/canvas/gradient-add-second-start-end-stop-expected.png
[add] https://crrev.com/2c7ac296e83c249dfa537962210fe4e48822488d/third_party/WebKit/LayoutTests/platform/mac/virtual/gpu-rasterization/images/cross-fade-overflow-position-expected.png
[modify] https://crrev.com/2c7ac296e83c249dfa537962210fe4e48822488d/third_party/WebKit/LayoutTests/platform/mac/virtual/gpu/fast/canvas/canvas-text-alignment-expected.png
[modify] https://crrev.com/2c7ac296e83c249dfa537962210fe4e48822488d/third_party/WebKit/LayoutTests/platform/mac/virtual/gpu/fast/canvas/fillrect_gradient-expected.png
[modify] https://crrev.com/2c7ac296e83c249dfa537962210fe4e48822488d/third_party/WebKit/LayoutTests/platform/mac/virtual/gpu/fast/canvas/gradient-add-second-start-end-stop-expected.png
[add] https://crrev.com/2c7ac296e83c249dfa537962210fe4e48822488d/third_party/WebKit/LayoutTests/platform/win/virtual/gpu-rasterization/images/cross-fade-overflow-position-expected.png
[modify] https://crrev.com/2c7ac296e83c249dfa537962210fe4e48822488d/third_party/WebKit/LayoutTests/platform/win/virtual/gpu/fast/canvas/canvas-text-alignment-expected.png
[modify] https://crrev.com/2c7ac296e83c249dfa537962210fe4e48822488d/third_party/WebKit/LayoutTests/platform/win/virtual/gpu/fast/canvas/fillrect_gradient-expected.png
[modify] https://crrev.com/2c7ac296e83c249dfa537962210fe4e48822488d/third_party/WebKit/LayoutTests/platform/win/virtual/gpu/fast/canvas/gradient-add-second-start-end-stop-expected.png
[delete] https://crrev.com/c2e0203b34c677befb95b244de7cc4da07089497/third_party/WebKit/LayoutTests/virtual/gpu-rasterization/images/cross-fade-overflow-position-expected.png

Status: Fixed (was: Assigned)

Sign in to add a comment