Changeset 267079 in webkit


Ignore:
Timestamp:
Sep 15, 2020 12:13:51 AM (4 years ago)
Author:
youenn@apple.com
Message:

Enable VP9 in GPUProcess if page needs it
https://bugs.webkit.org/show_bug.cgi?id=216472

Reviewed by Eric Carlson.

In case a page is using GPUProcess for media, send the VP9 parameters to GPUProcess.
GPUProcess will enable VP9 decoders based on that input.
Covered by LayoutTests/media/vp9.html with GPU process enabled.

  • GPUProcess/GPUConnectionToWebProcess.cpp:

(WebKit::GPUConnectionToWebProcess::enableVP9Decoders):

  • GPUProcess/GPUConnectionToWebProcess.h:
  • GPUProcess/GPUConnectionToWebProcess.messages.in:
  • GPUProcess/GPUProcess.cpp:

(WebKit::GPUProcess::enableVP9Decoders):

  • GPUProcess/GPUProcess.h:
  • WebProcess/GPU/GPUProcessConnection.cpp:

(WebKit::GPUProcessConnection::updateParameters):

  • WebProcess/GPU/GPUProcessConnection.h:
  • WebProcess/WebPage/WebPage.cpp:

(WebKit::m_limitsNavigationsToAppBoundDomains):

