Anti-alias will be applied unexpectedly to the small size font under HWA off + Clear Type ON

RESOLVED FIXED in Firefox 51

Status

()

Core
Graphics: Text
RESOLVED FIXED
a year ago
a year ago

People

(Reporter: Alice0775 White, Assigned: mchang)

Tracking

({jp-critical, regression})

51 Branch
mozilla51
x86
Windows 10
jp-critical, regression
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox48 unaffected, firefox49 unaffected, firefox50 unaffected, firefox51- fixed)

Details

(Whiteboard: [gfx-noted])

Attachments

(3 attachments)

(Reporter)

Description

a year ago
Created attachment 8787503 [details]
testcase

[Tracking Requested - why for this release]:

This is font specific. (MS PGothic, MS Gothic, MS PMincho, MS Mincho)

Steps To Reproduce:
1. Disable HWA and restart
2. Open attached testcase

Actual Results:
The small size of the fonts are ugly rendering(hard to read). 
Clear Type will be applied unexpectedly to the small size font

Expected Results
Clear Type should not be applied unexpectedly to the small size font
(Reporter)

Comment 1

a year ago
Created attachment 8787504 [details]
screenshot
(Reporter)

Comment 2

a year ago
Graphics
--------

Features
Compositing: Basic
Asynchronous Pan/Zoom: none
WebGL Renderer: Google Inc. -- ANGLE (AMD Radeon HD 6450 Direct3D9Ex vs_3_0 ps_3_0)
WebGL2 Renderer: ATI Technologies Inc. -- AMD Radeon HD 6450
Hardware H264 Decoding: No; Hardware video decoding disabled or blacklisted
Audio Backend: wasapi
DirectWrite: true (10.0.14393.0)
GPU #1
Active: Yes
Description: AMD Radeon HD 6450
Vendor ID: 0x1002
Device ID: 0x6779
Driver Version: 15.301.1901.0
Driver Date: 2-26-2016
Drivers: aticfx64 aticfx64 aticfx64 amdxc64 aticfx32 aticfx32 aticfx32 amdxc32 atiumd64 atidxx64 atidxx64 atiumdag atidxx32 atidxx32 atiumdva atiumd6a atitmm64
Subsys ID: 23111787
RAM: 1024

Diagnostics
ClearType Parameters: Gamma: 2.2 Pixel Structure: RGB ClearType Level: 100 Enhanced Contrast: 200
AzureCanvasAccelerated: 0
AzureCanvasBackend: skia
AzureContentBackend: skia
AzureFallbackCanvasBackend: cairo
ClearType Parameters: Gamma: 2.2 Pixel Structure: RGB ClearType Level: 100 Enhanced Contrast: 200
Decision Log
HW_COMPOSITING:
disabled by user: Disabled by pref
D3D11_COMPOSITING:
unavailable by default: Hardware compositing is disabled
D3D9_COMPOSITING:
unavailable by default: Hardware compositing is disabled
DIRECT2D:
unavailable by default: Direct2D requires Direct3D 11 compositing
D3D11_HW_ANGLE:
unavailable by default: D3D11 compositing is disabled
disabled by env: D3D11 compositing is disabled
(Reporter)

Updated

a year ago
Depends on: 1299903
Whiteboard: [DUPEME]
(Reporter)

Updated

a year ago
No longer depends on: 1299903
Whiteboard: [DUPEME] → [DUPEME] [gfx-noted]
(Assignee)

Updated

a year ago
Assignee: nobody → mchang
(Assignee)

Comment 3

a year ago
I manually verified this. With cairo, it looks like some fonts have subpixel AA on this test case, but not the small one. Bug 1298484 fixes this test case for me locally on Windows 7 as the small fonts are too small to be rendered with grayscale AA I suppose. After Bug 1298484, please double check if this still needs to be fixed. Thanks!
(Reporter)

Comment 4

