summaryrefslogtreecommitdiffstats
path: root/libs/surfaceflinger_client/Surface.cpp
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2010-05-21 13:56:48 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2010-05-21 13:56:48 -0700
commitdd56b39ec000b3ddd206d242b0fe24b4b955c8ee (patch)
tree8d764ad288274aea4f01c0802db797d0cc92640d /libs/surfaceflinger_client/Surface.cpp
parent11ec99c0005f4479d096511357d6122bb7edb393 (diff)
parent9840fe2567ea317caa5eddbe1fe9818dc6ca0289 (diff)
downloadframeworks_base-dd56b39ec000b3ddd206d242b0fe24b4b955c8ee.zip
frameworks_base-dd56b39ec000b3ddd206d242b0fe24b4b955c8ee.tar.gz
frameworks_base-dd56b39ec000b3ddd206d242b0fe24b4b955c8ee.tar.bz2
am 9840fe25: am 4f5f2786: Merge "fix the threading issue for setBuffercount()" into kraken
Diffstat (limited to 'libs/surfaceflinger_client/Surface.cpp')
-rw-r--r--libs/surfaceflinger_client/Surface.cpp19
1 files changed, 9 insertions, 10 deletions
diff --git a/libs/surfaceflinger_client/Surface.cpp b/libs/surfaceflinger_client/Surface.cpp
index afbeafb..4d5c0b6 100644
--- a/libs/surfaceflinger_client/Surface.cpp
+++ b/libs/surfaceflinger_client/Surface.cpp
@@ -678,19 +678,18 @@ int Surface::setBufferCount(int bufferCount)
sp<ISurface> s(mSurface);
if (s == 0) return NO_INIT;
- // FIXME: this needs to be synchronized dequeue/queue
+ class SetBufferCountIPC : public SharedBufferClient::SetBufferCountCallback {
+ sp<ISurface> surface;
+ virtual status_t operator()(int bufferCount) const {
+ return surface->setBufferCount(bufferCount);
+ }
+ public:
+ SetBufferCountIPC(const sp<ISurface>& surface) : surface(surface) { }
+ } ipc(s);
- status_t err = s->setBufferCount(bufferCount);
+ status_t err = mSharedBufferClient->setBufferCount(bufferCount, ipc);
LOGE_IF(err, "ISurface::setBufferCount(%d) returned %s",
bufferCount, strerror(-err));
- if (err == NO_ERROR) {
- err = mSharedBufferClient->getStatus();
- LOGE_IF(err, "Surface (identity=%d) state = %d", mIdentity, err);
- if (!err) {
- // update our local copy of the buffer count
- mSharedBufferClient->setBufferCount(bufferCount);
- }
- }
return err;
}