summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJorim Jaggi <jjaggi@google.com>2018-06-01 12:16:09 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2018-06-01 12:16:09 +0000
commit70522fe55cdba436e3f8db2b8b049c9a8b02fe3c (patch)
treec251d22dee98ad754a9ef65075edca1cf3b3eee7
parent1572f9b60ed2bedc16c2a534da9f8cb7cc512524 (diff)
parentdba3273a27fb90f19a73abe7142790ad21387484 (diff)
downloadnative-70522fe55cdba436e3f8db2b8b049c9a8b02fe3c.tar.gz
Merge "Push existing pending state when deferring transaction" into pi-dev
-rw-r--r--services/surfaceflinger/Layer.cpp4
-rw-r--r--services/surfaceflinger/Layer.h3
-rw-r--r--services/surfaceflinger/SurfaceFlinger.cpp7
3 files changed, 8 insertions, 6 deletions
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp
index b94af77967..83d08a2322 100644
--- a/services/surfaceflinger/Layer.cpp
+++ b/services/surfaceflinger/Layer.cpp
@@ -920,10 +920,7 @@ void Layer::pushPendingState() {
}
void Layer::popPendingState(State* stateToCommit) {
- auto oldFlags = stateToCommit->flags;
*stateToCommit = mPendingStates[0];
- stateToCommit->flags =
- (oldFlags & ~stateToCommit->mask) | (stateToCommit->flags & stateToCommit->mask);
mPendingStates.removeAt(0);
ATRACE_INT(mTransactionName.string(), mPendingStates.size());
@@ -1270,7 +1267,6 @@ bool Layer::setFlags(uint8_t flags, uint8_t mask) {
if (mCurrentState.flags == newFlags) return false;
mCurrentState.sequence++;
mCurrentState.flags = newFlags;
- mCurrentState.mask = mask;
mCurrentState.modified = true;
setTransactionFlags(eTransactionNeeded);
return true;
diff --git a/services/surfaceflinger/Layer.h b/services/surfaceflinger/Layer.h
index 7342c8b987..ae80043a5d 100644
--- a/services/surfaceflinger/Layer.h
+++ b/services/surfaceflinger/Layer.h
@@ -186,7 +186,6 @@ public:
uint32_t layerStack;
uint8_t flags;
- uint8_t mask;
uint8_t reserved[2];
int32_t sequence; // changes when visible regions can change
bool modified;
@@ -588,6 +587,7 @@ public:
// SurfaceFlinger to complete a transaction.
void commitChildList();
int32_t getZ() const;
+ void pushPendingState();
protected:
// constant
@@ -670,7 +670,6 @@ protected:
// Returns false if the relevant frame has already been latched
bool addSyncPoint(const std::shared_ptr<SyncPoint>& point);
- void pushPendingState();
void popPendingState(State* stateToCommit);
bool applyPendingStates(State* stateToCommit);
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index e66d14e269..97edd357ed 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -3345,6 +3345,13 @@ uint32_t SurfaceFlinger::setClientStateLocked(const ComposerState& composerState
const uint32_t what = s.what;
bool geometryAppliesWithResize =
what & layer_state_t::eGeometryAppliesWithResize;
+
+ // If we are deferring transaction, make sure to push the pending state, as otherwise the
+ // pending state will also be deferred.
+ if (what & layer_state_t::eDeferTransaction) {
+ layer->pushPendingState();
+ }
+
if (what & layer_state_t::ePositionChanged) {
if (layer->setPosition(s.x, s.y, !geometryAppliesWithResize)) {
flags |= eTraversalNeeded;