Changeset 285410 in webkit


Ignore:
Timestamp:
Nov 8, 2021 9:57:56 AM (8 months ago)
Author:
Wenson Hsieh
Message:

Enabling "media source inline painting" by default should work when using GPU Process for media
https://bugs.webkit.org/show_bug.cgi?id=232802

Reviewed by Eric Carlson.

Source/WebCore:

See WebKit/ChangeLog for more details.

  • page/RuntimeEnabledFeatures.h:

Source/WebKit:

Propagate the bit for MediaSourceInlinePaintingEnabled over to the GPU process when updating preferences in
GPUProcessProxy.

  • GPUProcess/GPUProcess.cpp:

(WebKit::GPUProcess::setMediaSourceInlinePaintingEnabled):

  • GPUProcess/GPUProcess.h:
  • GPUProcess/GPUProcess.messages.in:
  • UIProcess/GPU/GPUProcessProxy.cpp:

(WebKit::GPUProcessProxy::updatePreferences):

Also, add a couple of FIXMEs here. Note that due to the latter FIXME, this change *still* doesn't allow us to
turn on media source inline painting when using GPU process for media by simply toggling the feature in user
defaults or through UI. This is because preferences on WebPageGroups are not modified when changing experimental
feature user defaults, so logic that iterates through all page groups and looks at preferences will still only
get the default value of each feature flag (as defined in the yaml file).

Source/WTF:

Clean up this experimental feature -- since it's backed by a global RuntimeEnabledFeature, we should:

  1. Add webcoreBinding: RuntimeEnabledFeatures, and also:
  2. Not be adding the corresponding page-scoped WebCore setting as well.

