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

Commit a392073f authored by Robert Carr's avatar Robert Carr
Browse files

Reset mFreezePositionUpdates earlier.

We are resetting mFreezePositionUpdates
too late, in the case that the state changes during
latch buffer, we will return to recompute the visible regions
before updating mActiveBuffer.

Bug: 28823590
Change-Id: I17afc32d55d092ea0814b560846b922dd9e24c43
parent 367c5684
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -1773,16 +1773,19 @@ Region Layer::latchBuffer(bool& recomputeVisibleRegions)
            bool stickyTransformSet;
            const char* name;
            int32_t overrideScalingMode;
            bool& freezePositionUpdates;

            Reject(Layer::State& front, Layer::State& current,
                    bool& recomputeVisibleRegions, bool stickySet,
                    const char* name,
                    int32_t overrideScalingMode)
                    int32_t overrideScalingMode,
                    bool& freezePositionUpdates)
                : front(front), current(current),
                  recomputeVisibleRegions(recomputeVisibleRegions),
                  stickyTransformSet(stickySet),
                  name(name),
                  overrideScalingMode(overrideScalingMode) {
                  overrideScalingMode(overrideScalingMode),
                  freezePositionUpdates(freezePositionUpdates) {
            }

            virtual bool reject(const sp<GraphicBuffer>& buf,
@@ -1879,6 +1882,7 @@ Region Layer::latchBuffer(bool& recomputeVisibleRegions)
                    current.crop = front.requestedCrop;
                    recomputeVisibleRegions = true;
                }
                freezePositionUpdates = false;

                return false;
            }
@@ -1886,7 +1890,7 @@ Region Layer::latchBuffer(bool& recomputeVisibleRegions)

        Reject r(mDrawingState, getCurrentState(), recomputeVisibleRegions,
                getProducerStickyTransform() != 0, mName.string(),
                mOverrideScalingMode);
                mOverrideScalingMode, mFreezePositionUpdates);


        // Check all of our local sync points to ensure that all transactions
@@ -2029,7 +2033,6 @@ Region Layer::latchBuffer(bool& recomputeVisibleRegions)
            if (bufWidth != uint32_t(oldActiveBuffer->width) ||
                bufHeight != uint32_t(oldActiveBuffer->height)) {
                recomputeVisibleRegions = true;
                mFreezePositionUpdates = false;
            }
        }