diff options
author | Mathias Agopian <mathias@google.com> | 2010-05-07 15:58:44 -0700 |
---|---|---|
committer | Mathias Agopian <mathias@google.com> | 2010-05-12 17:28:20 -0700 |
commit | 59751dbf7d8f12aeb5c4c07719b7dbbf1f9b5d4b (patch) | |
tree | a1f1d7119a8109d06cfc2f24b26284ff7627de7a /libs/surfaceflinger_client/Surface.cpp | |
parent | 9f2c4fd9a14ea79e4cbbd3ab8925794711a6411c (diff) | |
download | frameworks_base-59751dbf7d8f12aeb5c4c07719b7dbbf1f9b5d4b.zip frameworks_base-59751dbf7d8f12aeb5c4c07719b7dbbf1f9b5d4b.tar.gz frameworks_base-59751dbf7d8f12aeb5c4c07719b7dbbf1f9b5d4b.tar.bz2 |
SharedBufferStack now can grow up to 16 buffers.
there is a new resize() api, which currently only allows growing.
Change-Id: Ia37b81b73be466d2491ffed7f3a23cd8e113c6fe
Diffstat (limited to 'libs/surfaceflinger_client/Surface.cpp')
-rw-r--r-- | libs/surfaceflinger_client/Surface.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/libs/surfaceflinger_client/Surface.cpp b/libs/surfaceflinger_client/Surface.cpp index eee4dae..afbeafb 100644 --- a/libs/surfaceflinger_client/Surface.cpp +++ b/libs/surfaceflinger_client/Surface.cpp @@ -673,6 +673,27 @@ int Surface::crop(Rect const* rect) return NO_ERROR; } +int Surface::setBufferCount(int bufferCount) +{ + sp<ISurface> s(mSurface); + if (s == 0) return NO_INIT; + + // FIXME: this needs to be synchronized dequeue/queue + + status_t err = s->setBufferCount(bufferCount); + 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; +} + // ---------------------------------------------------------------------------- |