Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(207)

Issue 879533003: Remove Mac native font type members from FontPlatformData (Closed)

Created:
5 years, 11 months ago by Dominik Röttsches
Modified:
5 years, 9 months ago
CC:
blink-reviews, krit, Rik, jbroman, danakj, pdr+graphicswatchlist_chromium.org, f(malita), Stephen Chennney, rwlbuis
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Target Ref:
refs/heads/master
Project:
blink
Visibility:
Public.

Description

Remove Mac native font type members from FontPlatformData FontPlatformData keeps several Mac specific font members around, NSFont, ctFont, cgFont, while all other platforms rely on just using an SkTypeface. This leads to a lot of ifdefs in the code, confusion about which member is currently instantiated and a history of null-dereference crashes on Mac due to hard to track failures of font instantiation. After we got access to a CTFont object from an SkTypeface for compatibility with HarfBuzz AAT shaping and clipboard text export [1], I suggest to remove the native handles and focus on using SkTypefaces. This allows us as well to remove a lot of mostly redundant platform-specific code on Mac. [1] https://codereview.chromium.org/872963003/ BUG=414234 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=192506

Patch Set 1 #

Patch Set 2 : FontCustomPlatformData Mac no longer platform specific #

Patch Set 3 : Removing MemoryActivatedFont #

Patch Set 4 : OOP loading for non-system location works, dfont loaded from system #

Patch Set 5 : Rebase after RenderStyle -> LayoutStyle rename #

Patch Set 6 : Fix non mac platform compilation #

Patch Set 7 : Removing getNSFont from SimpleFontData #

Total comments: 10

Patch Set 8 : Memory management review comments addressed #

Total comments: 17

Patch Set 9 : Additional review comments addressed #

Patch Set 10 : Rebased TestExpectations #

Total comments: 1

Patch Set 11 : Canvas text metrics test does not need rebaselining after improvement landed, toNSFont in WebSubstringUtil.mm #

Unified diffs Side-by-side diffs Delta from patch set Stats (+138 lines, -828 lines) Patch
M LayoutTests/TestExpectations View 1 2 3 4 5 6 7 8 9 10 1 chunk +11 lines, -0 lines 0 comments Download
M Source/platform/blink_platform.gyp View 1 2 3 4 5 6 7 2 chunks +0 lines, -6 lines 0 comments Download
M Source/platform/blink_platform.gypi View 1 2 3 4 5 6 7 8 9 10 3 chunks +1 line, -4 lines 0 comments Download
M Source/platform/fonts/FontCustomPlatformData.h View 1 2 3 2 chunks +0 lines, -11 lines 0 comments Download
A + Source/platform/fonts/FontCustomPlatformData.cpp View 1 2 3 1 chunk +1 line, -3 lines 0 comments Download
M Source/platform/fonts/FontPlatformData.h View 1 2 3 4 5 6 7 4 chunks +5 lines, -37 lines 0 comments Download
M Source/platform/fonts/FontPlatformData.cpp View 1 2 3 4 5 12 chunks +20 lines, -72 lines 0 comments Download
M Source/platform/fonts/SimpleFontData.h View 1 2 3 4 5 6 7 1 chunk +0 lines, -4 lines 0 comments Download
M Source/platform/fonts/mac/FontCacheMac.mm View 1 2 3 4 5 6 7 8 3 chunks +20 lines, -17 lines 0 comments Download
D Source/platform/fonts/mac/FontCustomPlatformDataMac.cpp View 1 2 1 chunk +0 lines, -78 lines 0 comments Download
M Source/platform/fonts/mac/FontPlatformDataMac.mm View 1 2 3 4 5 6 7 8 2 chunks +78 lines, -176 lines 0 comments Download
D Source/platform/fonts/mac/MemoryActivatedFont.h View 1 2 1 chunk +0 lines, -95 lines 0 comments Download
M Source/platform/fonts/mac/MemoryActivatedFont.mm View 1 2 1 chunk +0 lines, -207 lines 0 comments Download
D Source/platform/fonts/skia/FontCustomPlatformDataSkia.cpp View 1 2 1 chunk +0 lines, -117 lines 0 comments Download
M Source/web/mac/WebSubstringUtil.mm View 1 2 3 4 5 6 7 8 9 10 1 chunk +2 lines, -1 line 0 comments Download

Messages

