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

Commit 2f749438 authored by Vishnu Nair's avatar Vishnu Nair Committed by Android (Google) Code Review
Browse files

Merge "SF: Update transform hint from current state"

parents 8bc3a172 73908d15
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -1014,8 +1014,10 @@ bool Layer::isLayerFocusedBasedOnPriority(int32_t priority) {
    return priority == PRIORITY_FOCUSED_WITH_MODE || priority == PRIORITY_FOCUSED_WITHOUT_MODE;
};

ui::LayerStack Layer::getLayerStack() const {
    if (const auto parent = mDrawingParent.promote()) {
ui::LayerStack Layer::getLayerStack(LayerVector::StateSet state) const {
    bool useDrawing = state == LayerVector::StateSet::Drawing;
    const auto parent = useDrawing ? mDrawingParent.promote() : mCurrentParent.promote();
    if (parent) {
        return parent->getLayerStack();
    }
    return getDrawingState().layerStack;
+3 −1
Original line number Diff line number Diff line
@@ -320,7 +320,9 @@ public:
    virtual bool setTrustedOverlay(bool);
    virtual bool setFlags(uint32_t flags, uint32_t mask);
    virtual bool setLayerStack(ui::LayerStack);
    virtual ui::LayerStack getLayerStack() const;
    virtual ui::LayerStack getLayerStack(
            LayerVector::StateSet state = LayerVector::StateSet::Drawing) const;

    virtual bool setMetadata(const LayerMetadata& data);
    virtual void setChildrenDrawingParent(const sp<Layer>&);
    virtual bool reparent(const sp<IBinder>& newParentHandle);
+4 −3
Original line number Diff line number Diff line
@@ -4123,7 +4123,7 @@ uint32_t SurfaceFlinger::setClientStateLocked(const FrameTimelineInfo& frameTime
        return 0;
    }

    ui::LayerStack oldLayerStack = layer->getLayerStack();
    ui::LayerStack oldLayerStack = layer->getLayerStack(LayerVector::StateSet::Current);

    // Only set by BLAST adapter layers
    if (what & layer_state_t::eProducerDisconnect) {
@@ -4392,7 +4392,8 @@ uint32_t SurfaceFlinger::setClientStateLocked(const FrameTimelineInfo& frameTime
    // setTransactionCompletedListener

    // if the layer has been parented on to a new display, update its transform hint.
    if (((flags & eTransformHintUpdateNeeded) == 0) && oldLayerStack != layer->getLayerStack()) {
    if (((flags & eTransformHintUpdateNeeded) == 0) &&
        oldLayerStack != layer->getLayerStack(LayerVector::StateSet::Current)) {
        flags |= eTransformHintUpdateNeeded;
    }

@@ -6892,7 +6893,7 @@ void SurfaceFlinger::handleLayerCreatedLocked(const LayerCreatedState& state, Vs
        parent->addChild(layer);
    }

    ui::LayerStack layerStack = layer->getLayerStack();
    ui::LayerStack layerStack = layer->getLayerStack(LayerVector::StateSet::Current);
    sp<const DisplayDevice> hintDisplay;
    // Find the display that includes the layer.
    for (const auto& [token, display] : mDisplays) {