summaryrefslogtreecommitdiff
path: root/libs/gui/LayerState.cpp
diff options
context:
space:
mode:
author Marissa Wall <marissaw@google.com> 2019-03-29 14:03:53 -0700
committer Valerie Hau <vhau@google.com> 2019-04-16 15:39:28 -0700
commit947d34ecad84bdaf496748eeb9f6e35b33deb339 (patch)
tree29f668d1d193b97ab93d74b0d4cdc7b0bd239c3f /libs/gui/LayerState.cpp
parent1688f5246f156e815bd7b07ba7d5c39cc821e8d6 (diff)
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
Diffstat (limited to 'libs/gui/LayerState.cpp')
-rw-r--r--libs/gui/LayerState.cpp8
1 files changed, 4 insertions, 4 deletions
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<const float*>(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();