SF: Set crop for color layer in ChildColorLayerTest
When creating a color or container layer, the call will fail if a buffer size is set. Layers
without buffers should set a crop instead.
Test: mmma frameworks/native/services/surfaceflinger/tests/ && \
adb sync data && \
adb shell /data/nativetest64/sffakehwc_test/sffakehwc_test
Change-Id: I76cd85b43614cd0ef1113d127840f751a11cbb12
diff --git a/services/surfaceflinger/tests/fakehwc/SFFakeHwc_test.cpp b/services/surfaceflinger/tests/fakehwc/SFFakeHwc_test.cpp
index 356a880..16e0891 100644
--- a/services/surfaceflinger/tests/fakehwc/SFFakeHwc_test.cpp
+++ b/services/surfaceflinger/tests/fakehwc/SFFakeHwc_test.cpp
@@ -1214,7 +1214,7 @@
protected:
void SetUp() override {
TransactionTest::SetUp();
- mChild = mComposerClient->createSurface(String8("Child surface"), 10, 10,
+ mChild = mComposerClient->createSurface(String8("Child surface"), 0, 0,
PIXEL_FORMAT_RGBA_8888,
ISurfaceComposerClient::eFXSurfaceColor,
mFGSurfaceControl.get());
@@ -1222,6 +1222,7 @@
TransactionScope ts(*sFakeComposer);
ts.setColor(mChild,
{LIGHT_GRAY.r / 255.0f, LIGHT_GRAY.g / 255.0f, LIGHT_GRAY.b / 255.0f});
+ ts.setCrop_legacy(mChild, Rect(0, 0, 10, 10));
}
sFakeComposer->runVSyncAndWait();