[webkit-changes] [WebKit/WebKit] cca77c: Make "disable font smoothing for testing" setting ...

Cameron McCormack noreply at github.com
Sat Nov 19 23:44:37 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: cca77c936d11e5420b67e06cc3bba364190a24ec
      https://github.com/WebKit/WebKit/commit/cca77c936d11e5420b67e06cc3bba364190a24ec
  Author: Cameron McCormack <heycam at apple.com>
  Date:   2022-11-19 (Sat, 19 Nov 2022)

  Changed paths:
    M Source/WebCore/platform/graphics/FontCascade.cpp
    M Source/WebCore/platform/graphics/FontCascade.h
    M Source/WebCore/platform/graphics/FontCascadeDescription.cpp
    M Source/WebCore/platform/graphics/FontCascadeDescription.h
    M Source/WebCore/platform/graphics/coretext/FontCascadeCoreText.cpp
    M Source/WebCore/platform/graphics/displaylists/DisplayListItems.cpp
    M Source/WebCore/platform/graphics/displaylists/DisplayListItems.h
    M Source/WebCore/platform/text/TextFlags.cpp
    M Source/WebCore/platform/text/TextFlags.h
    M Source/WebCore/rendering/mathml/MathOperator.cpp
    M Source/WebCore/rendering/mathml/RenderMathMLToken.cpp
    M Source/WebCore/testing/Internals.cpp
    M Source/WebCore/testing/Internals.h
    M Source/WebCore/testing/Internals.idl
    M Source/WebKit/Shared/WebProcessCreationParameters.cpp
    M Source/WebKit/Shared/WebProcessCreationParameters.h
    M Source/WebKit/UIProcess/API/C/WKContext.cpp
    M Source/WebKit/UIProcess/API/C/WKContextPrivate.h
    M Source/WebKit/UIProcess/WebProcessPool.cpp
    M Source/WebKit/UIProcess/WebProcessPool.h
    M Source/WebKit/WebProcess/WebProcess.cpp
    M Source/WebKit/WebProcess/WebProcess.h
    M Source/WebKit/WebProcess/WebProcess.messages.in
    M Tools/WebKitTestRunner/TestController.cpp

  Log Message:
  -----------
  Make "disable font smoothing for testing" setting work with GPU process
https://bugs.webkit.org/show_bug.cgi?id=248063
rdar://102449449

Reviewed by Simon Fraser.

Processes have a global variable in FontCascade.cpp to represent whether
font smoothing should be forced off for testing purposes.
WebKitTestRunner creates a WebProcessPool that initially has
m_useFontSmoothingForTesting = false, and when the WebProcessPool
creates a new Web process, it passes the current
m_useFontSmoothingForTesting value as part of the
WebProcessCreationParameters. And if a test turns smoothing back on
explicitly, WebKitTestRunner will tell the WebProcessPool, which
broadcasts the update to all of the current Web processes.

We don't however pass this state to the GPU process when it is created
by the WebProcessPool, or when WebKitTestRunner encounters a test that
turns smoothing back on, which means that the GPU process never inhibits
smoothing.

This change:

- renames the "use font smoothing for testing" concept to "disable font
  subpixel antialiasing", which more clearly and accurately conveys what
  it does, in the words of FontSmoothingMode

- removes the Internals function that can re-allow font smoothing,
  since it's unused

- calls the WKContext C API function just once, rather than before each
  test, since tests can no longer change the smoothing disabled state

- removes the check for the global variable in FontCascade::drawGlyphs
  and modifies the FontSmoothingMode passed in to
  GraphicsContext::drawGlyphs instead (by having
  FontCascadeDescription::smoothingMode change it according to the
  global variable's state), so that it's captured as part of the
  DrawGlyphs display list item

* Source/WebCore/platform/graphics/FontCascade.cpp:
(WebCore::FontCascade::setDisableFontSubpixelAntialiasingForTesting):
(WebCore::FontCascade::shouldDisableFontSubpixelAntialiasingForTesting):
(WebCore::FontCascade::drawGlyphBuffer const):
(WebCore::FontCascade::setShouldUseSmoothingForTesting): Deleted.
(WebCore::FontCascade::shouldUseSmoothingForTesting): Deleted.
* Source/WebCore/platform/graphics/FontCascade.h:
* Source/WebCore/platform/graphics/FontCascadeDescription.cpp:
(WebCore::FontCascadeDescription::usedFontSmoothing const):
* Source/WebCore/platform/graphics/FontCascadeDescription.h:
* Source/WebCore/platform/graphics/coretext/FontCascadeCoreText.cpp:
(WebCore::FontCascade::drawGlyphs):
* Source/WebCore/platform/graphics/displaylists/DisplayListItems.cpp:
(WebCore::DisplayList::dumpItem):
* Source/WebCore/platform/graphics/displaylists/DisplayListItems.h:
(WebCore::DisplayList::DrawGlyphs::fontSmoothingMode const):
* Source/WebCore/platform/text/TextFlags.cpp:
(WebCore::operator<<):
* Source/WebCore/platform/text/TextFlags.h:
* Source/WebCore/rendering/mathml/MathOperator.cpp:
(WebCore::MathOperator::paintGlyph):
* Source/WebCore/rendering/mathml/RenderMathMLToken.cpp:
(WebCore::RenderMathMLToken::paint):
* Source/WebCore/testing/Internals.cpp:
(WebCore::Internals::setFontSmoothingEnabled): Deleted.
* Source/WebCore/testing/Internals.h:
* Source/WebCore/testing/Internals.idl:
* Source/WebKit/Shared/WebProcessCreationParameters.cpp:
(WebKit::WebProcessCreationParameters::encode const):
(WebKit::WebProcessCreationParameters::decode):
* Source/WebKit/Shared/WebProcessCreationParameters.h:
* Source/WebKit/UIProcess/API/C/WKContext.cpp:
(WKContextSetDisableFontSubpixelAntialiasingForTesting):
(WKContextSetShouldUseFontSmoothingForTesting): Deleted.
* Source/WebKit/UIProcess/API/C/WKContextPrivate.h:
* Source/WebKit/UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::initializeNewWebProcess):
(WebKit::WebProcessPool::setDisableFontSubpixelAntialiasingForTesting):
(WebKit::WebProcessPool::setShouldUseFontSmoothingForTesting): Deleted.
* Source/WebKit/UIProcess/WebProcessPool.h:
* Source/WebKit/WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeWebProcess):
(WebKit::WebProcess::setDisableFontSubpixelAntialiasingForTesting):
(WebKit::WebProcess::setShouldUseFontSmoothingForTesting): Deleted.
* Source/WebKit/WebProcess/WebProcess.h:
* Source/WebKit/WebProcess/WebProcess.messages.in:
* Tools/WebKitTestRunner/TestController.cpp:
(WTR::TestController::generatePageConfiguration):
(WTR::TestController::resetStateToConsistentValues):

Canonical link: https://commits.webkit.org/256885@main




More information about the webkit-changes mailing list