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

Commit b108a6d8 authored by Angel Aguayo's avatar Angel Aguayo
Browse files

Changed DisplayDevice.cpp to adhere to new getters in ProjectionSpace

Test: m -j
Bug: 15475032
Change-Id: I34e396a2a9e55bc3f2f59853204ed4e250185f19
parent e20dddb5
Loading
Loading
Loading
Loading
+10 −8
Original line number Diff line number Diff line
@@ -116,11 +116,11 @@ void DisplayDevice::disconnect() {
}

int DisplayDevice::getWidth() const {
    return mCompositionDisplay->getState().displaySpace.bounds.getWidth();
    return mCompositionDisplay->getState().displaySpace.getBounds().width;
}

int DisplayDevice::getHeight() const {
    return mCompositionDisplay->getState().displaySpace.bounds.getHeight();
    return mCompositionDisplay->getState().displaySpace.getBounds().height;
}

void DisplayDevice::setDisplayName(const std::string& displayName) {
@@ -262,13 +262,15 @@ void DisplayDevice::setProjection(ui::Rotation orientation, Rect layerStackSpace
    if (!orientedDisplaySpaceRect.isValid()) {
        // The destination frame can be invalid if it has never been set,
        // in that case we assume the whole display size.
        orientedDisplaySpaceRect = getCompositionDisplay()->getState().displaySpace.bounds;
        orientedDisplaySpaceRect =
                getCompositionDisplay()->getState().displaySpace.getBoundsAsRect();
    }

    if (layerStackSpaceRect.isEmpty()) {
        // The layerStackSpaceRect can be invalid if it has never been set, in that case
        // we assume the whole framebuffer size.
        layerStackSpaceRect = getCompositionDisplay()->getState().framebufferSpace.bounds;
        layerStackSpaceRect =
                getCompositionDisplay()->getState().framebufferSpace.getBoundsAsRect();
        if (orientation == ui::ROTATION_90 || orientation == ui::ROTATION_270) {
            std::swap(layerStackSpaceRect.right, layerStackSpaceRect.bottom);
        }
@@ -336,8 +338,8 @@ bool DisplayDevice::isSecure() const {
    return mCompositionDisplay->isSecure();
}

const Rect& DisplayDevice::getBounds() const {
    return mCompositionDisplay->getState().displaySpace.bounds;
const Rect DisplayDevice::getBounds() const {
    return mCompositionDisplay->getState().displaySpace.getBoundsAsRect();
}

const Region& DisplayDevice::getUndefinedRegion() const {
@@ -361,11 +363,11 @@ const ui::Transform& DisplayDevice::getTransform() const {
}

const Rect& DisplayDevice::getLayerStackSpaceRect() const {
    return mCompositionDisplay->getState().layerStackSpace.content;
    return mCompositionDisplay->getState().layerStackSpace.getContent();
}

const Rect& DisplayDevice::getOrientedDisplaySpaceRect() const {
    return mCompositionDisplay->getState().orientedDisplaySpace.content;
    return mCompositionDisplay->getState().orientedDisplaySpace.getContent();
}

bool DisplayDevice::hasWideColorGamut() const {
+2 −2
Original line number Diff line number Diff line
@@ -156,8 +156,8 @@ public:
    // Return true if intent is supported by the display.
    bool hasRenderIntent(ui::RenderIntent intent) const;

    const Rect& getBounds() const;
    const Rect& bounds() const { return getBounds(); }
    const Rect getBounds() const;
    const Rect bounds() const { return getBounds(); }

    void setDisplayName(const std::string& displayName);
    const std::string& getDisplayName() const { return mDisplayName; }