summaryrefslogtreecommitdiffstats
path: root/libs/surfaceflinger_client/Surface.cpp
diff options
context:
space:
mode:
authorJamie Gennis <jgennis@google.com>2010-11-11 15:26:21 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2010-11-11 15:26:21 -0800
commit7ab17a3426d3565f72c6832bb650d1709cbf52cf (patch)
tree90e188808e39d3447b880ca20cac6b2fad137921 /libs/surfaceflinger_client/Surface.cpp
parente1ccfb7f6e63f639988d9b50f060612f96c49c3f (diff)
parent6c925d00e131e40811897e0ddc332d6f5bc83178 (diff)
downloadframeworks_base-7ab17a3426d3565f72c6832bb650d1709cbf52cf.zip
frameworks_base-7ab17a3426d3565f72c6832bb650d1709cbf52cf.tar.gz
frameworks_base-7ab17a3426d3565f72c6832bb650d1709cbf52cf.tar.bz2
Merge "Implement reducing the buffer count of a Surface."
Diffstat (limited to 'libs/surfaceflinger_client/Surface.cpp')
-rw-r--r--libs/surfaceflinger_client/Surface.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/libs/surfaceflinger_client/Surface.cpp b/libs/surfaceflinger_client/Surface.cpp
index c1e00ca..9467a4c 100644
--- a/libs/surfaceflinger_client/Surface.cpp
+++ b/libs/surfaceflinger_client/Surface.cpp
@@ -855,6 +855,12 @@ int Surface::setBufferCount(int bufferCount)
status_t err = mSharedBufferClient->setBufferCount(bufferCount, ipc);
LOGE_IF(err, "ISurface::setBufferCount(%d) returned %s",
bufferCount, strerror(-err));
+
+ if (err == NO_ERROR) {
+ // Clear out any references to the old buffers.
+ mBuffers.clear();
+ }
+
return err;
}