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

Commit c6603951 authored by Mathias Agopian's avatar Mathias Agopian
Browse files

fix a bug causing push-buffer surfaces' identity to be garbage, which resulted...

fix a bug causing push-buffer surfaces' identity to be garbage, which resulted in some attributes (size/pos) to fail to be set
parent f6c2a1ae
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -53,8 +53,6 @@ const char* const LayerBaseClient::typeID = "LayerBaseClient";

// ---------------------------------------------------------------------------

int32_t LayerBase::sIdentity = 0;

LayerBase::LayerBase(SurfaceFlinger* flinger, DisplayID display)
    : dpy(display), contentDirty(false),
      mFlinger(flinger),
@@ -62,7 +60,6 @@ LayerBase::LayerBase(SurfaceFlinger* flinger, DisplayID display)
      mOrientation(0),
      mTransactionFlags(0),
      mPremultipliedAlpha(true),
      mIdentity(uint32_t(android_atomic_inc(&sIdentity))),
      mInvalidate(0)
{
    const DisplayHardware& hw(flinger->graphicPlane(0).displayHardware());
@@ -644,11 +641,14 @@ regular:

// ---------------------------------------------------------------------------

int32_t LayerBaseClient::sIdentity = 0;

LayerBaseClient::LayerBaseClient(SurfaceFlinger* flinger, DisplayID display,
        const sp<Client>& client, int32_t i)
    : LayerBase(flinger, display), client(client),
      lcblk( client!=0 ? &(client->ctrlblk->layers[i]) : 0 ),
      mIndex(i)
      mIndex(i),
      mIdentity(uint32_t(android_atomic_inc(&sIdentity)))
{
}

+3 −4
Original line number Diff line number Diff line
@@ -277,9 +277,6 @@ protected:
                // don't change, don't need a lock
                bool            mPremultipliedAlpha;

                // only read
    const       uint32_t        mIdentity;
     
                // atomic
    volatile    int32_t         mInvalidate;
                
@@ -290,7 +287,6 @@ protected:
private:
    LayerBase(const LayerBase& rhs);
    void validateTexture(GLint textureName) const;
    static int32_t sIdentity;
};


@@ -360,6 +356,9 @@ private:
                int32_t         mIndex;
    mutable     Mutex           mLock;
    mutable     wp<Surface>     mClientSurface;
    // only read
    const       uint32_t        mIdentity;
    static      int32_t         sIdentity;
};

// ---------------------------------------------------------------------------
+1 −0
Original line number Diff line number Diff line
@@ -52,6 +52,7 @@ LayerBuffer::~LayerBuffer()

void LayerBuffer::onFirstRef()
{
    LayerBaseClient::onFirstRef();
    mSurface = new SurfaceBuffer(mFlinger, clientIndex(),
            const_cast<LayerBuffer *>(this));
}