summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Robert Carr <racarr@google.com> 2020-04-08 10:57:07 -0700
committer Robert Carr <racarr@google.com> 2020-04-08 10:57:07 -0700
commit2803792bfa2dbefc2bf03f9417d13aaae2ce5673 (patch)
tree65cec076da97bba6d5d869d8fb690cff02dcb141
parent158531d044690c52dfd1889e699a5f723df44b95 (diff)
SurfaceComposerClient BLAST: Avoid recaching buffers.
cacheBuffers works like this: 1. Look for any State with eBufferChanged 2. If it has a cache entry clear eBufferChanged and set the cache 3. If it doesn't have an entry leave eBufferChanged set, but also set the cache so we can use it next time. In the third case where we don't clear eBufferChanged we might attempt to recache buffers that have already been cached. This might happen in the wrong process. Bug: 153561718 Test: Existing tests pass. BLAST Sync Engine manual test. Change-Id: Ibe02e76d40fedef46a2418587e28e598d6e2c614
-rw-r--r--libs/gui/SurfaceComposerClient.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/libs/gui/SurfaceComposerClient.cpp b/libs/gui/SurfaceComposerClient.cpp
index e89863f48b..605c2e8848 100644
--- a/libs/gui/SurfaceComposerClient.cpp
+++ b/libs/gui/SurfaceComposerClient.cpp
@@ -560,6 +560,11 @@ void SurfaceComposerClient::Transaction::cacheBuffers() {
layer_state_t* s = getLayerState(handle);
if (!(s->what & layer_state_t::eBufferChanged)) {
continue;
+ } else if (s->what & layer_state_t::eCachedBufferChanged) {
+ // If eBufferChanged and eCachedBufferChanged are both trued then that means
+ // we already cached the buffer in a previous call to cacheBuffers, perhaps
+ // from writeToParcel on a Transaction that was merged in to this one.
+ continue;
}
// Don't try to cache a null buffer. Sending null buffers is cheap so we shouldn't waste