diff --git a/services/surfaceflinger/LayerBase.cpp b/services/surfaceflinger/LayerBase.cpp index 8a021cbfc..0c1fcf912 100644 --- a/services/surfaceflinger/LayerBase.cpp +++ b/services/surfaceflinger/LayerBase.cpp @@ -503,12 +503,18 @@ void LayerBase::drawWithOpenGL(const Region& clip, const Texture& texture) const void LayerBase::setBufferCrop(const Rect& crop) { if (!crop.isEmpty()) { - mBufferCrop = crop; + if (mBufferCrop != crop) { + mBufferCrop = crop; + mFlinger->invalidateHwcGeometry(); + } } } void LayerBase::setBufferTransform(uint32_t transform) { - mBufferTransform = transform; + if (mBufferTransform != transform) { + mBufferTransform = transform; + mFlinger->invalidateHwcGeometry(); + } } void LayerBase::dump(String8& result, char* buffer, size_t SIZE) const diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index 967ff1a83..77695d73e 100644 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp @@ -465,7 +465,7 @@ void SurfaceFlinger::handleTransaction(uint32_t transactionFlags) handleTransactionLocked(transactionFlags, ditchedLayers); mLastTransactionTime = systemTime() - now; mDebugInTransaction = 0; - mHwWorkListDirty = true; + invalidateHwcGeometry(); // here the transaction has been committed } @@ -731,13 +731,18 @@ void SurfaceFlinger::handlePageFlip() mWormholeRegion = screenRegion.subtract(opaqueRegion); mVisibleRegionsDirty = false; - mHwWorkListDirty = true; + invalidateHwcGeometry(); } unlockPageFlip(currentLayers); mDirtyRegion.andSelf(screenRegion); } +void SurfaceFlinger::invalidateHwcGeometry() +{ + mHwWorkListDirty = true; +} + bool SurfaceFlinger::lockPageFlip(const LayerVector& currentLayers) { bool recomputeVisibleRegions = false; @@ -1591,7 +1596,7 @@ status_t SurfaceFlinger::onTransact( case 1008: // toggle use of hw composer n = data.readInt32(); mDebugDisableHWC = n ? 1 : 0; - mHwWorkListDirty = true; + invalidateHwcGeometry(); // fall-through... case 1004:{ // repaint everything Mutex::Autolock _l(mStateLock); diff --git a/services/surfaceflinger/SurfaceFlinger.h b/services/surfaceflinger/SurfaceFlinger.h index 2f2977a36..2591123da 100644 --- a/services/surfaceflinger/SurfaceFlinger.h +++ b/services/surfaceflinger/SurfaceFlinger.h @@ -225,6 +225,7 @@ public: status_t removeLayer(const sp& layer); status_t addLayer(const sp& layer); status_t invalidateLayerVisibility(const sp& layer); + void invalidateHwcGeometry(); sp getLayer(const sp& sur) const;