summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2012-06-04 18:16:30 -0700
committerMathias Agopian <mathias@google.com>2012-06-04 18:16:30 -0700
commit4824d40a35333182c2eb3593511b9bcbecd0a943 (patch)
treebacce997be8123bdca8c49da0812d99f67e1af5c
parent4467bba73a91161da01d5d969cf7ba3e2309d989 (diff)
downloadnative-4824d40a35333182c2eb3593511b9bcbecd0a943.tar.gz
sometimes SF would not process a surface resize
this would happen when a window started with size A, was resized to B and immediately resized to A. In this situation the erquested and active size would be the same, and SF would think a transaction wasn't needed. we fix this by always comparing the requested sizes. Also, make sure to set mRefreshPending once we're sure we have succesfully called updateTexImage(). Bug: 6580962 Change-Id: I2c48b4df7f05fd35c9e1d2dd82095b0f3d5a0b6a
-rw-r--r--services/surfaceflinger/Layer.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp
index 5e17d07a15..593f1781ae 100644
--- a/services/surfaceflinger/Layer.cpp
+++ b/services/surfaceflinger/Layer.cpp
@@ -428,8 +428,8 @@ uint32_t Layer::doTransaction(uint32_t flags)
const Layer::State& front(drawingState());
const Layer::State& temp(currentState());
- const bool sizeChanged = (temp.requested.w != front.active.w) ||
- (temp.requested.h != front.active.h);
+ const bool sizeChanged = (temp.requested.w != front.requested.w) ||
+ (temp.requested.h != front.requested.h);
if (sizeChanged) {
// the size changed, we need to ask our client to request a new buffer
@@ -516,7 +516,6 @@ void Layer::lockPageFlip(bool& recomputeVisibleRegions)
mPostedDirtyRegion.clear();
return;
}
- mRefreshPending = true;
// Capture the old state of the layer for comparisons later
const bool oldOpacity = isOpaque();
@@ -601,6 +600,7 @@ void Layer::lockPageFlip(bool& recomputeVisibleRegions)
if (!isFixedSize) {
if (front.active.w != bufWidth ||
front.active.h != bufHeight) {
+ // reject this buffer
return true;
}
}
@@ -624,6 +624,7 @@ void Layer::lockPageFlip(bool& recomputeVisibleRegions)
return;
}
+ mRefreshPending = true;
mFrameLatencyNeeded = true;
if (oldActiveBuffer == NULL) {
// the first time we receive a buffer, we need to trigger a