This adjustment makes it possible to enable this experimental feature when the GPU process is disabled, since
we now actually call into RuntimeEnabledFeatures to set the value (instead of just setting the WebCore setting
which wasn't consulted by anything).

  • Scripts/Preferences/WebPreferencesExperimental.yaml:
Location:
trunk/Source
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/ChangeLog

    r285407 r285410  
     12021-11-08  Wenson Hsieh  <wenson_hsieh@apple.com>
     2
     3        Enabling "media source inline painting" by default should work when using GPU Process for media
     4        https://bugs.webkit.org/show_bug.cgi?id=232802
     5
     6        Reviewed by Eric Carlson.
     7
     8        Clean up this experimental feature -- since it's backed by a global RuntimeEnabledFeature, we should:
     9        1. Add `webcoreBinding: RuntimeEnabledFeatures`, and also:
     10        2. Not be adding the corresponding page-scoped WebCore setting as well.
     11
     12        This adjustment makes it possible to enable this experimental feature when the GPU process is disabled, since
     13        we now actually call into RuntimeEnabledFeatures to set the value (instead of just setting the WebCore setting
     14        which wasn't consulted by anything).
     15
     16        * Scripts/Preferences/WebPreferencesExperimental.yaml:
     17
    1182021-11-08  Yusuke Suzuki  <ysuzuki@apple.com>
    219
  • trunk/Source/WTF/Scripts/Preferences/WebPreferencesExperimental.yaml

    r285260 r285410  
    890890  humanReadableDescription: "Experimental MediaSource Inline Painting"
    891891  condition: ENABLE(MEDIA_SOURCE) && HAVE(AVSAMPLEBUFFERVIDEOOUTPUT)
    892   defaultValue:
    893     WebKitLegacy:
    894       default: false
    895     WebKit:
    896       default: false
    897     WebCore:
     892  webcoreBinding: RuntimeEnabledFeatures
     893  defaultValue:
     894    WebKitLegacy:
     895      default: false
     896    WebKit:
    898897      default: false
    899898
  • trunk/Source/WebCore/ChangeLog

    r285408 r285410  
     12021-11-08  Wenson Hsieh  <wenson_hsieh@apple.com>
     2
     3        Enabling "media source inline painting" by default should work when using GPU Process for media
     4        https://bugs.webkit.org/show_bug.cgi?id=232802
     5
     6        Reviewed by Eric Carlson.
     7
     8        See WebKit/ChangeLog for more details.
     9
     10        * page/RuntimeEnabledFeatures.h:
     11
    1122021-11-08  Antti Koivisto  <antti@apple.com>
    213
  • trunk/Source/WebCore/page/RuntimeEnabledFeatures.h

    r284976 r285410  
    253253
    254254#if ENABLE(MEDIA_SOURCE) && HAVE(AVSAMPLEBUFFERVIDEOOUTPUT)
    255     void setMediaSourceInlinePaintingEnabled(bool);
     255    WEBCORE_EXPORT void setMediaSourceInlinePaintingEnabled(bool);
    256256    bool mediaSourceInlinePaintingEnabled() const { return m_mediaSourceInlinePaintingEnabled; }
    257257#endif
  • trunk/Source/WebKit/ChangeLog

    r285404 r285410  
     12021-11-08  Wenson Hsieh  <wenson_hsieh@apple.com>
     2
     3        Enabling "media source inline painting" by default should work when using GPU Process for media
     4        https://bugs.webkit.org/show_bug.cgi?id=232802
     5
     6        Reviewed by Eric Carlson.
     7
     8        Propagate the bit for `MediaSourceInlinePaintingEnabled` over to the GPU process when updating preferences in
     9        GPUProcessProxy.
     10
     11        * GPUProcess/GPUProcess.cpp:
     12        (WebKit::GPUProcess::setMediaSourceInlinePaintingEnabled):
     13        * GPUProcess/GPUProcess.h:
     14        * GPUProcess/GPUProcess.messages.in:
     15        * UIProcess/GPU/GPUProcessProxy.cpp:
     16        (WebKit::GPUProcessProxy::updatePreferences):
     17
     18        Also, add a couple of FIXMEs here. Note that due to the latter FIXME, this change *still* doesn't allow us to
     19        turn on media source inline painting when using GPU process for media by simply toggling the feature in user
     20        defaults or through UI. This is because preferences on WebPageGroups are not modified when changing experimental
     21        feature user defaults, so logic that iterates through all page groups and looks at preferences will still only
     22        get the default value of each feature flag (as defined in the yaml file).
     23
    1242021-11-08  Kate Cheney  <katherine_cheney@apple.com>
    225
  • trunk/Source/WebKit/GPUProcess/GPUProcess.cpp

    r285195 r285410  
    498498#endif
    499499
     500#if ENABLE(MEDIA_SOURCE) && HAVE(AVSAMPLEBUFFERVIDEOOUTPUT)
     501void GPUProcess::setMediaSourceInlinePaintingEnabled(bool enabled)
     502{
     503    if (m_mediaSourceInlinePaintingEnabled == enabled)
     504        return;
     505    m_mediaSourceInlinePaintingEnabled = enabled;
     506    WebCore::RuntimeEnabledFeatures::sharedFeatures().setMediaSourceInlinePaintingEnabled(m_mediaSourceInlinePaintingEnabled);
     507}
     508#endif
     509
    500510void GPUProcess::webProcessConnectionCountForTesting(CompletionHandler<void(uint64_t)>&& completionHandler)
    501511{
  • trunk/Source/WebKit/GPUProcess/GPUProcess.h

    r285219 r285410  
    172172#endif
    173173
     174#if ENABLE(MEDIA_SOURCE) && HAVE(AVSAMPLEBUFFERVIDEOOUTPUT)
     175    void setMediaSourceInlinePaintingEnabled(bool);
     176#endif
     177
    174178#if ENABLE(CFPREFS_DIRECT_MODE)
    175179    void notifyPreferencesChanged(const String& domain, const String& key, const std::optional<String>& encodedValue);
     
    230234    bool m_vorbisEnabled { false };
    231235#endif
     236#if ENABLE(MEDIA_SOURCE) && HAVE(AVSAMPLEBUFFERVIDEOOUTPUT)
     237    bool m_mediaSourceInlinePaintingEnabled { false };
     238#endif
    232239    String m_applicationVisibleName;
    233240};
  • trunk/Source/WebKit/GPUProcess/GPUProcess.messages.in

    r285219 r285410  
    6969#endif
    7070
     71#if ENABLE(MEDIA_SOURCE) && HAVE(AVSAMPLEBUFFERVIDEOOUTPUT)
     72    SetMediaSourceInlinePaintingEnabled(bool enabled);
     73#endif
     74
    7175#if ENABLE(CFPREFS_DIRECT_MODE)
    7276    NotifyPreferencesChanged(String domain, String key, std::optional<String> encodedValue)
  • trunk/Source/WebKit/UIProcess/GPU/GPUProcessProxy.cpp

    r285219 r285410  
    603603#endif
    604604
     605#if ENABLE(MEDIA_SOURCE) && HAVE(AVSAMPLEBUFFERVIDEOOUTPUT)
     606    bool hasEnabledMediaSourceInlinePainting = false;
     607#endif
     608
     609    // FIXME: We should consider consolidating these into a single struct and propagating it to the GPU process as a single IPC message,
     610    // instead of sending one message for each preference.
     611    //
     612    // FIXME: Additionally, it seems wrong to consult preferences on WebPageGroup rather than WebPreferences corresponding to each page.
     613    // This effectively means that each of the below preferences will always be set to the default value and cannot be toggled through the
     614    // develop menu or user defaults, since the defaults for each group are prefixed with a unique identifier.
     615    //
     616    // Since each of these features apply to the entire GPU process at once (i.e. they affect all web pages using the GPU process), we
     617    // could instead refactor this so that we iterate through all web pages' preferences when initializing the GPU process for the first
     618    // time, and then update these flags when creating new web pages.
    605619    WebPageGroup::forEach([&] (auto& group) mutable {
    606620        if (!group.preferences().useGPUProcessForMediaEnabled())
     
    626640            hasEnabledWebMParser = true;
    627641#endif
     642
     643#if ENABLE(MEDIA_SOURCE) && HAVE(AVSAMPLEBUFFERVIDEOOUTPUT)
     644        if (group.preferences().mediaSourceInlinePaintingEnabled())
     645            hasEnabledMediaSourceInlinePainting = true;
     646#endif
    628647    });
    629648
     
    642661#if ENABLE(VORBIS)
    643662    send(Messages::GPUProcess::SetVorbisDecoderEnabled(hasEnabledVorbis), 0);
     663#endif
     664
     665#if ENABLE(MEDIA_SOURCE) && HAVE(AVSAMPLEBUFFERVIDEOOUTPUT)
     666    send(Messages::GPUProcess::SetMediaSourceInlinePaintingEnabled(hasEnabledMediaSourceInlinePainting), 0);
    644667#endif
    645668
Note: See TracChangeset for help on using the changeset viewer.