fix [3312683] Camera mirroring problem after switching from back to front camera
the crop as well as buffer orientation can change at every frame, when that happens
we need to reset the hwc HAL (ie: set the GEOMETRY_CHANGED flag).
currently we achieve this by taking the same code path than an actual geometry change
which is a bit more heavy than necessary.
Change-Id: I751f9ed1eeec0c27db7df2e77d5d17c6bcc17a24
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index c982ea5..9d32547 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -460,7 +460,7 @@
handleTransactionLocked(transactionFlags, ditchedLayers);
mLastTransactionTime = systemTime() - now;
mDebugInTransaction = 0;
- mHwWorkListDirty = true;
+ invalidateHwcGeometry();
// here the transaction has been committed
}
@@ -726,13 +726,18 @@
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;
@@ -1586,7 +1591,7 @@
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);