Change small area detection to support new front end design
This will still use legacy layer to calculate the small dirty, and
update the info to the LayerSnapshot.
Also fix some issues in setIsSmallDirty() for
1. Set mSmallDirty flag as false if the surface damage region is
invalid.
2. Apply the scaling to the damage region before dirty area
calculations.
Bug: 295062543
Bug: 303258910
Bug: 303609027
Test: atest LayerHistoryTest
Test: atest SmallAreaDetectionTest
Change-Id: Ib0e3737e63b5653422b5b5054b893578dc63f768
diff --git a/services/surfaceflinger/Layer.h b/services/surfaceflinger/Layer.h
index f67da2a..c042395 100644
--- a/services/surfaceflinger/Layer.h
+++ b/services/surfaceflinger/Layer.h
@@ -937,7 +937,8 @@
const sp<SurfaceFlinger> mFlinger;
// Check if the damage region is a small dirty.
- void setIsSmallDirty();
+ void setIsSmallDirty(const Region& damageRegion, const ui::Transform& layerToDisplayTransform);
+ void setIsSmallDirty(frontend::LayerSnapshot* snapshot);
protected:
// For unit tests