summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2009-06-23 20:06:46 -0700
committerMathias Agopian <mathias@google.com>2009-06-23 20:06:46 -0700
commitc6603951d45fc9b0d1776fec9444b6f31af92840 (patch)
tree862d116c32f53ea2f206caa7aefc509087c44a38
parentf6c2a1ae60a190951b1c9e93f64f62a000cb51fd (diff)
downloadframeworks_base-c6603951d45fc9b0d1776fec9444b6f31af92840.zip
frameworks_base-c6603951d45fc9b0d1776fec9444b6f31af92840.tar.gz
frameworks_base-c6603951d45fc9b0d1776fec9444b6f31af92840.tar.bz2
fix a bug causing push-buffer surfaces' identity to be garbage, which resulted in some attributes (size/pos) to fail to be set
-rw-r--r--libs/surfaceflinger/LayerBase.cpp8
-rw-r--r--libs/surfaceflinger/LayerBase.h7
-rw-r--r--libs/surfaceflinger/LayerBuffer.cpp1
3 files changed, 8 insertions, 8 deletions
diff --git a/libs/surfaceflinger/LayerBase.cpp b/libs/surfaceflinger/LayerBase.cpp
index 5fa14b2..a841ab3 100644
--- a/libs/surfaceflinger/LayerBase.cpp
+++ b/libs/surfaceflinger/LayerBase.cpp
@@ -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)))
{
}
diff --git a/libs/surfaceflinger/LayerBase.h b/libs/surfaceflinger/LayerBase.h
index dad3d3d..6fb1d1c 100644
--- a/libs/surfaceflinger/LayerBase.h
+++ b/libs/surfaceflinger/LayerBase.h
@@ -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;
};
// ---------------------------------------------------------------------------
diff --git a/libs/surfaceflinger/LayerBuffer.cpp b/libs/surfaceflinger/LayerBuffer.cpp
index 3db5434..22fd499 100644
--- a/libs/surfaceflinger/LayerBuffer.cpp
+++ b/libs/surfaceflinger/LayerBuffer.cpp
@@ -52,6 +52,7 @@ LayerBuffer::~LayerBuffer()
void LayerBuffer::onFirstRef()
{
+ LayerBaseClient::onFirstRef();
mSurface = new SurfaceBuffer(mFlinger, clientIndex(),
const_cast<LayerBuffer *>(this));
}