• Mohsen Izadi's avatar
    Use OzonePlatform::PlatformProperties::requires_mojo only after init · a378a8f4
    Mohsen Izadi authored
    Some ozone platforms (e.g. Wayland) require mojo communication while
    others either don't use mojo or use it only if OzoneDrmMojo feature is
    enabled. |requires_mojo| shows whether a platform requires mojo or not.
    
    |requires_mojo| is used in some places before OzonePlatform is
    initialized.
    
    Part of this usage is for populating InitParams used for OzonePlatform
    initialization. These can easily be removed as each type of
    OzonePlatform knows whether it requires mojo or not when it is being
    initialized. There is no need to pass this value to the initialization
    codes.
    
    Other cases use this and other info to check whether mojo is actually
    used or not. None of these cases really need to happen before
    initialization and can be moved to after initialization.
    
    This change is part of a larger effort to remove the need for
    OzonePlatform instance before it is initialized.
    
    This CL also cleans up some code in OzonePlatform implementations,
    mostly using std::make_unique<> instead of new operator.
    
    BUG=958387
    
    Change-Id: Ie44c6e441389e1f119f6458bc4e1c15bdc1d83e2
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1604112Reviewed-by: default avatarRobert Kroeger <rjkroege@chromium.org>
    Reviewed-by: default avatarJonathan Backer <backer@chromium.org>
    Reviewed-by: default avatarScott Violet <sky@chromium.org>
    Commit-Queue: Mohsen Izadi <mohsen@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#683452}
    a378a8f4
skia_demo.cc 2.84 KB