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

Issue 706693 link

Starred by 5 users

Issue metadata

Status: Verified
Owner:
Closed: Apr 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 1
Type: Bug-Regression



Sign in to add a comment

Regression: Incorrect Rendering mode on 17.6px Arial due to gasp table

Project Member Reported by ajha@chromium.org, Mar 30 2017

Issue description

Chrome Version: 59.0.3055.0
OS: Windows-10

What steps will reproduce the problem?
(1) Launch chrome canary and go to Gmail and open any email.
(2) Observe the font of the subject line.


What is the expected result?
> Font should be rendered fine.
What happens instead?
> Inconsistent Fold boldness seen.

Please use labels and text to provide additional information.
> This seems to be working fine on Linux Ubuntu 14.04, Mac OS 10.12.3 on the canary.

 

Comment 1 by ajha@chromium.org, Mar 30 2017

Cc: abdulsyed@chromium.org gov...@chromium.org manoranj...@chromium.org ajha@chromium.org
Labels: -Needs-Bisect hasbisect-per-revision
Owner: drott@chromium.org
Status: Assigned (was: Untriaged)
Regressed in M-59.
===================
Last good build: 59.0.3053.0
First bad build: 59.0.3054.0

Changelog:
==========
https://chromium.googlesource.com/chromium/src/+log/dd547f46cfb46ea92f554aa842d06bde19ceef6e..5fd631a31c688954834fc1e297a67b4b1a4f08bc

Dominik@: Could you please take a look at this.

Thank you!
706693.png
15.2 KB View Download

Comment 2 by drott@chromium.org, Mar 30 2017

Cc: bunge...@chromium.org
Thanks for the report, very interesting.

Gmail is using 17.6px font size for the subject here and Arial. Using http://roettsch.es/arialgmail.html it looks like Edge is applying the symmetric rendering mode starting from 17px. TTX Dump for Arial regular on Windows 10:

  <gasp>
    <gaspRange rangeMaxPPEM="8" rangeGaspBehavior="10"/>
    <gaspRange rangeMaxPPEM="17" rangeGaspBehavior="5"/>
    <gaspRange rangeMaxPPEM="65535" rangeGaspBehavior="15"/>
  </gasp>

Edge changes rendering mode >= 17px
FF changes rendering mode > 17px

But somehow it looks like we're changing rendering mode only >= 18px. 
edge_vs_chrome_gasp_threshold.PNG
20.4 KB View Download

Comment 3 by drott@chromium.org, Mar 30 2017

Summary: Regression: Incorrect Rendering mode on 17.6px Arial due to gasp table (was: Regression: Weird Font boldness on Windows canary)

Comment 4 by drott@chromium.org, Mar 30 2017

Oddly, Edge switches at 16.6px, 16.7px has symmetric rendering/y-smoothing.

Comment 5 by drott@chromium.org, Mar 30 2017

FF switches at 17.49999px.

Comment 6 by bungeman@google.com, Mar 30 2017

This is because at https://skia.googlesource.com/skia.git/+/2f3db61fed9cd2ebc888297a558c84194685572d/src/ports/SkScalerContext_win_dw.cpp#333 we're using SkScalarTruncToInt which is what I thought was the specification. If every one else is doing rounding though, I'll change it to rounding.

Comment 7 by drott@chromium.org, Mar 30 2017

I believe the truncation is okay and intended, but then we have an off-by-one in the range interpretation, we could perhaps fix it with:

