Ensure root render node clip cannot expand beyond dirty area
Use new Skia API to enfore clip restriction for root render node.
This brings Skia pipeline in line with HWUI. Unit test is
updated to reflect the new behaviour.
Test: Built and ran angler-eng, ran HWUI unit tests.
Change-Id: Iffce70fd37b6aff45eb6a23c8b1a64f45b5f1463
diff --git a/libs/hwui/tests/unit/SkiaPipelineTests.cpp b/libs/hwui/tests/unit/SkiaPipelineTests.cpp
index 722faf6..f3a663e 100644
--- a/libs/hwui/tests/unit/SkiaPipelineTests.cpp
+++ b/libs/hwui/tests/unit/SkiaPipelineTests.cpp
@@ -324,11 +324,8 @@
}
void onDrawPaint(const SkPaint&) {
EXPECT_EQ(0, mDrawCounter++);
- //TODO: this unit test is failing on the commented check below, because of a missing
- //feature. In Snapshot::applyClip HWUI is intersecting the clip with the clip root,
- //even for kReplace_Op clips. We need to implement the same for Skia pipelines.
- //EXPECT_EQ(SkRect::MakeLTRB(20, 10, 30, 40), TestUtils::getClipBounds(this)) //got instead 20 0 30 50
- // << "Expect resolved clip to be intersection of viewport clip and clip op";
+ EXPECT_EQ(SkRect::MakeLTRB(20, 10, 30, 40), TestUtils::getClipBounds(this))
+ << "Expect resolved clip to be intersection of viewport clip and clip op";
}
int mDrawCounter = 0;
};