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

Commit f4c9d93a authored by Marin Shalamanov's avatar Marin Shalamanov
Browse files

Rename viewport and frame

Bug: 161793589
Bug: 160404780
Test: m && flash device
Change-Id: I62e55c9e62b77c83f4290277afed5790e17a8fe1
parent 5ce77ca4
Loading
Loading
Loading
Loading
+9 −11
Original line number Diff line number Diff line
@@ -273,14 +273,11 @@ static status_t setDisplayProjection(
        SurfaceComposerClient::Transaction& t,
        const sp<IBinder>& dpy,
        const ui::DisplayState& displayState) {
    const ui::Size& viewport = displayState.viewport;

    // Set the region of the layer stack we're interested in, which in our
    // case is "all of it".
    Rect layerStackRect(viewport);
    // Set the region of the layer stack we're interested in, which in our case is "all of it".
    Rect layerStackRect(displayState.layerStackSpaceRect);

    // We need to preserve the aspect ratio of the display.
    float displayAspect = viewport.getHeight() / static_cast<float>(viewport.getWidth());
    float displayAspect = layerStackRect.getHeight() / static_cast<float>(layerStackRect.getWidth());


    // Set the way we map the output onto the display surface (which will
@@ -699,20 +696,21 @@ static status_t recordScreen(const char* fileName) {
        return err;
    }

    const ui::Size& viewport = displayState.viewport;
    const ui::Size& layerStackSpaceRect = displayState.layerStackSpaceRect;
    if (gVerbose) {
        printf("Display is %dx%d @%.2ffps (orientation=%s), layerStack=%u\n",
                viewport.getWidth(), viewport.getHeight(), displayConfig.refreshRate,
                toCString(displayState.orientation), displayState.layerStack);
                layerStackSpaceRect.getWidth(), layerStackSpaceRect.getHeight(),
                displayConfig.refreshRate, toCString(displayState.orientation),
                displayState.layerStack);
        fflush(stdout);
    }

    // Encoder can't take odd number as config
    if (gVideoWidth == 0) {
        gVideoWidth = floorToEven(viewport.getWidth());
        gVideoWidth = floorToEven(layerStackSpaceRect.getWidth());
    }
    if (gVideoHeight == 0) {
        gVideoHeight = floorToEven(viewport.getHeight());
        gVideoHeight = floorToEven(layerStackSpaceRect.getHeight());
    }

    // Configure and start the encoder.