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

Commit 630fcaf0 authored by Ivan Lozano's avatar Ivan Lozano Committed by Gerrit Code Review
Browse files

Merge "Fix surfaceflinger on integer sanitized builds."

parents 1a49778e c6c2a8af
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -70,7 +70,7 @@ Layer::Layer(SurfaceFlinger* flinger, const sp<Client>& client,
    :   contentDirty(false),
        sequence(uint32_t(android_atomic_inc(&sSequence))),
        mFlinger(flinger),
        mTextureName(-1U),
        mTextureName(UINT32_MAX),
        mPremultipliedAlpha(true),
        mName("unnamed"),
        mFormat(PIXEL_FORMAT_NONE),
@@ -2659,6 +2659,7 @@ int32_t Layer::getZ() const {
    return mDrawingState.z;
}

__attribute__((no_sanitize("unsigned-integer-overflow")))
LayerVector Layer::makeTraversalList(LayerVector::StateSet stateSet) {
    LOG_ALWAYS_FATAL_IF(stateSet == LayerVector::StateSet::Invalid,
                        "makeTraversalList received invalid stateSet");
+6 −3
Original line number Diff line number Diff line
@@ -35,14 +35,17 @@ int LayerVector::do_compare(const void* lhs, const void* rhs) const
    uint32_t ls = l->getCurrentState().layerStack;
    uint32_t rs = r->getCurrentState().layerStack;
    if (ls != rs)
        return ls - rs;
        return (ls > rs) ? 1 : -1;

    uint32_t lz = l->getCurrentState().z;
    uint32_t rz = r->getCurrentState().z;
    if (lz != rz)
        return lz - rz;
        return (lz > rz) ? 1 : -1;

    return l->sequence - r->sequence;
    if (l->sequence == r->sequence)
        return 0;

    return (l->sequence > r->sequence) ? 1 : -1;
}

void LayerVector::traverseInZOrder(StateSet stateSet, const Visitor& visitor) const {