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

Commit b2c1cfbe authored by Mathias Agopian's avatar Mathias Agopian Committed by Android Git Automerger
Browse files

am 0cd545f1: sometimes we would incorrectly scale the content of a surface

* commit '0cd545f1':
  sometimes we would incorrectly scale the content of a surface
parents d7749390 0cd545f1
Loading
Loading
Loading
Loading
+19 −6
Original line number Diff line number Diff line
@@ -469,18 +469,31 @@ uint32_t Layer::doTransaction(uint32_t flags)
                front.requested.crop.getWidth(),
                front.requested.crop.getHeight());

        if (!isFixedSize()) {
            // this will make sure LayerBase::doTransaction doesn't update
            // the drawing state's geometry
            flags |= eDontUpdateGeometryState;
        }

        // record the new size, form this point on, when the client request
        // a buffer, it'll get the new size.
        mSurfaceTexture->setDefaultBufferSize(
                temp.requested.w, temp.requested.h);
    }

    if (!isFixedSize()) {

        const bool resizePending = (temp.requested.w != temp.active.w) ||
                                   (temp.requested.h != temp.active.h);

        if (resizePending) {
            // don't let LayerBase::doTransaction update the drawing state
            // if we have a pending resize, unless we are in fixed-size mode.
            // the drawing state will be updated only once we receive a buffer
            // with the correct size.
            //
            // in particular, we want to make sure the clip (which is part
            // of the geometry state) is latched together with the size but is
            // latched immediately when no resizing is involved.

            flags |= eDontUpdateGeometryState;
        }
    }

    return LayerBase::doTransaction(flags);
}