summaryrefslogtreecommitdiff
path: root/libs/gui/BufferQueueThreadState.cpp
diff options
context:
space:
mode:
author Chavi Weingarten <chaviw@google.com> 2022-09-15 20:34:48 +0000
committer Chavi Weingarten <chaviw@google.com> 2022-09-16 13:20:53 +0000
commit1ac2a9297dc31a9d54cac2d5723f9d021985e7dd (patch)
treef2267141f4e5d8d3080c8da4a0e91cb2754969fe /libs/gui/BufferQueueThreadState.cpp
parentcc8be8c3a1c938cd8a1226608e4b830b470f25ff (diff)
Fixed bug with caching buffers
SCC::cacheBuffers checks if the Transaction contains a buffer before looking through the states. However, the flag mContainsBuffer could be cleared if a single layer clears the buffer. This isn't correct since there could be other SC in the Transaction that have a buffer and we would end up not caching them. Rename mContainsBuffer to mMayContainBuffer since it's more of a hint that the Transaction may have a buffer. It's not really worth storing a count when we're going to check each layer anyway. mMayContainBuffer just helps optimize in the scenario when we know for sure that no buffer has even been set before apply was called. Additionally, remove the code that clears mMayContainBuffer when the buffer has been removed since there may be a different buffer set for a different SC. Because mMayContainBuffer is only used to determine whether to cache, there's no need to parcel it. When writeToParcel is called, the data is cached so the other process doesn't need to know about it. Test: Builds Bug: 246986005 Change-Id: Id642cba7f13112084d842b1222b2bc7256d2e577
Diffstat (limited to 'libs/gui/BufferQueueThreadState.cpp')
0 files changed, 0 insertions, 0 deletions