summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJamie Gennis <jgennis@google.com>2010-07-16 16:25:23 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2010-07-16 16:25:23 -0700
commit691a9fcb2bc1b78f1f1048c3d7a39143be9dcdd7 (patch)
treef1910356e96c790b093c43f14b30760343dfa9eb /include
parent5b45b1c274d448a304188d07cb54ac5d2668f203 (diff)
parent04b953132edb5482f0aa6d992f89e7016961528c (diff)
downloadframeworks_base-691a9fcb2bc1b78f1f1048c3d7a39143be9dcdd7.zip
frameworks_base-691a9fcb2bc1b78f1f1048c3d7a39143be9dcdd7.tar.gz
frameworks_base-691a9fcb2bc1b78f1f1048c3d7a39143be9dcdd7.tar.bz2
am 04b95313: am c8c79a65: Merge "Re-use existing Surface objects when reading them from parcels." into gingerbread
Merge commit '04b953132edb5482f0aa6d992f89e7016961528c' * commit '04b953132edb5482f0aa6d992f89e7016961528c': Re-use existing Surface objects when reading them from parcels.
Diffstat (limited to 'include')
-rw-r--r--include/surfaceflinger/Surface.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/include/surfaceflinger/Surface.h b/include/surfaceflinger/Surface.h
index 4fd0681..294c867 100644
--- a/include/surfaceflinger/Surface.h
+++ b/include/surfaceflinger/Surface.h
@@ -20,6 +20,7 @@
#include <stdint.h>
#include <sys/types.h>
+#include <utils/KeyedVector.h>
#include <utils/RefBase.h>
#include <utils/threads.h>
@@ -147,8 +148,7 @@ public:
static status_t writeToParcel(
const sp<Surface>& control, Parcel* parcel);
- static sp<Surface> readFromParcel(
- const Parcel& data, const sp<Surface>& other);
+ static sp<Surface> readFromParcel(const Parcel& data);
static bool isValid(const sp<Surface>& surface) {
return (surface != 0) && surface->isValid();
@@ -244,6 +244,8 @@ private:
uint32_t *pWidth, uint32_t *pHeight,
uint32_t *pFormat, uint32_t *pUsage) const;
+ static void cleanCachedSurfaces();
+
class BufferInfo {
uint32_t mWidth;
uint32_t mHeight;
@@ -298,6 +300,10 @@ private:
// Inherently thread-safe
mutable Mutex mSurfaceLock;
mutable Mutex mApiLock;
+
+ // A cache of Surface objects that have been deserialized into this process.
+ static Mutex sCachedSurfacesLock;
+ static DefaultKeyedVector<wp<IBinder>, wp<Surface> > sCachedSurfaces;
};
}; // namespace android