a year ago
(In reply to Mason Chang [:mchang] from comment #3)
> I manually verified this. With cairo, it looks like some fonts have subpixel
> AA on this test case, but not the small one. Bug 1298484 fixes this test
> case for me locally on Windows 7 as the small fonts are too small to be
> rendered with grayscale AA I suppose. After Bug 1298484, please double check
> if this still needs to be fixed. Thanks!

Unfortunately, Bug 1298484 did not fix this.

https://hg.mozilla.org/integration/mozilla-inbound/rev/88222d0a92668a99c47602aa2a0968df4ebe7e98
Mozilla/5.0 (Windows NT 10.0; WOW64; rv:51.0) Gecko/20100101 Firefox/51.0 ID:20160902150049
(Reporter)

Updated

a year ago
Whiteboard: [DUPEME] [gfx-noted] → [gfx-noted]
(Reporter)

Comment 5

a year ago
To be clear,
Windows10 ClearType ON + Nightly51.0a1 HWA OFF


Actual Results:
The small size of the fonts are ugly rendering(hard to read). 
Anti-alias(Outline font) will be applied unexpectedly to the small size font

Expected Results
The small size of the font should be rendered as BitMap font
Summary: Clear Type will be applied unexpectedly to the small size font under HWA off → Anti-alias will be applied unexpectedly to the small size font under HWA off + Clear Type ON
status-firefox48: --- → unaffected
status-firefox49: --- → unaffected
(Assignee)

Updated

a year ago
See Also: → bug 1299985
(Assignee)

Comment 6

a year ago
Created attachment 8789093 [details] [diff] [review]
Use embedded bitmaps for CJK fonts

Thanks to Jonathan, we have a Chinese Japanese or Korean font and it has a bitmap, skia currently ignores it. Also, our font code [1] checks for this case and disables AA for cairo. When Cairo renders a bitmap font, it also does this weird GDI DWrite interop rendering method. This patch checks for this case when creating the scaled font, which sets a pref to enable embedded bitmap strikes [2], which fixes this case for me.

[1] http://searchfox.org/mozilla-central/source/gfx/thebes/gfxDWriteFonts.cpp#202
[2] http://searchfox.org/mozilla-central/source/gfx/skia/skia/include/core/SkPaint.h#110
Attachment #8789093 - Flags: review?(lsalzman)
Attachment #8789093 - Flags: review?(lsalzman) → review+

Comment 8

a year ago
Pushed by mchang@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/f9bd32e801c8
Use embedded bitmaps in CJK fonts with skia on Windows. r=lsalzman

Comment 9

a year ago
Pushed by mchang@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/67bbc7bdd72d
Fix build bustage on non-windows. r=me. CLOSED TREE

Comment 10

a year ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/f9bd32e801c8
https://hg.mozilla.org/mozilla-central/rev/67bbc7bdd72d
Status: NEW → RESOLVED
Last Resolved: a year ago
status-firefox51: affected → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla51
(Assignee)

Comment 11

a year ago
Can you please verify this is fixed for you? Thanks!
Flags: needinfo?(alice0775)
(Reporter)

Comment 12

a year ago
The problem is reproduced on Nghtly51.0a1(2016-Sep-08)
https://hg.mozilla.org/mozilla-central/rev/938ce16be25f9c551c19ef8938e8717ed3d41ff5
Mozilla/5.0 (Windows NT 10.0; WOW64; rv:51.0) Gecko/20100101 Firefox/51.0 ID:20160908030434

And I can verify that the problem is fixed on Nghtly51.0a1(2016-Sep-09)
https://hg.mozilla.org/mozilla-central/rev/feff79e5b1374439f17c5ea10a559acf1380a8d5
Mozilla/5.0 (Windows NT 10.0; WOW64; rv:51.0) Gecko/20100101 Firefox/51.0 ID:20160909030428
Flags: needinfo?(alice0775)
Since the fix was verified in Comment 12, no need to track this for 51.
tracking-firefox51: ? → -
You need to log in before you can comment on or make changes to this bug.