summaryrefslogtreecommitdiffstats
path: root/libs/surfaceflinger/Layer.cpp
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2009-08-13 19:08:00 -0700
committerMathias Agopian <mathias@google.com>2009-08-13 19:08:00 -0700
commitc4915de8bb9454b8f10b0c9b7ac21e2bb7f65202 (patch)
treeb3d975906a93fdbbaad47334c867d0be768f07c7 /libs/surfaceflinger/Layer.cpp
parentf233915016a9053c23af6e4bceb319e7140f71bc (diff)
downloadframeworks_base-c4915de8bb9454b8f10b0c9b7ac21e2bb7f65202.zip
frameworks_base-c4915de8bb9454b8f10b0c9b7ac21e2bb7f65202.tar.gz
frameworks_base-c4915de8bb9454b8f10b0c9b7ac21e2bb7f65202.tar.bz2
fix a bug that could cause a window to be hidden in some cases.
this would happen is the window is made visible but the client didn't render yet into it. This happens often with SurfaceView. Instead of filling the window with solid black, SF would simply ignore it which could lead to more disturbing artifacts. in theory the window manager should not display a window before it has been drawn into, but it does happen occasionnaly.
Diffstat (limited to 'libs/surfaceflinger/Layer.cpp')
-rw-r--r--libs/surfaceflinger/Layer.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/libs/surfaceflinger/Layer.cpp b/libs/surfaceflinger/Layer.cpp
index ac4bf7b..6f92515 100644
--- a/libs/surfaceflinger/Layer.cpp
+++ b/libs/surfaceflinger/Layer.cpp
@@ -596,7 +596,12 @@ Region Layer::post(uint32_t* previousSate, bool& recomputeVisibleRegions)
Point Layer::getPhysicalSize() const
{
sp<const Buffer> front(frontBuffer().getBuffer());
- return Point(front->getWidth(), front->getHeight());
+ Point size(front->getWidth(), front->getHeight());
+ if ((size.x | size.y) == 0) {
+ // if we don't have a buffer yet, just use the state's size.
+ size = LayerBase::getPhysicalSize();
+ }
+ return size;
}
void Layer::unlockPageFlip(