Bug 223861

Summary: [WinCairo] Custom fonts don't work in GPU process mode
Product: WebKit Reporter: Fujii Hironori <Hironori.Fujii>
Component: PlatformAssignee: Fujii Hironori <Hironori.Fujii>
Status: RESOLVED FIXED    
Severity: Normal CC: annulen, don.olmstead, ews-watchlist, gyuyoung.kim, mmaxfield, pvollan, ryuan.choi, sergio, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch none

Description Fujii Hironori 2021-03-28 20:02:04 PDT
[WinCairo] Custom fonts don't work in GPU process mode

The following some canvas tests are failing in WinCairo WebKit2 layout tests.

  canvas/philip/tests/2d.text.draw.align.center.html [ Failure ]
  canvas/philip/tests/2d.text.draw.align.end.ltr.html [ Failure ]
  canvas/philip/tests/2d.text.draw.align.end.rtl.html [ Failure ]
  canvas/philip/tests/2d.text.draw.align.left.html [ Failure ]
  canvas/philip/tests/2d.text.draw.align.right.html [ Failure ]
  canvas/philip/tests/2d.text.draw.align.start.ltr.html [ Failure ]
  canvas/philip/tests/2d.text.draw.align.start.rtl.html [ Failure ]
  canvas/philip/tests/2d.text.draw.baseline.alphabetic.html [ Failure ]
  canvas/philip/tests/2d.text.draw.fill.maxWidth.bound.html [ Failure ]
  canvas/philip/tests/2d.text.draw.fontface.html [ Failure ]
  canvas/philip/tests/2d.text.draw.fontface.notinpage.html [ Failure ]
  canvas/philip/tests/2d.text.draw.fontface.repeat.html [ Failure ]
  canvas/philip/tests/2d.text.draw.space.basic.html [ Failure ]
  canvas/philip/tests/2d.text.draw.space.collapse.nonspace.html [ Failure ]

See also:
  Bug 223500 – [WinCairo] ASSERTION FAILED: isMainThread() in GPU process for some canvas/philip/tests tests
  Bug 222835 – [GPUP] Enable 2D Canvas in layout tests by default
Comment 1 Fujii Hironori 2021-03-28 20:18:12 PDT
Created attachment 424520 [details]
Patch
Comment 2 Fujii Hironori 2021-03-28 23:48:02 PDT
Created attachment 424529 [details]
Patch
Comment 3 Don Olmstead 2021-03-29 13:05:59 PDT
Comment on attachment 424529 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=424529&action=review

> Source/WebCore/platform/graphics/opentype/FontMemoryResource.h:55
> +    HANDLE m_fontResourceHandle;

Do you have plans to make this class cross platform?

If not maybe it should be in a win directory.
Comment 4 Fujii Hironori 2021-03-29 13:29:40 PDT
Comment on attachment 424529 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=424529&action=review

Thank you very much.

>> Source/WebCore/platform/graphics/opentype/FontMemoryResource.h:55
>> +    HANDLE m_fontResourceHandle;
> 
> Do you have plans to make this class cross platform?
> 
> If not maybe it should be in a win directory.

Yes, that mattered to me. However, I put it in the 'opentype' directory.
Because OpenTypeUtilities.{h, cpp} also Windows specific and FontMemoryResource are used mainly by them.
If I put FontMemoryResource.h in 'win' directory, source files in 'win' directory include OpenTypeUtilities.h and it includes FontMemoryResource.h in 'win' directory.
This bi-directional inclusion doesn't make me take the approach.
Comment 5 Fujii Hironori 2021-03-29 13:32:42 PDT
Comment on attachment 424529 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=424529&action=review

>>> Source/WebCore/platform/graphics/opentype/FontMemoryResource.h:55
>>> +    HANDLE m_fontResourceHandle;
>> 
>> Do you have plans to make this class cross platform?
>> 
>> If not maybe it should be in a win directory.
> 
> Yes, that mattered to me. However, I put it in the 'opentype' directory.
> Because OpenTypeUtilities.{h, cpp} also Windows specific and FontMemoryResource are used mainly by them.
> If I put FontMemoryResource.h in 'win' directory, source files in 'win' directory include OpenTypeUtilities.h and it includes FontMemoryResource.h in 'win' directory.
> This bi-directional inclusion doesn't make me take the approach.

I don't have the plan.
Comment 6 Fujii Hironori 2021-03-29 13:47:17 PDT
Comment on attachment 424529 [details]
Patch

Clearing flags on attachment: 424529

Committed r275174 (235877@main): <https://commits.webkit.org/235877@main>
Comment 7 Fujii Hironori 2021-03-29 13:47:21 PDT
All reviewed patches have been landed.  Closing bug.
Comment 8 Radar WebKit Bug Importer 2021-03-29 13:48:12 PDT
<rdar://problem/75971238>