From 947d34ecad84bdaf496748eeb9f6e35b33deb339 Mon Sep 17 00:00:00 2001 From: Marissa Wall Date: Fri, 29 Mar 2019 14:03:53 -0700 Subject: Change slot generation for BufferState BufferState layers now do slot generation with buffer death considered appropriately. When a buffer dies, the slot will be pushed onto a stack of available slots to be reused at the next opportunity. This should mimic BufferQueue slot behavior and prevent Composer Resources from growing too large. Test: build, boot, manual Bug: 129351223 Change-Id: Icef9592593cacb0b5c6b12f6679fc2c4dabdcd19 --- libs/gui/LayerState.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'libs/gui/LayerState.cpp') diff --git a/libs/gui/LayerState.cpp b/libs/gui/LayerState.cpp index 3077b21da7..075bb52e3c 100644 --- a/libs/gui/LayerState.cpp +++ b/libs/gui/LayerState.cpp @@ -87,8 +87,8 @@ status_t layer_state_t::write(Parcel& output) const colorTransform.asArray(), 16 * sizeof(float)); output.writeFloat(cornerRadius); output.writeBool(hasListenerCallbacks); - output.writeStrongBinder(cachedBuffer.token); - output.writeUint64(cachedBuffer.cacheId); + output.writeWeakBinder(cachedBuffer.token); + output.writeUint64(cachedBuffer.id); output.writeParcelable(metadata); output.writeFloat(bgColorAlpha); @@ -157,8 +157,8 @@ status_t layer_state_t::read(const Parcel& input) colorTransform = mat4(static_cast(input.readInplace(16 * sizeof(float)))); cornerRadius = input.readFloat(); hasListenerCallbacks = input.readBool(); - cachedBuffer.token = input.readStrongBinder(); - cachedBuffer.cacheId = input.readUint64(); + cachedBuffer.token = input.readWeakBinder(); + cachedBuffer.id = input.readUint64(); input.readParcelable(&metadata); bgColorAlpha = input.readFloat(); -- cgit v1.2.3-59-g8ed1b