summaryrefslogtreecommitdiffstats
path: root/libs/surfaceflinger
diff options
context:
space:
mode:
authorRebecca Schultz Zavin <rebecca@android.com>2009-07-21 16:17:59 -0700
committerRebecca Schultz Zavin <rebecca@android.com>2009-07-22 17:17:46 -0700
commit43ab76389ead0ef90e3d4fa883d5a58c34a6801b (patch)
tree0646d5b10bf9a386fc95e87427ab027cab13a124 /libs/surfaceflinger
parent7ac5e698b216a1b1af97405b43adf2ad5bc40e7d (diff)
downloadframeworks_base-43ab76389ead0ef90e3d4fa883d5a58c34a6801b.zip
frameworks_base-43ab76389ead0ef90e3d4fa883d5a58c34a6801b.tar.gz
frameworks_base-43ab76389ead0ef90e3d4fa883d5a58c34a6801b.tar.bz2
Add a flag to set whether the overlay has been initialized. Commit needs to be called at least once on each overlay, and it appears that sometimes this
doesn't happen because the visibility never changes. With this change the overlay parameter and position will be committed when either the visibility of the window changes, or on the first call to visibility resolved, if it hasn't already been done. Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
Diffstat (limited to 'libs/surfaceflinger')
-rw-r--r--libs/surfaceflinger/LayerBuffer.cpp6
-rw-r--r--libs/surfaceflinger/LayerBuffer.h1
2 files changed, 5 insertions, 2 deletions
diff --git a/libs/surfaceflinger/LayerBuffer.cpp b/libs/surfaceflinger/LayerBuffer.cpp
index 2d949a0..90e7f50 100644
--- a/libs/surfaceflinger/LayerBuffer.cpp
+++ b/libs/surfaceflinger/LayerBuffer.cpp
@@ -575,6 +575,7 @@ LayerBuffer::OverlaySource::OverlaySource(LayerBuffer& layer,
mFormat = overlay->format;
mWidthStride = overlay->w_stride;
mHeightStride = overlay->h_stride;
+ mInitialized = false;
mOverlayHandle = overlay->getHandleRef(overlay);
@@ -614,8 +615,9 @@ void LayerBuffer::OverlaySource::onVisibilityResolved(
// this code-path must be as tight as possible, it's called each time
// the screen is composited.
if (UNLIKELY(mOverlay != 0)) {
- if (mVisibilityChanged) {
+ if (mVisibilityChanged || !mInitialized) {
mVisibilityChanged = false;
+ mInitialized = true;
const Rect& bounds = mLayer.getTransformedBounds();
int x = bounds.left;
int y = bounds.top;
@@ -627,7 +629,7 @@ void LayerBuffer::OverlaySource::onVisibilityResolved(
if (mOverlay) {
overlay_control_device_t* overlay_dev = mOverlayDevice;
overlay_dev->setPosition(overlay_dev, mOverlay, x,y,w,h);
- overlay_dev->setParameter(overlay_dev, mOverlay,
+ overlay_dev->setParameter(overlay_dev, mOverlay,
OVERLAY_TRANSFORM, mLayer.getOrientation());
overlay_dev->commit(overlay_dev, mOverlay);
}
diff --git a/libs/surfaceflinger/LayerBuffer.h b/libs/surfaceflinger/LayerBuffer.h
index 746790b..8057219 100644
--- a/libs/surfaceflinger/LayerBuffer.h
+++ b/libs/surfaceflinger/LayerBuffer.h
@@ -175,6 +175,7 @@ private:
int32_t mWidthStride;
int32_t mHeightStride;
mutable Mutex mLock;
+ bool mInitialized;
};