Total messages: 32 (8 generated)
Dominik Röttsches
Very early stages, and need to check a lot of things still, but it's displaying ...
5 years, 11 months ago (2015-01-26 18:22:16 UTC) #2
eae
On 2015/01/26 18:22:16, Dominik Röttsches wrote: > Very early stages, and need to check a ...
5 years, 10 months ago (2015-02-10 15:40:45 UTC) #3
Dominik Röttsches
The mac failures result from different fallback behavior when falling back from web fonts. Previously, ...
5 years, 10 months ago (2015-02-20 15:50:47 UTC) #5
Robert Sesek
Can you update the CL description? What is this CL trying to accomplish? Are there ...
5 years, 10 months ago (2015-02-20 17:39:23 UTC) #6
eae
That sounds like the right long term approach. For now the current behavior seems fine.
5 years, 10 months ago (2015-02-20 19:26:48 UTC) #7
Dominik Röttsches
> Can you update the CL description? Updated, hope this helps. > What is this ...
5 years, 10 months ago (2015-02-23 12:42:12 UTC) #8
Robert Sesek
https://codereview.chromium.org/879533003/diff/120001/Source/platform/fonts/mac/FontCacheMac.mm File Source/platform/fonts/mac/FontCacheMac.mm (right): https://codereview.chromium.org/879533003/diff/120001/Source/platform/fonts/mac/FontCacheMac.mm#newcode120 Source/platform/fonts/mac/FontCacheMac.mm:120: NSFont* nsFont = const_cast<NSFont*>(reinterpret_cast<const NSFont*>(platformData.ctFont())); Can you create something ...
5 years, 10 months ago (2015-02-24 16:13:08 UTC) #9
Dominik Röttsches
Thank you for the thorough and instructive review, I learned to look closer. There are ...
5 years, 9 months ago (2015-03-19 15:20:00 UTC) #10
Robert Sesek
https://codereview.chromium.org/879533003/diff/140001/Source/platform/fonts/mac/FontPlatformDataMac.mm File Source/platform/fonts/mac/FontPlatformDataMac.mm (right): https://codereview.chromium.org/879533003/diff/140001/Source/platform/fonts/mac/FontPlatformDataMac.mm#newcode31 Source/platform/fonts/mac/FontPlatformDataMac.mm:31: #import "platform/LayoutTestSupport.h" Only #import things that are Objective-C. C++ ...
5 years, 9 months ago (2015-03-19 21:53:45 UTC) #11
Dominik Röttsches
Thanks for your review! https://codereview.chromium.org/879533003/diff/140001/Source/platform/fonts/mac/FontPlatformDataMac.mm File Source/platform/fonts/mac/FontPlatformDataMac.mm (right): https://codereview.chromium.org/879533003/diff/140001/Source/platform/fonts/mac/FontPlatformDataMac.mm#newcode31 Source/platform/fonts/mac/FontPlatformDataMac.mm:31: #import "platform/LayoutTestSupport.h" On 2015/03/19 21:53:45, ...
5 years, 9 months ago (2015-03-20 11:01:07 UTC) #12
Dominik Röttsches
kbr@, japhet@, pfeldman@, tkent@: Could you review the changes in WebStringUtil? Thanks.
5 years, 9 months ago (2015-03-23 08:51:03 UTC) #14
Ken Russell (switch to Gerrit)
WebSubstringUtil.mm LGTM https://codereview.chromium.org/879533003/diff/180001/Source/web/mac/WebSubstringUtil.mm File Source/web/mac/WebSubstringUtil.mm (right): https://codereview.chromium.org/879533003/diff/180001/Source/web/mac/WebSubstringUtil.mm#newcode83 Source/web/mac/WebSubstringUtil.mm:83: NSFont* font = const_cast<NSFont*>(reinterpret_cast<const NSFont*>((fontPlatformData.ctFont()))); Can this ...
5 years, 9 months ago (2015-03-23 18:59:00 UTC) #15
Robert Sesek
What are the changes to the TestExpectations? I wouldn't expect to see any from this ...
5 years, 9 months ago (2015-03-23 19:18:53 UTC) #16
Dominik Röttsches
On 2015/03/23 19:18:53, Robert Sesek wrote: > What are the changes to the TestExpectations? I ...
5 years, 9 months ago (2015-03-24 13:11:00 UTC) #17
Robert Sesek
LGTM
5 years, 9 months ago (2015-03-24 13:50:19 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/879533003/200001
5 years, 9 months ago (2015-03-24 15:43:37 UTC) #21
commit-bot: I haz the power
Try jobs failed on following builders: blink_presubmit on tryserver.blink (JOB_FAILED, http://build.chromium.org/p/tryserver.blink/builders/blink_presubmit/builds/29661)
5 years, 9 months ago (2015-03-24 16:05:30 UTC) #23
Dominik Röttsches
Filed https://codereview.chromium.org/1034523003/
5 years, 9 months ago (2015-03-24 19:43:35 UTC) #24
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/879533003/200001
5 years, 9 months ago (2015-03-25 07:46:01 UTC) #26
commit-bot: I haz the power
Committed patchset #11 (id:200001) as https://src.chromium.org/viewvc/blink?view=rev&revision=192506
5 years, 9 months ago (2015-03-25 07:48:59 UTC) #27
alph
FYI: There are some new failures on Mac. Might be related. http://build.chromium.org/p/chromium.webkit/builders/WebKit%20Mac10.6/builds/38559
5 years, 9 months ago (2015-03-25 10:39:47 UTC) #29
Julien - ping for review
On 2015/03/25 at 10:39:47, alph wrote: > FYI: There are some new failures on Mac. ...
5 years, 9 months ago (2015-03-25 15:32:31 UTC) #30
Julien - ping for review
A revert of this CL (patchset #11 id:200001) has been created in https://codereview.chromium.org/1021483004/ by jchaffraix@chromium.org. ...
5 years, 9 months ago (2015-03-25 15:33:42 UTC) #31
Julien - ping for review
5 years, 9 months ago (2015-03-25 15:53:42 UTC) #32
Message was sent while issue was closed.
On 2015/03/25 at 15:33:42, Julien Chaffraix - PST wrote:
> A revert of this CL (patchset #11 id:200001) has been created in
https://codereview.chromium.org/1021483004/ by jchaffraix@chromium.org.
> 
> The reason for reverting is: The patch broke the Mac GN builder, preventing
the roll:
> 
> ERROR at //third_party/WebKit/Source/platform/BUILD.gn:221:7: Item not found
>       "fonts/skia/FontCustomPlatformDataSkia.cpp",
> 
> It may have also caused some failures on Mac..

For clarity, Loislo took care of the build break and Dominik followed up on the
Mac failures so the revert was reverted. Sorry for the noise.

Powered by Google App Engine
This is Rietveld 408576698