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

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

Merge "[SurfaceFlinger] Avoid comparing to identity matrix."

parents 109ceb4c 747321cc
Loading
Loading
Loading
Loading
+6 −2
Original line number Original line Diff line number Diff line
@@ -102,6 +102,7 @@ Layer::Layer(const LayerCreationArgs& args)
    mCurrentState.hdrMetadata.validTypes = 0;
    mCurrentState.hdrMetadata.validTypes = 0;
    mCurrentState.surfaceDamageRegion.clear();
    mCurrentState.surfaceDamageRegion.clear();
    mCurrentState.api = -1;
    mCurrentState.api = -1;
    mCurrentState.hasColorTransform = false;


    // drawing state & current state are identical
    // drawing state & current state are identical
    mDrawingState = mCurrentState;
    mDrawingState = mCurrentState;
@@ -1547,11 +1548,15 @@ bool Layer::detachChildren() {
}
}


bool Layer::setColorTransform(const mat4& matrix) {
bool Layer::setColorTransform(const mat4& matrix) {
    static const mat4 identityMatrix = mat4();

    if (mCurrentState.colorTransform == matrix) {
    if (mCurrentState.colorTransform == matrix) {
        return false;
        return false;
    }
    }
    ++mCurrentState.sequence;
    ++mCurrentState.sequence;
    mCurrentState.colorTransform = matrix;
    mCurrentState.colorTransform = matrix;
    mCurrentState.hasColorTransform = matrix != identityMatrix;
    mCurrentState.modified = true;
    setTransactionFlags(eTransactionNeeded);
    setTransactionFlags(eTransactionNeeded);
    return true;
    return true;
}
}
@@ -1561,8 +1566,7 @@ const mat4& Layer::getColorTransform() const {
}
}


bool Layer::hasColorTransform() const {
bool Layer::hasColorTransform() const {
    static const mat4 identityMatrix = mat4();
    return getDrawingState().hasColorTransform;
    return getDrawingState().colorTransform != identityMatrix;
}
}


bool Layer::isLegacyDataSpace() const {
bool Layer::isLegacyDataSpace() const {
+1 −0
Original line number Original line Diff line number Diff line
@@ -182,6 +182,7 @@ public:


        sp<NativeHandle> sidebandStream;
        sp<NativeHandle> sidebandStream;
        mat4 colorTransform;
        mat4 colorTransform;
        bool hasColorTransform;
    };
    };


    explicit Layer(const LayerCreationArgs& args);
    explicit Layer(const LayerCreationArgs& args);