Clip projected ripples to outlines
bug:27343928
Also fixes positioning of ripples to a scrolled projection receiver.
Change-Id: I74b7233c46d7c15839ca8bf50e188ba6646d7432
diff --git a/libs/hwui/BakedOpDispatcher.cpp b/libs/hwui/BakedOpDispatcher.cpp
index 78764b5..bce583c 100644
--- a/libs/hwui/BakedOpDispatcher.cpp
+++ b/libs/hwui/BakedOpDispatcher.cpp
@@ -30,6 +30,7 @@
#include <algorithm>
#include <math.h>
#include <SkPaintDefaults.h>
+#include <SkPathOps.h>
namespace android {
namespace uirenderer {
@@ -527,6 +528,12 @@
SkPath path;
SkRect rect = getBoundsOfFill(op);
path.addOval(rect);
+
+ if (state.computedState.localProjectionPathMask != nullptr) {
+ // Mask the ripple path by the local space projection mask in local space.
+ // Note that this can create CCW paths.
+ Op(path, *state.computedState.localProjectionPathMask, kIntersect_SkPathOp, &path);
+ }
renderConvexPath(renderer, state, path, *(op.paint));
}
}