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

Commit d6f1fc25 authored by Huihong Luo's avatar Huihong Luo
Browse files

Add layerStack field to DisplayInfo

screenrecord utility requires display layer stack in order to record
external displays.

Bug: 140814450
Bug: 136165419
Test: screenrecord --display-id <physical-display-id>
Change-Id: I1ec562e4df2db684eb9f216bd4439bb267a7d3e3
parent 85102a58
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -24,6 +24,8 @@

namespace android {

constexpr uint32_t NO_LAYER_STACK = static_cast<uint32_t>(-1);

struct DisplayInfo {
    uint32_t w{0};
    uint32_t h{0};
@@ -37,6 +39,7 @@ struct DisplayInfo {
    nsecs_t presentationDeadline{0};
    uint32_t viewportW{0};
    uint32_t viewportH{0};
    uint32_t layerStack{NO_LAYER_STACK};
};

/* Display orientations as defined in Surface.java and ISurfaceComposer.h. */
@@ -47,6 +50,6 @@ enum {
    DISPLAY_ORIENTATION_270 = 3
};

}; // namespace android
} // namespace android

#endif // ANDROID_COMPOSER_DISPLAY_INFO_H
+2 −5
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@
#include <math/mat4.h>
#include <renderengine/RenderEngine.h>
#include <system/window.h>
#include <ui/DisplayInfo.h>
#include <ui/GraphicTypes.h>
#include <ui/HdrCapabilities.h>
#include <ui/Region.h>
@@ -65,10 +66,6 @@ public:
    constexpr static float sDefaultMinLumiance = 0.0;
    constexpr static float sDefaultMaxLumiance = 500.0;

    enum {
        NO_LAYER_STACK = 0xFFFFFFFF,
    };

    explicit DisplayDevice(DisplayDeviceCreationArgs&& args);
    virtual ~DisplayDevice();

@@ -201,7 +198,7 @@ struct DisplayDeviceState {
    int32_t sequenceId = sNextSequenceId++;
    std::optional<DisplayId> displayId;
    sp<IGraphicBufferProducer> surface;
    uint32_t layerStack = DisplayDevice::NO_LAYER_STACK;
    uint32_t layerStack = NO_LAYER_STACK;
    Rect viewport;
    Rect frame;
    uint8_t orientation = 0;
+4 −0
Original line number Diff line number Diff line
@@ -874,11 +874,15 @@ status_t SurfaceFlinger::getDisplayConfigs(const sp<IBinder>& displayToken,
                info.viewportW = uint32_t(viewport.getWidth());
                info.viewportH = uint32_t(viewport.getHeight());
            }
            info.layerStack = display->getLayerStack();
        } else {
            // TODO: where should this value come from?
            static const int TV_DENSITY = 213;
            info.density = TV_DENSITY / 160.0f;
            info.orientation = 0;

            const auto display = getDisplayDeviceLocked(displayToken);
            info.layerStack = display->getLayerStack();
        }

        info.xdpi = xdpi;