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

Commit f9e2ca32 authored by Mathias Agopian's avatar Mathias Agopian Committed by Android (Google) Code Review
Browse files

Merge "resolved conflicts for merge of a0f011ff to master"

parents ca7e1ed8 669084db
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -4213,7 +4213,7 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
        boolean noneOfTheChildrenAreTransparent = true;
        for (int i = 0; i < count; i++) {
            final View child = children[i];
            if ((child.mViewFlags & VISIBILITY_MASK) != GONE || child.getAnimation() != null) {
            if ((child.mViewFlags & VISIBILITY_MASK) == VISIBLE || child.getAnimation() != null) {
                if (!child.gatherTransparentRegion(region)) {
                    noneOfTheChildrenAreTransparent = false;
                }
+10 −12
Original line number Diff line number Diff line
@@ -58,7 +58,7 @@ Layer::Layer(SurfaceFlinger* flinger,
        mSecure(false),
        mTextureManager(),
        mBufferManager(mTextureManager),
        mWidth(0), mHeight(0), mFixedSize(false)
        mWidth(0), mHeight(0), mNeedsScaling(false), mFixedSize(false)
{
}

@@ -274,13 +274,10 @@ slowpath:

void Layer::drawForSreenShot() const
{
    bool currentFixedSize = mFixedSize;
    bool currentBlending = mNeedsBlending;
    const_cast<Layer*>(this)->mFixedSize = false;
    const_cast<Layer*>(this)->mFixedSize = true;
    const bool currentFiltering = mNeedsFiltering;
    const_cast<Layer*>(this)->mNeedsFiltering = true;
    LayerBase::drawForSreenShot();
    const_cast<Layer*>(this)->mFixedSize = currentFixedSize;
    const_cast<Layer*>(this)->mNeedsBlending = currentBlending;
    const_cast<Layer*>(this)->mNeedsFiltering = currentFiltering;
}

void Layer::onDraw(const Region& clip) const
@@ -318,11 +315,10 @@ void Layer::onDraw(const Region& clip) const
bool Layer::needsFiltering() const
{
    if (!(mFlags & DisplayHardware::SLOW_CONFIG)) {
        // NOTE: there is a race here, because mFixedSize is updated in a
        // binder transaction. however, it doesn't really matter since it is
        // evaluated each time we draw. To be perfectly correct, this flag
        // would have to be associated with a buffer.
        if (mFixedSize)
        // if our buffer is not the same size than ourselves,
        // we need filtering.
        Mutex::Autolock _l(mLock);
        if (mNeedsScaling)
            return true;
    }
    return LayerBase::needsFiltering();
@@ -396,6 +392,7 @@ sp<GraphicBuffer> Layer::requestBuffer(int index,
            mReqHeight = reqHeight;
            mReqFormat = reqFormat;
            mFixedSize = fixedSize;
            mNeedsScaling = mWidth != mReqWidth || mHeight != mReqHeight;

            lcblk->reallocateAllExcept(index);
        }
@@ -519,6 +516,7 @@ void Layer::setBufferSize(uint32_t w, uint32_t h) {
    Mutex::Autolock _l(mLock);
    mWidth = w;
    mHeight = h;
    mNeedsScaling = mWidth != mReqWidth || mHeight != mReqHeight;
}

bool Layer::isFixedSize() const {
+1 −0
Original line number Diff line number Diff line
@@ -233,6 +233,7 @@ private:
    uint32_t mReqWidth;
    uint32_t mReqHeight;
    uint32_t mReqFormat;
    bool mNeedsScaling;
    bool mFixedSize;
};

+4 −8
Original line number Diff line number Diff line
@@ -216,14 +216,10 @@ uint32_t LayerBase::doTransaction(uint32_t flags)
        flags |= eVisibleRegion;
        this->contentDirty = true;

        mNeedsFiltering = false;
        if (!(mFlags & DisplayHardware::SLOW_CONFIG)) {
        // we may use linear filtering, if the matrix scales us
        const uint8_t type = temp.transform.getType();
            if (!temp.transform.preserveRects() || (type >= Transform::SCALE)) {
                mNeedsFiltering = true;
            }
        }
        mNeedsFiltering = (!temp.transform.preserveRects() ||
                (type >= Transform::SCALE));
    }

    // Commit the transaction
+3 −1
Original line number Diff line number Diff line
@@ -191,7 +191,9 @@ public:
    /**
     * needsLinearFiltering - true if this surface needs filtering
     */
    virtual bool needsFiltering() const { return mNeedsFiltering; }
    virtual bool needsFiltering() const {
        return (!(mFlags & DisplayHardware::SLOW_CONFIG)) && mNeedsFiltering;
    }

    /**
     * isSecure - true if this surface is secure, that is if it prevents