Update hole punch logic in HWUI
--Updated HWUI holepunch logic for SurfaceView to
also apply the stretch to the hole punch
--Updated RenderNode callbacks to also include
an offset from the ancestor RenderNode that also
has a stretch configured on it
--Added new test activity to verify hole punch
logic
Bug: 179047472
Test: manual
Change-Id: Ibbaf8248a31839ba9dc352ecb9fef54e1276918e
diff --git a/libs/hwui/RenderNode.cpp b/libs/hwui/RenderNode.cpp
index e9eae3d..fce2e1f 100644
--- a/libs/hwui/RenderNode.cpp
+++ b/libs/hwui/RenderNode.cpp
@@ -194,6 +194,9 @@
SkRect dirty;
info.damageAccumulator->peekAtDirty(&dirty);
info.layerUpdateQueue->enqueueLayerWithDamage(this, dirty);
+ if (!dirty.isEmpty()) {
+ mStretchMask.markDirty();
+ }
// There might be prefetched layers that need to be accounted for.
// That might be us, so tell CanvasContext that this layer is in the
@@ -302,6 +305,12 @@
damageSelf(info);
info.damageAccumulator->popTransform();
syncProperties();
+
+ const StretchEffect& stagingStretch =
+ mProperties.layerProperties().getStretchEffect();
+ if (stagingStretch.isEmpty()) {
+ mStretchMask.clear();
+ }
// We could try to be clever and only re-damage if the matrix changed.
// However, we don't need to worry about that. The cost of over-damaging
// here is only going to be a single additional map rect of this node