Revert "Remove setFrame from BufferStateLayer"
Revert "Update tests to reflect the new behavior for setGeometry"
Revert submission 13843937-sc_remove_set_frame
Reason for revert: Candidate CL for b/184807094
Reverted Changes:
Iffbd955a3:Remove setFrame
I27f17bc61:Update tests to reflect the new behavior for setGe...
I5720276c1:Remove setFrame from surface_control setGeometry
I32ee0e3e4:Remove setFrame from BufferStateLayer
Bug: 184807094
Change-Id: I8330f374c50c76d8c2e70b79815bc2bc32b89480
diff --git a/services/surfaceflinger/tests/utils/TransactionUtils.h b/services/surfaceflinger/tests/utils/TransactionUtils.h
index 8c448e2..3cbfed9 100644
--- a/services/surfaceflinger/tests/utils/TransactionUtils.h
+++ b/services/surfaceflinger/tests/utils/TransactionUtils.h
@@ -126,7 +126,7 @@
const uint8_t* src = pixels + (outBuffer->getStride() * (y + j) + x) * 4;
for (int32_t i = 0; i < width; i++) {
const uint8_t expected[4] = {color.r, color.g, color.b, color.a};
- ASSERT_TRUE(std::equal(src, src + 4, expected, colorCompare))
+ EXPECT_TRUE(std::equal(src, src + 4, expected, colorCompare))
<< "pixel @ (" << x + i << ", " << y + j << "): "
<< "expected (" << color << "), "
<< "got (" << Color{src[0], src[1], src[2], src[3]} << ")";
@@ -161,22 +161,6 @@
ASSERT_EQ(NO_ERROR, s->unlockAndPost());
}
}
-
- static void setFrame(Transaction& t, const sp<SurfaceControl>& sc, Rect source, Rect dest,
- int32_t transform = 0) {
- uint32_t sourceWidth = source.getWidth();
- uint32_t sourceHeight = source.getHeight();
-
- if (transform & ui::Transform::ROT_90) {
- std::swap(sourceWidth, sourceHeight);
- }
-
- float dsdx = dest.getWidth() / static_cast<float>(sourceWidth);
- float dsdy = dest.getHeight() / static_cast<float>(sourceHeight);
-
- t.setMatrix(sc, dsdx, 0, 0, dsdy);
- t.setPosition(sc, dest.left, dest.top);
- }
};
enum class RenderPath { SCREENSHOT, VIRTUAL_DISPLAY };