summaryrefslogtreecommitdiff
path: root/services/surfaceflinger/SurfaceFlinger.h
diff options
context:
space:
mode:
author Mathias Agopian <mathias@google.com> 2011-06-06 15:21:44 -0700
committer Android Git Automerger <android-git-automerger@android.com> 2011-06-06 15:21:44 -0700
commitc1cbf4525b4d12b6cb7908072d36c8f6ca819f5b (patch)
treece173c0b5701869e56fb967aa76185b4ab592131 /services/surfaceflinger/SurfaceFlinger.h
parente9d32283e4eca1ee27218ed66f754a694678ac6d (diff)
parent24855c09173a6caaec7dcedd0c2d7ce15121d39b (diff)
am 24855c09: merge various SF fixes from gingerbread to honeycomb-mr2 (DO NOT MERGE)
* commit '24855c09173a6caaec7dcedd0c2d7ce15121d39b': merge various SF fixes from gingerbread to honeycomb-mr2 (DO NOT MERGE)
Diffstat (limited to 'services/surfaceflinger/SurfaceFlinger.h')
-rw-r--r--services/surfaceflinger/SurfaceFlinger.h26
1 files changed, 19 insertions, 7 deletions
diff --git a/services/surfaceflinger/SurfaceFlinger.h b/services/surfaceflinger/SurfaceFlinger.h
index 95668190f456..f81b074ea704 100644
--- a/services/surfaceflinger/SurfaceFlinger.h
+++ b/services/surfaceflinger/SurfaceFlinger.h
@@ -65,7 +65,7 @@ public:
status_t initCheck() const;
// protected by SurfaceFlinger::mStateLock
- ssize_t attachLayer(const sp<LayerBaseClient>& layer);
+ size_t attachLayer(const sp<LayerBaseClient>& layer);
void detachLayer(const LayerBaseClient* layer);
sp<LayerBaseClient> getLayerUser(int32_t i) const;
@@ -81,9 +81,15 @@ private:
virtual status_t destroySurface(SurfaceID surfaceId);
virtual status_t setState(int32_t count, const layer_state_t* states);
- DefaultKeyedVector< size_t, wp<LayerBaseClient> > mLayers;
+ // constant
sp<SurfaceFlinger> mFlinger;
- int32_t mNameGenerator;
+
+ // protected by mLock
+ DefaultKeyedVector< size_t, wp<LayerBaseClient> > mLayers;
+ size_t mNameGenerator;
+
+ // thread-safe
+ mutable Mutex mLock;
};
class UserClient : public BnSurfaceComposerClient
@@ -227,6 +233,7 @@ public:
status_t addLayer(const sp<LayerBase>& layer);
status_t invalidateLayerVisibility(const sp<LayerBase>& layer);
void invalidateHwcGeometry();
+ void destroyLayer(LayerBase const* layer);
sp<Layer> getLayer(const sp<ISurface>& sur) const;
@@ -254,7 +261,7 @@ private:
uint32_t w, uint32_t h, uint32_t flags);
status_t removeSurface(const sp<Client>& client, SurfaceID sid);
- status_t destroySurface(const sp<LayerBaseClient>& layer);
+ status_t destroySurface(const wp<LayerBaseClient>& layer);
status_t setClientState(const sp<Client>& client,
int32_t count, const layer_state_t* states);
@@ -299,9 +306,8 @@ public: // hack to work around gcc 4.0.3 bug
private:
void handleConsoleEvents();
void handleTransaction(uint32_t transactionFlags);
- void handleTransactionLocked(
- uint32_t transactionFlags,
- Vector< sp<LayerBase> >& ditchedLayers);
+ void handleTransactionLocked(uint32_t transactionFlags);
+ void handleDestroyLayers();
void computeVisibleRegions(
LayerVector& currentLayers,
@@ -324,6 +330,7 @@ private:
status_t purgatorizeLayer_l(const sp<LayerBase>& layer);
uint32_t getTransactionFlags(uint32_t flags);
+ uint32_t peekTransactionFlags(uint32_t flags);
uint32_t setTransactionFlags(uint32_t flags);
void commitTransaction();
@@ -422,6 +429,11 @@ private:
// these are thread safe
mutable Barrier mReadyToRunBarrier;
+
+ // protected by mDestroyedLayerLock;
+ mutable Mutex mDestroyedLayerLock;
+ Vector<LayerBase const *> mDestroyedLayers;
+
// atomic variables
enum {
eConsoleReleased = 1,