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

Commit 551fb515 authored by Vishnu Nair's avatar Vishnu Nair Committed by Automerger Merge Worker
Browse files

Merge "[sf] populate snashot path for legacy frontend" into udc-dev am: 0f6d31dd

parents 9cde570e 0f6d31dd
Loading
Loading
Loading
Loading
+7 −4
Original line number Original line Diff line number Diff line
@@ -2552,7 +2552,10 @@ Region Layer::getVisibleRegion(const DisplayDevice* display) const {
    return outputLayer ? outputLayer->getState().visibleRegion : Region();
    return outputLayer ? outputLayer->getState().visibleRegion : Region();
}
}


void Layer::setInitialValuesForClone(const sp<Layer>& clonedFrom) {
void Layer::setInitialValuesForClone(const sp<Layer>& clonedFrom, uint32_t mirrorRootId) {
    mSnapshot->path.id = clonedFrom->getSequence();
    mSnapshot->path.mirrorRootId = mirrorRootId;

    cloneDrawingState(clonedFrom.get());
    cloneDrawingState(clonedFrom.get());
    mClonedFrom = clonedFrom;
    mClonedFrom = clonedFrom;
    mPremultipliedAlpha = clonedFrom->mPremultipliedAlpha;
    mPremultipliedAlpha = clonedFrom->mPremultipliedAlpha;
@@ -2653,7 +2656,7 @@ void Layer::updateClonedChildren(const sp<Layer>& mirrorRoot,
        }
        }
        sp<Layer> clonedChild = clonedLayersMap[child];
        sp<Layer> clonedChild = clonedLayersMap[child];
        if (clonedChild == nullptr) {
        if (clonedChild == nullptr) {
            clonedChild = child->createClone();
            clonedChild = child->createClone(mirrorRoot->getSequence());
            clonedLayersMap[child] = clonedChild;
            clonedLayersMap[child] = clonedChild;
        }
        }
        addChildToDrawing(clonedChild);
        addChildToDrawing(clonedChild);
@@ -3491,11 +3494,11 @@ Rect Layer::computeBufferCrop(const State& s) {
    }
    }
}
}


sp<Layer> Layer::createClone() {
sp<Layer> Layer::createClone(uint32_t mirrorRootId) {
    LayerCreationArgs args(mFlinger.get(), nullptr, mName + " (Mirror)", 0, LayerMetadata());
    LayerCreationArgs args(mFlinger.get(), nullptr, mName + " (Mirror)", 0, LayerMetadata());
    args.textureName = mTextureName;
    args.textureName = mTextureName;
    sp<Layer> layer = mFlinger->getFactory().createBufferStateLayer(args);
    sp<Layer> layer = mFlinger->getFactory().createBufferStateLayer(args);
    layer->setInitialValuesForClone(sp<Layer>::fromExisting(this));
    layer->setInitialValuesForClone(sp<Layer>::fromExisting(this), mirrorRootId);
    return layer;
    return layer;
}
}


+2 −2
Original line number Original line Diff line number Diff line
@@ -248,7 +248,7 @@ public:
    // true if this layer is visible, false otherwise
    // true if this layer is visible, false otherwise
    virtual bool isVisible() const;
    virtual bool isVisible() const;


    virtual sp<Layer> createClone();
    virtual sp<Layer> createClone(uint32_t mirrorRoot);


    // Set a 2x2 transformation matrix on the layer. This transform
    // Set a 2x2 transformation matrix on the layer. This transform
    // will be applied after parent transforms, but before any final
    // will be applied after parent transforms, but before any final
@@ -922,7 +922,7 @@ protected:
    friend class TransactionFrameTracerTest;
    friend class TransactionFrameTracerTest;
    friend class TransactionSurfaceFrameTest;
    friend class TransactionSurfaceFrameTest;


    virtual void setInitialValuesForClone(const sp<Layer>& clonedFrom);
    virtual void setInitialValuesForClone(const sp<Layer>& clonedFrom, uint32_t mirrorRootId);
    void preparePerFrameCompositionState();
    void preparePerFrameCompositionState();
    void preparePerFrameBufferCompositionState();
    void preparePerFrameBufferCompositionState();
    void preparePerFrameEffectsCompositionState();
    void preparePerFrameEffectsCompositionState();
+2 −2
Original line number Original line Diff line number Diff line
@@ -5254,7 +5254,7 @@ status_t SurfaceFlinger::mirrorLayer(const LayerCreationArgs& args,
            return result;
            return result;
        }
        }


        mirrorLayer->setClonedChild(mirrorFrom->createClone());
        mirrorLayer->setClonedChild(mirrorFrom->createClone(mirrorLayer->getSequence()));
    }
    }


    outResult.layerId = mirrorLayer->sequence;
    outResult.layerId = mirrorLayer->sequence;
@@ -8033,7 +8033,7 @@ bool SurfaceFlinger::commitMirrorDisplays(VsyncId vsyncId) {
                Mutex::Autolock lock(mStateLock);
                Mutex::Autolock lock(mStateLock);
                createEffectLayer(mirrorArgs, &unused, &childMirror);
                createEffectLayer(mirrorArgs, &unused, &childMirror);
                MUTEX_ALIAS(mStateLock, childMirror->mFlinger->mStateLock);
                MUTEX_ALIAS(mStateLock, childMirror->mFlinger->mStateLock);
                childMirror->setClonedChild(layer->createClone());
                childMirror->setClonedChild(layer->createClone(childMirror->getSequence()));
                childMirror->reparent(mirrorDisplay.rootHandle);
                childMirror->reparent(mirrorDisplay.rootHandle);
            }
            }
            // lock on mStateLock needs to be released before binder handle gets destroyed
            // lock on mStateLock needs to be released before binder handle gets destroyed
+1 −1
Original line number Original line Diff line number Diff line
@@ -75,7 +75,7 @@ public:


    bool isVisible() const override { return true; }
    bool isVisible() const override { return true; }


    sp<Layer> createClone() override { return nullptr; }
    sp<Layer> createClone(uint32_t /* mirrorRootId */) override { return nullptr; }
};
};


class FuzzImplVSyncTracker : public scheduler::VSyncTracker {
class FuzzImplVSyncTracker : public scheduler::VSyncTracker {
+1 −1
Original line number Original line Diff line number Diff line
@@ -32,7 +32,7 @@ public:
    MOCK_CONST_METHOD0(getType, const char*());
    MOCK_CONST_METHOD0(getType, const char*());
    MOCK_METHOD0(getFrameSelectionPriority, int32_t());
    MOCK_METHOD0(getFrameSelectionPriority, int32_t());
    MOCK_CONST_METHOD0(isVisible, bool());
    MOCK_CONST_METHOD0(isVisible, bool());
    MOCK_METHOD0(createClone, sp<Layer>());
    MOCK_METHOD1(createClone, sp<Layer>(uint32_t));
    MOCK_CONST_METHOD0(getFrameRateForLayerTree, FrameRate());
    MOCK_CONST_METHOD0(getFrameRateForLayerTree, FrameRate());
    MOCK_CONST_METHOD0(getDefaultFrameRateCompatibility,
    MOCK_CONST_METHOD0(getDefaultFrameRateCompatibility,
                       scheduler::LayerInfo::FrameRateCompatibility());
                       scheduler::LayerInfo::FrameRateCompatibility());