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

Commit 4e63777f authored by Dan Stoza's avatar Dan Stoza
Browse files

SF: Prime shader cache before boot animation

Primes the shader cache before launching boot animation to avoid
janking when we eventually fall into GLES composition.

Bug: 30040263
Change-Id: I76ba66e92c5e6bb05930c325f384f3b774e91101
parent 98650f0e
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -436,6 +436,13 @@ EGLConfig RenderEngine::chooseEglConfig(EGLDisplay display, int format) {
    return config;
}


void RenderEngine::primeCache() const {
    // Getting the ProgramCache instance causes it to prime its shader cache,
    // which is performed in its constructor
    ProgramCache::getInstance();
}

// ---------------------------------------------------------------------------
}; // namespace android
// ---------------------------------------------------------------------------
+2 −0
Original line number Diff line number Diff line
@@ -63,6 +63,8 @@ public:

    static EGLConfig chooseEglConfig(EGLDisplay display, int format);

    void primeCache() const;

    // dump the extension strings. always call the base class.
    virtual void dump(String8& result);

+2 −0
Original line number Diff line number Diff line
@@ -509,6 +509,8 @@ void SurfaceFlinger::init() {
    // set initial conditions (e.g. unblank default device)
    initializeDisplays();

    mRenderEngine->primeCache();

    // start boot animation
    startBootAnim();

+2 −0
Original line number Diff line number Diff line
@@ -538,6 +538,8 @@ void SurfaceFlinger::init() {
    // set initial conditions (e.g. unblank default device)
    initializeDisplays();

    mRenderEngine->primeCache();

    // start boot animation
    startBootAnim();
}