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

Commit 59dc558e authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix crash in "Tree::updateBitmapCache""

parents 31a7867b 47fed6ba
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -75,6 +75,12 @@ void SkiaPipeline::unpinImages() {
    mPinnedImages.clear();
}

void SkiaPipeline::onPrepareTree() {
    // The only time mVectorDrawables is not empty is if prepare tree was called 2 times without
    // a renderFrame in the middle.
    mVectorDrawables.clear();
}

void SkiaPipeline::renderLayers(const FrameBuilder::LightGeometry& lightGeometry,
        LayerUpdateQueue* layerUpdateQueue, bool opaque, bool wideColorGamut,
        const BakedOpRenderer::LightInfo& lightInfo) {
+1 −0
Original line number Diff line number Diff line
@@ -37,6 +37,7 @@ public:
    bool pinImages(std::vector<SkImage*>& mutableImages) override;
    bool pinImages(LsaVector<sk_sp<Bitmap>>& images) override { return false; }
    void unpinImages() override;
    void onPrepareTree() override;

    void renderLayers(const FrameBuilder::LightGeometry& lightGeometry,
            LayerUpdateQueue* layerUpdateQueue, bool opaque, bool wideColorGamut,
+1 −0
Original line number Diff line number Diff line
@@ -331,6 +331,7 @@ void CanvasContext::prepareTree(TreeInfo& info, int64_t* uiFrameInfo,
    info.layerUpdateQueue = &mLayerUpdateQueue;

    mAnimationContext->startFrame(info.mode);
    mRenderPipeline->onPrepareTree();
    for (const sp<RenderNode>& node : mRenderNodes) {
        // Only the primary target node will be drawn full - all other nodes would get drawn in
        // real time mode. In case of a window, the primary node is the window content and the other
+1 −0
Original line number Diff line number Diff line
@@ -81,6 +81,7 @@ public:
    virtual bool pinImages(std::vector<SkImage*>& mutableImages) = 0;
    virtual bool pinImages(LsaVector<sk_sp<Bitmap>>& images) = 0;
    virtual void unpinImages() = 0;
    virtual void onPrepareTree() = 0;

    virtual ~IRenderPipeline() {}
};
+1 −0
Original line number Diff line number Diff line
@@ -58,6 +58,7 @@ public:
    bool pinImages(std::vector<SkImage*>& mutableImages) override { return false; }
    bool pinImages(LsaVector<sk_sp<Bitmap>>& images) override;
    void unpinImages() override;
    void onPrepareTree() override {}
    static void destroyLayer(RenderNode* node);
    static void prepareToDraw(const RenderThread& thread, Bitmap* bitmap);
    static void invokeFunctor(const RenderThread& thread, Functor* functor);
Loading