summaryrefslogtreecommitdiffstats
path: root/include/surfaceflinger
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2010-06-04 18:26:32 -0700
committerMathias Agopian <mathias@google.com>2010-06-04 18:57:41 -0700
commitfae5cb2b356a1fef172b43066180a7ab4c32dbac (patch)
tree55e73b81c3a666ab1165603238e7ca43495ff99c /include/surfaceflinger
parent7623da435e45c7c03ef6a00a43675deb6645f070 (diff)
downloadframeworks_base-fae5cb2b356a1fef172b43066180a7ab4c32dbac.zip
frameworks_base-fae5cb2b356a1fef172b43066180a7ab4c32dbac.tar.gz
frameworks_base-fae5cb2b356a1fef172b43066180a7ab4c32dbac.tar.bz2
optimize Surface.readFromParcel()
this is called for each relayout() and used to create a full Surface (cpp) which in turn did some heavy work (including an IPC with surfaceflinger), most of the time to destroy it immediatelly when the returned surface (the one in the parcel) was the same. we now more intelligentely read from the parcel and construct the new object only if needed. Change-Id: Idfd40d9ac96ffc6d4ae5fd99bcc0773e131e2267
Diffstat (limited to 'include/surfaceflinger')
-rw-r--r--include/surfaceflinger/Surface.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/include/surfaceflinger/Surface.h b/include/surfaceflinger/Surface.h
index 67dc693..ac01ce5 100644
--- a/include/surfaceflinger/Surface.h
+++ b/include/surfaceflinger/Surface.h
@@ -145,15 +145,13 @@ public:
uint32_t reserved[2];
};
- Surface(const Parcel& data);
+ static sp<Surface> readFromParcel(
+ const Parcel& data, const sp<Surface>& other);
static bool isValid(const sp<Surface>& surface) {
return (surface != 0) && surface->isValid();
}
- static bool isSameSurface(
- const sp<Surface>& lhs, const sp<Surface>& rhs);
-
bool isValid();
SurfaceID ID() const { return mToken; }
uint32_t getFlags() const { return mFlags; }
@@ -191,6 +189,7 @@ private:
Surface(const Surface& rhs);
Surface(const sp<SurfaceControl>& control);
+ Surface(const Parcel& data, const sp<IBinder>& ref);
~Surface();