From a8a0aa8b922c45fb4633f51610f264a19f9bd825 Mon Sep 17 00:00:00 2001 From: Mathias Agopian Date: Wed, 21 Apr 2010 15:24:11 -0700 Subject: better fix for [2420565] Surface.lockCanvas() updates the dirty region too often Change-Id: I83438b40effd21538f1c74396dc665254b9d5ab6 --- libs/surfaceflinger/Layer.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'libs/surfaceflinger/Layer.cpp') diff --git a/libs/surfaceflinger/Layer.cpp b/libs/surfaceflinger/Layer.cpp index 0a3254dec5c0..1a66970210d7 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( -- cgit v1.2.3-59-g8ed1b