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/DamageAccumulator.h b/libs/hwui/DamageAccumulator.h
index 89ee0e3..90a3517 100644
--- a/libs/hwui/DamageAccumulator.h
+++ b/libs/hwui/DamageAccumulator.h
@@ -21,6 +21,7 @@
#include <SkMatrix.h>
#include <SkRect.h>
+#include <effects/StretchEffect.h>
#include "utils/Macros.h"
@@ -35,7 +36,6 @@
struct DirtyStack;
class RenderNode;
class Matrix4;
-class StretchEffect;
class DamageAccumulator {
PREVENT_COPY_AND_ASSIGN(DamageAccumulator);
@@ -63,7 +63,29 @@
void finish(SkRect* totalDirty);
- const StretchEffect* findNearestStretchEffect() const;
+ struct StretchResult {
+ /**
+ * Stretch parameters configured on the stretch container
+ */
+ const StretchEffect* stretchEffect;
+
+ /**
+ * Bounds of the child relative to the stretch container
+ */
+ const SkRect childRelativeBounds;
+
+ /**
+ * Width of the stretch container
+ */
+ const float width;
+
+ /**
+ * Height of the stretch container
+ */
+ const float height;
+ };
+
+ [[nodiscard]] StretchResult findNearestStretchEffect() const;
private:
void pushCommon();