Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3043ca8a authored by Vishnu Nair's avatar Vishnu Nair
Browse files

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
parent ae4c86f0
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1214,7 +1214,7 @@ class ChildColorLayerTest : public ChildLayerTest {
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 @@ protected:
            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();