diff --git a/src/ports/SkScalerContext_win_dw.cpp b/src/ports/SkScalerContext_win_dw.cpp
index 1fc067e..5d15fc2 100644
--- a/src/ports/SkScalerContext_win_dw.cpp
+++ b/src/ports/SkScalerContext_win_dw.cpp
@@ -101,11 +101,11 @@ bool get_gasp_range(DWriteFontTypeface* typeface, int size, GaspRange* range) {

     const SkOTTableGridAndScanProcedure::GaspRange* rangeTable =
             SkTAfter<const SkOTTableGridAndScanProcedure::GaspRange>(gasp.get());
-    int minPPEM = -1;
+    int minPPEM = 0;
     for (uint16_t i = 0; i < numRanges; ++i, ++rangeTable) {
         int maxPPEM = SkEndianSwap16(rangeTable->maxPPEM);
-        if (minPPEM < size && size <= maxPPEM) {
-            range->fMin = minPPEM + 1;
+        if (minPPEM <= size && (size < maxPPEM || maxPPEM == 0xFFFF)) {
+            range->fMin = minPPEM;
             range->fMax = maxPPEM;
             range->fFlags = rangeTable->flags;
             return true;


But the specification is ambiguous as the examples do not explain fractional font sizes well. I've reached out to Peter Constable and others for clarification.


Comment 8 by bungeman@google.com, Mar 30 2017

I suppose it depends on what one means by 'inclusive'.

  <gasp>
    <gaspRange rangeMaxPPEM="8" rangeGaspBehavior="10"/>
    <gaspRange rangeMaxPPEM="17" rangeGaspBehavior="5"/>
    <gaspRange rangeMaxPPEM="65535" rangeGaspBehavior="15"/>
  </gasp>


means the ranges

ppem<=8
9<=ppem<=17
18<=ppem<=inf

however these are integers. There are a few different ways to interpret these ranges for non-integers

This is what Skia currently does (truncation)
ppem<=8.99999
9.0<=ppem<=17.99999
18.0<=ppem<=inf

It appears maybe Firefox is treating this as (rounding)
ppem<=8.5
8.5<=ppem<=17.5
17.5<=ppem<=inf

And I have no explanation for Edge.

In any event I put together https://skia-review.googlesource.com/c/10751 which uses the same size here as the other places the gasp table is used.

We could test for size 0xFFFF but if 'size' is ever that big when we get here we won't be using these flags anyway (we'll just be getting the outlines and drawing from those).

Comment 9 by drott@chromium.org, Mar 30 2017

We can land this as an interim fix, but Edge is using symmetric at 17px, I think we should match that.
Project Member

Comment 10 by bugdroid1@chromium.org, Mar 30 2017

The following revision refers to this bug:
  https://skia.googlesource.com/skia/+/b1f76531f673854135b19fa4342c0d085be2bf29

commit b1f76531f673854135b19fa4342c0d085be2bf29
Author: Ben Wagner <bungeman@google.com>
Date: Thu Mar 30 16:23:27 2017

Use the rounded text size for gasp.

When comparing against gasp ranges always use the rounded (gdi) size.
Previously the truncated size was used, but it appears other
implementations are using the rounded size.

BUG= chromium:706693 

Change-Id: I0f545175bf2d5f4e8db610b26c2f3e21a89eeb2a
Reviewed-on: https://skia-review.googlesource.com/10751
Reviewed-by: Dominik Röttsches <drott@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Ben Wagner <bungeman@google.com>

[modify] https://crrev.com/b1f76531f673854135b19fa4342c0d085be2bf29/src/ports/SkScalerContext_win_dw.cpp

Project Member

Comment 11 by bugdroid1@chromium.org, Mar 30 2017

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

commit e5a16b7e69683d64574421ec0287997639bca765
Author: skia-deps-roller@chromium.org <skia-deps-roller@chromium.org>
Date: Thu Mar 30 21:19:48 2017

Roll src/third_party/skia/ 13071c5c7..609e7ccc6 (11 commits)

https://skia.googlesource.com/skia.git/+log/13071c5c7aa5..609e7ccc664f

$ git log 13071c5c7..609e7ccc6 --date=short --no-merges --format='%ad %ae %s'
2017-03-30 jvanverth Add glPolygonMode support.
2017-03-29 mtklein make _win.S know if it's 64-bit
2017-03-30 ethannicholas Revert "skslc can now be compiled with no Skia dependencies, in preparation for"
2017-03-30 ethannicholas skslc can now be compiled with no Skia dependencies, in preparation for its eventual role in Skia's build process.
2017-03-30 msarett Make xformer class for SkCSXCanvas, use for draw loopers
2017-03-30 bungeman Use the rounded text size for gasp.
2017-03-30 robertphillips Minor cleanup (remove unused GrRenderTargetContext::asTexture method)
2017-03-30 bsalomon Use correct tolerance for conic chopping in MSAA and default path renderers
2017-03-29 bungeman Update instructions on Skia/Chromium multi try.
2017-03-29 bungeman Use last value for axis for variation position.
2017-03-30 bsalomon Renames of processor analysis-related classes and method.

Created with:
  roll-dep src/third_party/skia
BUG= 706693 , 674878 


Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+/master/autoroll/README.md

If the roll is causing failures, see:
http://www.chromium.org/developers/tree-sheriffs/sheriff-details-chromium#TOC-Failures-due-to-DEPS-rolls


CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_trusty_blink_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;master.tryserver.chromium.android:android_optional_gpu_tests_rel
TBR=stephana@chromium.org

Change-Id: Idf9ea1e89298b6feb93f7666bd555ea222ab80a1
Reviewed-on: https://chromium-review.googlesource.com/463806
Reviewed-by: Skia Deps Roller <skia-deps-roller@chromium.org>
Commit-Queue: Skia Deps Roller <skia-deps-roller@chromium.org>
Cr-Commit-Position: refs/heads/master@{#460881}
[modify] https://crrev.com/e5a16b7e69683d64574421ec0287997639bca765/DEPS

Comment 12 by drott@chromium.org, Mar 31 2017

Status: Fixed (was: Assigned)
ajha@, thanks for the report again. Could you verify this as soon as the Canaray includes #460881?

Comment 13 by ajha@chromium.org, Mar 31 2017

Status: Assigned (was: Fixed)
Tested this on the latest canary version: 59.0.3057.0(committed @460966) which contains the fix from C#10 and skia roll in C#11.

Still seeing the issue on the latest canary hence reopening for further investigation. Screenshot attached.

drott@/bungeman@: Could you please take a look at this.

Thanks in advance!
706693_postfix.png
13.5 KB View Download

Comment 14 by drott@chromium.org, Mar 31 2017

Indeed, http://roettsch.es/arialgmail.html still shows the asymmetric rendering mode for 17.6px for me as well. Could you take a look, Ben?
Cc: drott@chromium.org kojii@chromium.org
 Issue 707752  has been merged into this issue.

Comment 16 by ajha@chromium.org, Apr 5 2017

Just to update, M-59 gets branched mid next week. Would be good to have these(and  Issue 706792 ) Beta blockers fixed before branch point.

Please plan the fix accordingly.

Thanks in advance!
Project Member

Comment 17 by bugdroid1@chromium.org, Apr 5 2017

The following revision refers to this bug:
  https://skia.googlesource.com/skia/+/ea0765224a595ed42a9ad713a87db16b4211e5f0

commit ea0765224a595ed42a9ad713a87db16b4211e5f0
Author: Ben Wagner <bungeman@google.com>
Date: Wed Apr 05 17:28:48 2017

Use the rounded text size for gasp.

When comparing against gasp ranges always use the rounded (gdi) size.
Previously the truncated size was used, but it appears other
implementations are using the rounded size.

BUG= chromium:706693 

Change-Id: I185cdf5b905261038e5150a04eef1b99bf73d875
Reviewed-on: https://skia-review.googlesource.com/11354
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>

[modify] https://crrev.com/ea0765224a595ed42a9ad713a87db16b4211e5f0/src/ports/SkScalerContext_win_dw.cpp

Project Member

Comment 18 by bugdroid1@chromium.org, Apr 5 2017

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

commit 84e5378049c4ae1c361c0bfacfb11ecec487ef2a
Author: skia-deps-roller@chromium.org <skia-deps-roller@chromium.org>
Date: Wed Apr 05 22:02:25 2017

Roll src/third_party/skia/ babb10129..2d2ac3d16 (10 commits)

https://skia.googlesource.com/skia.git/+log/babb10129178..2d2ac3d1629c

$ git log babb10129..2d2ac3d16 --date=short --no-merges --format='%ad %ae %s'
2017-04-05 mtklein remove trace and registers stages
2017-04-05 mtklein jumper, load_u16_be and store_u16_be
2017-04-05 robertphillips Revert "Rm readPixels from GrSurface & move read/writeSurfacePixels to GrContextPriv (take 2)"
2017-04-05 msarett Delete SkPixelRef::readPixels()
2017-04-05 reed remove android legacy flags
2017-04-05 mikejurka Refactor Vulkan support to support Fuchsia
2017-04-05 bungeman Use the rounded text size for gasp.
2017-04-05 reed hide most details of SkPatchUtils
2017-04-05 brianosman Remove texture sampling from GrConfigConversionEffect
2017-04-05 robertphillips Rm readPixels from GrSurface & move read/writeSurfacePixels to GrContextPriv (take 2)

Created with:
  roll-dep src/third_party/skia
BUG= 706693 


Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+/master/autoroll/README.md

If the roll is causing failures, see:
http://www.chromium.org/developers/tree-sheriffs/sheriff-details-chromium#TOC-Failures-due-to-DEPS-rolls


CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_trusty_blink_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;master.tryserver.chromium.android:android_optional_gpu_tests_rel
TBR=jvanverth@chromium.org

Change-Id: I3420a778d50ea5efe654ac32aea3bed805841c1d
Reviewed-on: https://chromium-review.googlesource.com/469169
Reviewed-by: Skia Deps Roller <skia-deps-roller@chromium.org>
Commit-Queue: Skia Deps Roller <skia-deps-roller@chromium.org>
Cr-Commit-Position: refs/heads/master@{#462237}
[modify] https://crrev.com/84e5378049c4ae1c361c0bfacfb11ecec487ef2a/DEPS

Comment 19 by ajha@chromium.org, Apr 6 2017

Labels: TE-Verified-M59 TE-Verified-59.0.3064.0
Thanks ben@ for quicx fix. This seems to be working fine on the latest M-59(59.0.3064.0) which contains the fix. Attaching the screenshot and adding the verified label.


706693_fixed.png
112 KB View Download

Comment 20 by drott@chromium.org, Apr 10 2017

Status: Verified (was: Assigned)

Sign in to add a comment