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

Commit c088bdcd authored by Nader Jawad's avatar Nader Jawad
Browse files

Updated SkiaGLRenderEngine stretch logic

Removed explicit flag to disable stretching
surfaceflinger layers with the stretch shader in favor
of leveraging a adb setprop to determine the type of
stretch to apply.

Updated some variable names + types as response
to earlier CL feedback

Bug: 184297961
Test: manual
Change-Id: I4f1d7a7b4a33095d920b3149eb474cbe07c87cb0
parent 63644d34
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -564,10 +564,10 @@ sk_sp<SkShader> SkiaGLRenderEngine::createRuntimeEffectShader(
    // which gets similar results for most surfaces
    // Determine later on if we need to leverage the stertch shader within
    // surface flinger
    if (stretchEffect.hasEffect() && /* DISABLES CODE */ (false)) {
    if (stretchEffect.hasEffect()) {
        const auto targetBuffer = layer->source.buffer.buffer;
        const auto graphicsBuffer = targetBuffer ? targetBuffer->getBuffer() : nullptr;
        if (graphicsBuffer && shader) {
        const auto graphicBuffer = targetBuffer ? targetBuffer->getBuffer() : nullptr;
        if (graphicBuffer && shader) {
            shader = mStretchShaderFactory.createSkShader(shader, stretchEffect);
        }
    }
+5 −4
Original line number Diff line number Diff line
@@ -120,14 +120,15 @@ private:

    // Identifier used or various mappings of layers to various
    // textures or shaders
    using LayerId = uint64_t;
    using GraphicBufferId = uint64_t;

    // Number of external holders of ExternalTexture references, per GraphicBuffer ID.
    std::unordered_map<LayerId, int32_t> mGraphicBufferExternalRefs GUARDED_BY(mRenderingMutex);
    std::unordered_map<GraphicBufferId, int32_t> mGraphicBufferExternalRefs
            GUARDED_BY(mRenderingMutex);
    // Cache of GL textures that we'll store per GraphicBuffer ID, sliced by GPU context.
    std::unordered_map<LayerId, std::shared_ptr<AutoBackendTexture::LocalRef>> mTextureCache
    std::unordered_map<GraphicBufferId, std::shared_ptr<AutoBackendTexture::LocalRef>> mTextureCache
            GUARDED_BY(mRenderingMutex);
    std::unordered_map<LayerId, std::shared_ptr<AutoBackendTexture::LocalRef>>
    std::unordered_map<GraphicBufferId, std::shared_ptr<AutoBackendTexture::LocalRef>>
            mProtectedTextureCache GUARDED_BY(mRenderingMutex);
    std::unordered_map<LinearEffect, sk_sp<SkRuntimeEffect>, LinearEffectHasher> mRuntimeEffects;