diff options
author | Mathias Agopian <mathias@google.com> | 2010-05-10 09:49:19 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2010-05-10 09:49:19 -0700 |
commit | 0c7af77450f9bddb9b1c32971673458c9d486f55 (patch) | |
tree | b013fbb9d1d2f493488ba7f3fcebca98f88110c1 /libs/surfaceflinger/Layer.cpp | |
parent | 46bd7e9d0a2d98725e57c016128347be55d56c28 (diff) | |
parent | e7c4447296298a83ba51b85a92c566ac651f5324 (diff) | |
download | frameworks_native-0c7af77450f9bddb9b1c32971673458c9d486f55.zip frameworks_native-0c7af77450f9bddb9b1c32971673458c9d486f55.tar.gz frameworks_native-0c7af77450f9bddb9b1c32971673458c9d486f55.tar.bz2 |
am 56aed6bd: am c69775d6: Merge "fix [2664345] Flash: Bad flicker at the end of a pinch zoom." into froyo
Merge commit '56aed6bde0c52658d2cb1207c0cfe8ba0a764c59' into kraken
* commit '56aed6bde0c52658d2cb1207c0cfe8ba0a764c59':
fix [2664345] Flash: Bad flicker at the end of a pinch zoom.
Diffstat (limited to 'libs/surfaceflinger/Layer.cpp')
-rw-r--r-- | libs/surfaceflinger/Layer.cpp | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/libs/surfaceflinger/Layer.cpp b/libs/surfaceflinger/Layer.cpp index 566428f..e6658fa 100644 --- a/libs/surfaceflinger/Layer.cpp +++ b/libs/surfaceflinger/Layer.cpp @@ -276,9 +276,28 @@ void Layer::onDraw(const Region& clip) const GLuint textureName = mTextures[index].name; if (UNLIKELY(textureName == -1LU)) { // the texture has not been created yet, this Layer has - // in fact never been drawn into. this happens frequently with - // SurfaceView. - clearWithOpenGL(clip); + // in fact never been drawn into. This happens frequently with + // SurfaceView because the WindowManager can't know when the client + // has drawn the first time. + + // If there is nothing under us, we paint the screen in black, otherwise + // we just skip this update. + + // figure out if there is something below us + Region under; + const SurfaceFlinger::LayerVector& drawingLayers(mFlinger->mDrawingState.layersSortedByZ); + const size_t count = drawingLayers.size(); + for (size_t i=0 ; i<count ; ++i) { + const sp<LayerBase>& layer(drawingLayers[i]); + if (layer.get() == static_cast<LayerBase const*>(this)) + break; + under.orSelf(layer->visibleRegionScreen); + } + // if not everything below us is covered, we plug the holes! + Region holes(clip.subtract(under)); + if (!holes.isEmpty()) { + clearWithOpenGL(holes); + } return; } drawWithOpenGL(clip, mTextures[index]); |