Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0c9f1340 authored by Noelle Scobie's avatar Noelle Scobie Committed by Android (Google) Code Review
Browse files

Merge "Enable draw-based pipeline prewarming before Graphite's precompilation" into main

parents 24cd4047 2eb29823
Loading
Loading
Loading
Loading
+9 −11
Original line number Diff line number Diff line
@@ -69,8 +69,15 @@ GraphiteVkRenderEngine::~GraphiteVkRenderEngine() {
std::future<void> GraphiteVkRenderEngine::primeCache(PrimeCacheConfig config) {
    std::future<void> ret = {};

    // Note: for local debugging only! Graphite's precompilation should stay ENABLED, and this
    // switch will be removed in the future without warning.
    // Note: this sysprop is for local debugging only! Legacy draw-based prewarming remains enabled
    // for Graphite TEMPORARILY, and this switch may be removed in the future without warning.
    // TODO(b/380159947): remove this option, and force just precompilation to always be enabled.
    if (base::GetBoolProperty("debug.renderengine.graphite.prewarm", true)) {
        ret = SkiaVkRenderEngine::primeCache(config);
    }

    // Note: this sysprop is for local debugging only! Graphite's precompilation should stay
    // ENABLED, and this switch may be removed in the future without warning.
    if (base::GetBoolProperty("debug.renderengine.graphite.precompile", true)) {
        std::unique_ptr<graphite::PrecompileContext> precompileContext =
                mContext->graphiteContext()->makePrecompileContext();
@@ -81,15 +88,6 @@ std::future<void> GraphiteVkRenderEngine::primeCache(PrimeCacheConfig config) {
        ALOGW("Graphite's background shader / pipeline precompilation was disabled!");
    }

    // Note: for local debugging only! Legacy draw-based prewarming should stay DISABLED, and this
    // switch will be removed  in the future without warning. Enabling this may regress boot time
    // unnecessarily.
    // TODO(b/380159947): remove this option, and force precompilation to always be enabled.
    if (base::GetBoolProperty("debug.renderengine.graphite.prewarm", false)) {
        ALOGW("Legacy draw-based shader / pipeline prewarming was enabled, and may delay boot!");
        ret = SkiaVkRenderEngine::primeCache(config);
    }

    return ret;
}