diff options
author | Mathias Agopian <mathias@google.com> | 2010-04-21 15:24:11 -0700 |
---|---|---|
committer | Mathias Agopian <mathias@google.com> | 2010-04-21 22:25:35 -0700 |
commit | 245e4d78c5fb304fe153c36303ec69bf8a907f65 (patch) | |
tree | 9663613ba57dbd7a2b9721f08c86419d3a349c1e /libs/surfaceflinger | |
parent | ef69d8b0c9ef205b0ca867ecf66e0e9a20cd187a (diff) | |
download | frameworks_native-245e4d78c5fb304fe153c36303ec69bf8a907f65.zip frameworks_native-245e4d78c5fb304fe153c36303ec69bf8a907f65.tar.gz frameworks_native-245e4d78c5fb304fe153c36303ec69bf8a907f65.tar.bz2 |
better fix for [2420565] Surface.lockCanvas() updates the dirty region too often
Change-Id: I83438b40effd21538f1c74396dc665254b9d5ab6
Diffstat (limited to 'libs/surfaceflinger')
-rw-r--r-- | libs/surfaceflinger/Layer.cpp | 12 | ||||
-rw-r--r-- | libs/surfaceflinger/LayerBase.cpp | 2 |
2 files changed, 10 insertions, 4 deletions
diff --git a/libs/surfaceflinger/Layer.cpp b/libs/surfaceflinger/Layer.cpp index 0a3254d..1a66970 100644 --- a/libs/surfaceflinger/Layer.cpp +++ b/libs/surfaceflinger/Layer.cpp @@ -540,9 +540,15 @@ void Layer::lockPageFlip(bool& recomputeVisibleRegions) mFlinger->signalEvent(); } - if (!mPostedDirtyRegion.isEmpty()) { - reloadTexture( mPostedDirtyRegion ); - } + /* a buffer was posted, so we need to call reloadTexture(), which + * will update our internal data structures (eg: EGLImageKHR or + * texture names). we need to do this even if mPostedDirtyRegion is + * empty -- it's orthogonal to the fact that a new buffer was posted, + * for instance, a degenerate case could be that the user did an empty + * update but repainted the buffer with appropriate content (after a + * resize for instance). + */ + reloadTexture( mPostedDirtyRegion ); } void Layer::unlockPageFlip( diff --git a/libs/surfaceflinger/LayerBase.cpp b/libs/surfaceflinger/LayerBase.cpp index 6dc8f10..7feccda 100644 --- a/libs/surfaceflinger/LayerBase.cpp +++ b/libs/surfaceflinger/LayerBase.cpp @@ -54,7 +54,7 @@ LayerBase::LayerBase(SurfaceFlinger* flinger, DisplayID display) mOrientation(0), mLeft(0), mTop(0), mTransactionFlags(0), - mPremultipliedAlpha(true), mDebug(false), + mPremultipliedAlpha(true), mName("unnamed"), mDebug(false), mInvalidate(0) { const DisplayHardware& hw(flinger->graphicPlane(0).displayHardware()); |