Location:
trunk/Source/WebKit
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r267069 r267079  
     12020-09-15  Youenn Fablet  <youenn@apple.com>
     2
     3        Enable VP9 in GPUProcess if page needs it
     4        https://bugs.webkit.org/show_bug.cgi?id=216472
     5
     6        Reviewed by Eric Carlson.
     7
     8        In case a page is using GPUProcess for media, send the VP9 parameters to GPUProcess.
     9        GPUProcess will enable VP9 decoders based on that input.
     10        Covered by LayoutTests/media/vp9.html with GPU process enabled.
     11
     12        * GPUProcess/GPUConnectionToWebProcess.cpp:
     13        (WebKit::GPUConnectionToWebProcess::enableVP9Decoders):
     14        * GPUProcess/GPUConnectionToWebProcess.h:
     15        * GPUProcess/GPUConnectionToWebProcess.messages.in:
     16        * GPUProcess/GPUProcess.cpp:
     17        (WebKit::GPUProcess::enableVP9Decoders):
     18        * GPUProcess/GPUProcess.h:
     19        * WebProcess/GPU/GPUProcessConnection.cpp:
     20        (WebKit::GPUProcessConnection::updateParameters):
     21        * WebProcess/GPU/GPUProcessConnection.h:
     22        * WebProcess/WebPage/WebPage.cpp:
     23        (WebKit::m_limitsNavigationsToAppBoundDomains):
     24
    1252020-09-14  Sam Weinig  <weinig@apple.com>
    226
  • trunk/Source/WebKit/GPUProcess/GPUConnectionToWebProcess.cpp

    r267021 r267079  
    514514#endif
    515515
     516#if ENABLE(VP9)
     517void GPUConnectionToWebProcess::enableVP9Decoders(bool shouldEnableVP9Decoder, bool shouldEnableVP9SWDecoder)
     518{
     519    m_gpuProcess->enableVP9Decoders(shouldEnableVP9Decoder, shouldEnableVP9SWDecoder);
     520}
     521#endif
     522
    516523} // namespace WebKit
    517524
  • trunk/Source/WebKit/GPUProcess/GPUConnectionToWebProcess.h

    r267021 r267079  
    134134    void setNowPlayingInfo(bool setAsNowPlayingApplication, WebCore::NowPlayingInfo&&);
    135135
     136#if ENABLE(VP9)
     137    void enableVP9Decoders(bool shouldEnableVP9Decoder, bool shouldEnableVP9SWDecoder);
     138#endif
     139
    136140#if ENABLE(GPU_PROCESS) && USE(AUDIO_SESSION)
    137141    using EnsureAudioSessionCompletion = CompletionHandler<void(const RemoteAudioSessionConfiguration&)>;
  • trunk/Source/WebKit/GPUProcess/GPUConnectionToWebProcess.messages.in

    r258253 r267079  
    2626    void CreateRenderingBackend(WebKit::RenderingBackendIdentifier renderingBackendIdentifier)
    2727    void ReleaseRenderingBackend(WebKit::RenderingBackendIdentifier renderingBackendIdentifier)
    28     void ClearNowPlayingInfo();
    29     void SetNowPlayingInfo(bool setAsNowPlayingApplication, struct WebCore::NowPlayingInfo nowPlayingInfo);
     28    void ClearNowPlayingInfo()
     29    void SetNowPlayingInfo(bool setAsNowPlayingApplication, struct WebCore::NowPlayingInfo nowPlayingInfo)
    3030#if USE(AUDIO_SESSION)
    3131    EnsureAudioSession() -> (struct WebKit::RemoteAudioSessionConfiguration configuration) Synchronous
     
    3434    EnsureMediaSessionHelper()
    3535#endif
     36#if ENABLE(VP9)
     37    EnableVP9Decoders(bool shouldEnableVP9Decoder, bool shouldEnableVP9SWDecoder)
     38#endif
    3639}
    3740
  • trunk/Source/WebKit/GPUProcess/GPUProcess.cpp

    r267021 r267079  
    6060#endif
    6161
     62#if PLATFORM(COCOA)
     63#include <WebCore/VP9UtilitiesCocoa.h>
     64#endif
     65
    6266namespace WebKit {
    6367using namespace WebCore;
     
    267271#endif
    268272
     273#if ENABLE(VP9)
     274void GPUProcess::enableVP9Decoders(bool shouldEnableVP9Decoder, bool shouldEnableVP9SWDecoder)
     275{
     276    if (shouldEnableVP9Decoder && !m_enableVP9Decoder) {
     277        m_enableVP9Decoder = true;
     278#if PLATFORM(COCOA)
     279        WebCore::registerSupplementalVP9Decoder();
     280#endif
     281    }
     282    if (shouldEnableVP9SWDecoder && !m_enableVP9SWDecoder) {
     283        m_enableVP9SWDecoder = true;
     284#if PLATFORM(COCOA)
     285        WebCore::registerWebKitVP9Decoder();
     286#endif
     287    }
     288}
     289#endif
     290
    269291} // namespace WebKit
    270292
  • trunk/Source/WebKit/GPUProcess/GPUProcess.h

    r267021 r267079  
    8080#endif
    8181
     82#if ENABLE(VP9)
     83    void enableVP9Decoders(bool shouldEnableVP9Decoder, bool shouldEnableVP9SWDecoder);
     84#endif
     85
    8286private:
    8387    void lowMemoryHandler(Critical);
     
    137141    mutable std::unique_ptr<RemoteAudioSessionProxyManager> m_audioSessionManager;
    138142#endif
     143#if ENABLE(VP9)
     144    bool m_enableVP9Decoder { false };
     145    bool m_enableVP9SWDecoder { false };
     146#endif
    139147};
    140148
  • trunk/Source/WebKit/WebProcess/GPU/GPUProcessConnection.cpp

    r262695 r267079  
    4242#include "WebCoreArgumentCoders.h"
    4343#include "WebPage.h"
     44#include "WebPageCreationParameters.h"
    4445#include "WebPageMessages.h"
    4546#include "WebProcess.h"
     
    152153}
    153154
     155void GPUProcessConnection::updateParameters(const WebPageCreationParameters& parameters)
     156{
     157#if ENABLE(VP9)
     158    if (m_enableVP9Decoder == parameters.shouldEnableVP9Decoder && m_enableVP9SWDecoder == parameters.shouldEnableVP9SWDecoder)
     159        return;
     160
     161    m_enableVP9Decoder = parameters.shouldEnableVP9Decoder;
     162    m_enableVP9SWDecoder = parameters.shouldEnableVP9SWDecoder;
     163    connection().send(Messages::GPUConnectionToWebProcess::EnableVP9Decoders(parameters.shouldEnableVP9Decoder, parameters.shouldEnableVP9SWDecoder), { });
     164#endif
     165}
     166
    154167} // namespace WebKit
    155168
  • trunk/Source/WebKit/WebProcess/GPU/GPUProcessConnection.h

    r262695 r267079  
    4444class RemoteMediaPlayerManager;
    4545class RemoteLegacyCDMFactory;
     46struct WebPageCreationParameters;
    4647
    4748class GPUProcessConnection : public RefCounted<GPUProcessConnection>, IPC::Connection::Client {
     
    7475#endif
    7576
     77    void updateParameters(const WebPageCreationParameters&);
     78
    7679private:
    7780    GPUProcessConnection(IPC::Connection::Identifier);
     
    98101    std::unique_ptr<SampleBufferDisplayLayerManager> m_sampleBufferDisplayLayerManager;
    99102#endif
     103#if ENABLE(VP9)
     104    bool m_enableVP9Decoder { false };
     105    bool m_enableVP9SWDecoder { false };
     106#endif
    100107};
    101108
  • trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp

    r266829 r267079  
    783783#endif
    784784
     785#if ENABLE(GPU_PROCESS)
     786    if (m_page->settings().useGPUProcessForMedia())
     787        WebProcess::singleton().ensureGPUProcessConnection().updateParameters(parameters);
     788#endif
     789
    785790    if (parameters.shouldEnableVP9Decoder)
    786791        WebProcess::singleton().enableVP9Decoder();
Note: See TracChangeset for help on using the changeset viewer.