Remove SaveFlags from saveLayer(Alpha)
This has been hardcoded as ALL_SAVE_FLAGS for a couple releases now.
Since it's now permanent behavior, remove the last bit of plumbing
for SaveFlags on saveLayer
Test: builds & boots
Change-Id: Iec92f27199d0b4781c2293dcdcfd45a1562a1b4e
diff --git a/libs/hwui/tests/common/scenes/ListOfFadedTextAnimation.cpp b/libs/hwui/tests/common/scenes/ListOfFadedTextAnimation.cpp
index a9449b6..5eaf185 100644
--- a/libs/hwui/tests/common/scenes/ListOfFadedTextAnimation.cpp
+++ b/libs/hwui/tests/common/scenes/ListOfFadedTextAnimation.cpp
@@ -32,7 +32,7 @@
int itemHeight) override {
canvas.drawColor(Color::White, SkBlendMode::kSrcOver);
int length = dp(100);
- canvas.saveLayer(0, 0, length, itemHeight, nullptr, SaveFlags::HasAlphaLayer);
+ canvas.saveLayer(0, 0, length, itemHeight, nullptr);
Paint textPaint;
textPaint.getSkFont().setSize(dp(20));
textPaint.setAntiAlias(true);
diff --git a/libs/hwui/tests/common/scenes/SaveLayer2Animation.cpp b/libs/hwui/tests/common/scenes/SaveLayer2Animation.cpp
index 8630be8..252f539 100644
--- a/libs/hwui/tests/common/scenes/SaveLayer2Animation.cpp
+++ b/libs/hwui/tests/common/scenes/SaveLayer2Animation.cpp
@@ -47,8 +47,7 @@
// interleave drawText and drawRect with saveLayer ops
for (int i = 0; i < regions; i++, top += smallRectHeight) {
- canvas.saveLayer(bounds.fLeft, top, bounds.fRight, top + padding, &mBluePaint,
- SaveFlags::ClipToLayer | SaveFlags::MatrixClip);
+ canvas.saveLayer(bounds.fLeft, top, bounds.fRight, top + padding, &mBluePaint);
canvas.drawColor(SkColorSetARGB(255, 255, 255, 0), SkBlendMode::kSrcOver);
std::string stri = std::to_string(i);
std::string offscreen = "offscreen line " + stri;
diff --git a/libs/hwui/tests/common/scenes/SaveLayerAnimation.cpp b/libs/hwui/tests/common/scenes/SaveLayerAnimation.cpp
index 97bfba3..10ba079 100644
--- a/libs/hwui/tests/common/scenes/SaveLayerAnimation.cpp
+++ b/libs/hwui/tests/common/scenes/SaveLayerAnimation.cpp
@@ -33,10 +33,10 @@
card = TestUtils::createNode(0, 0, 400, 800, [](RenderProperties& props, Canvas& canvas) {
// nested clipped saveLayers
- canvas.saveLayerAlpha(0, 0, 400, 400, 200, SaveFlags::ClipToLayer);
+ canvas.saveLayerAlpha(0, 0, 400, 400, 200);
canvas.drawColor(Color::Green_700, SkBlendMode::kSrcOver);
canvas.clipRect(50, 50, 350, 350, SkClipOp::kIntersect);
- canvas.saveLayerAlpha(100, 100, 300, 300, 128, SaveFlags::ClipToLayer);
+ canvas.saveLayerAlpha(100, 100, 300, 300, 128);
canvas.drawColor(Color::Blue_500, SkBlendMode::kSrcOver);
canvas.restore();
canvas.restore();
@@ -44,12 +44,14 @@
// single unclipped saveLayer
canvas.save(SaveFlags::MatrixClip);
canvas.translate(0, 400);
- canvas.saveLayerAlpha(100, 100, 300, 300, 128, SaveFlags::Flags(0)); // unclipped
+ int unclippedSaveLayer = canvas.saveUnclippedLayer(100, 100, 300, 300);
Paint paint;
paint.setAntiAlias(true);
paint.setColor(Color::Green_700);
canvas.drawCircle(200, 200, 200, paint);
- canvas.restore();
+ SkPaint alphaPaint;
+ alphaPaint.setAlpha(128);
+ canvas.restoreUnclippedLayer(unclippedSaveLayer, alphaPaint);
canvas.restore();
});
diff --git a/libs/hwui/tests/unit/RenderNodeDrawableTests.cpp b/libs/hwui/tests/unit/RenderNodeDrawableTests.cpp
index 7aa6be8..abdf9d5 100644
--- a/libs/hwui/tests/unit/RenderNodeDrawableTests.cpp
+++ b/libs/hwui/tests/unit/RenderNodeDrawableTests.cpp
@@ -198,7 +198,7 @@
EXPECT_TRUE(getRecorderMatrix(recorder).isIdentity());
// note we don't pass SaveFlags::MatrixClip, but matrix and clip will be saved
- recorder.saveLayer(0, 0, 400, 400, &layerPaint, SaveFlags::ClipToLayer);
+ recorder.saveLayer(0, 0, 400, 400, &layerPaint);
ASSERT_EQ(SkRect::MakeLTRB(0, 0, 400, 400), getRecorderClipBounds(recorder));
EXPECT_TRUE(getRecorderMatrix(recorder).isIdentity());