summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorJamie Gennis <jgennis@google.com>2011-07-29 16:18:38 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-07-29 16:18:38 -0700
commitf1d459d62547f1999866480db094272be0d06413 (patch)
treee4fbe18ee9166932202c6e1b58f694f98cacd002 /services
parentd75f09f7f9508a0d6851bc376c50f2a0ae99d1b2 (diff)
parentc054570547103412664c89ad748fd4503aaa36be (diff)
downloadframeworks_base-f1d459d62547f1999866480db094272be0d06413.zip
frameworks_base-f1d459d62547f1999866480db094272be0d06413.tar.gz
frameworks_base-f1d459d62547f1999866480db094272be0d06413.tar.bz2
Merge "SurfaceFlinger: fix a layer occlusion bug"
Diffstat (limited to 'services')
-rw-r--r--services/surfaceflinger/Layer.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp
index 7d6a14d..63062cc 100644
--- a/services/surfaceflinger/Layer.cpp
+++ b/services/surfaceflinger/Layer.cpp
@@ -326,8 +326,9 @@ bool Layer::isOpaque() const
{
// if we don't have a buffer yet, we're translucent regardless of the
// layer's opaque flag.
- if (mActiveBuffer == 0)
+ if (mActiveBuffer == 0) {
return false;
+ }
// if the layer has the opaque flag, then we're always opaque,
// otherwise we use the current buffer's format.
@@ -411,6 +412,8 @@ bool Layer::isCropped() const {
void Layer::lockPageFlip(bool& recomputeVisibleRegions)
{
if (mQueuedFrames > 0) {
+ const bool oldOpacity = isOpaque();
+
// signal another event if we have more frames pending
if (android_atomic_dec(&mQueuedFrames) > 1) {
mFlinger->signalEvent();
@@ -438,9 +441,8 @@ void Layer::lockPageFlip(bool& recomputeVisibleRegions)
mFlinger->invalidateHwcGeometry();
}
- const bool opacity(getOpacityForFormat(mActiveBuffer->format));
- if (opacity != mCurrentOpacity) {
- mCurrentOpacity = opacity;
+ mCurrentOpacity = getOpacityForFormat(mActiveBuffer->format);
+ if (oldOpacity != isOpaque()) {
recomputeVisibleRegions = true;
}