| Summary: | [Win] Remove obsolete useGDI code path and FontRenderingMode enum | ||||||
|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Fujii Hironori <Hironori.Fujii> | ||||
| Component: | Text | Assignee: | Fujii Hironori <Hironori.Fujii> | ||||
| Status: | RESOLVED FIXED | ||||||
| Severity: | Normal | CC: | achristensen, bfulgham, mmaxfield, pvollan, webkit-bug-importer | ||||
| Priority: | P2 | Keywords: | InRadar | ||||
| Version: | WebKit Nightly Build | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| Attachments: |
|
||||||
|
Description
Fujii Hironori
2020-01-14 19:22:24 PST
Oh, it is being used for CGContextSetShouldUsePlatformNativeGlyphs. https://trac.webkit.org/browser/webkit/trunk/Source/WebCore/platform/graphics/win/FontCGWin.cpp?rev=238253 > CGContextSetShouldUsePlatformNativeGlyphs(cgContext, usePlatformNativeGlyphs); Does AppleWin port still use useGDI code path? Oops, usePlatformNativeGlyphs is always false. https://trac.webkit.org/browser/webkit/trunk/Source/WebCore/platform/graphics/win/FontCGWin.cpp?rev=254556#L177 Oh, no. comment 2 was wrong. isPrinterFont is always false, usePlatformNativeGlyphs is font.platformData().useGDI(). Created attachment 387758 [details]
minibrowser.exe.plist to enable useGDI
There are two ways to enable useGDI code path for AppleWin MiniBrowser.
1. applying the following patch
diff --git a/Tools/MiniBrowser/win/WebKitLegacyBrowserWindow.cpp b/Tools/MiniBrowser/win/WebKitLegacyBrowserWindow.cpp
index f81a9be39f3..a062b973aca 100644
--- a/Tools/MiniBrowser/win/WebKitLegacyBrowserWindow.cpp
+++ b/Tools/MiniBrowser/win/WebKitLegacyBrowserWindow.cpp
@@ -297,6 +297,7 @@ bool WebKitLegacyBrowserWindow::setToDefaultPreferences()
m_standardPreferences->setJavaScriptEnabled(TRUE);
m_prefsPrivate->setAllowUniversalAccessFromFileURLs(FALSE);
m_prefsPrivate->setAllowFileAccessFromFileURLs(TRUE);
+ m_standardPreferences->setFontSmoothing(FontSmoothingTypeWindows);
m_prefsPrivate->setDeveloperExtrasEnabled(TRUE);
2. put this minibrowser.exe.plist to %userprofile%\AppData\Roaming\Apple Computer\Preferences
I don't know AppleWin is still using useGDI code path, but it is still valid code path to work as expected. Closed as INVALID. (In reply to Fujii Hironori from comment #1) > Oh, it is being used for CGContextSetShouldUsePlatformNativeGlyphs. > > https://trac.webkit.org/browser/webkit/trunk/Source/WebCore/platform/ > graphics/win/FontCGWin.cpp?rev=238253 > > > CGContextSetShouldUsePlatformNativeGlyphs(cgContext, usePlatformNativeGlyphs); > > Does AppleWin port still use useGDI code path? I don't believe it is still being used. Can i remove it ? (In reply to Fujii Hironori from comment #7) > Can i remove it ? I think so, but it would be good to confirm with Brent or Alex. The default is FontRenderingMode::Normal, but it looks like users can override that by setting a preference. It looks like that preference is set by placing a .plist in a specific place (as Fujii found in https://bugs.webkit.org/show_bug.cgi?id=206273#c4). I think this is a tradeoff between the pros of eliminating maintenance burden against the cons of making some (specific) Windows users' text look different. In this case, because the change is somewhat subtle, and because it's difficult to imagine someone going through the trouble of putting a plist in a specific place on the filesystem on Windows just to get their iTunes text to look slightly different, I think maintenance burden wins, and we can just delete this. Pull request: https://github.com/WebKit/WebKit/pull/10756 Committed 261133@main (21e5a249467d): <https://commits.webkit.org/261133@main> Reviewed commits have been landed. Closing PR #10756 and removing active labels. |