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

Commit ceb67d1f authored by Chris Forbes's avatar Chris Forbes
Browse files

hwc2: Remove Display::{mIsVirtual,setVirtual}

Trivial cleanup.

Now that mType is available, we don't need a separate flag for whether
the display is virtual. The remaining effect of setVirtual was to set
the display connected, so just use setConnected.

Bug: b/36597125
Test: build
Change-Id: Ia1fa4a324cc07b0d6c124f4f50966c8b0cbe4827
parent 016d73c2
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -244,7 +244,7 @@ Error Device::createVirtualDisplay(uint32_t width, uint32_t height,
        ALOGE("Failed to get display by id");
        return Error::BadDisplay;
    }
    (*outDisplay)->setVirtual();
    (*outDisplay)->setConnected(true);
    return Error::None;
}

@@ -531,7 +531,6 @@ Display::Display(Device& device, hwc2_display_t id)
  : mDevice(device),
    mId(id),
    mIsConnected(false),
    mIsVirtual(false),
    mType(DisplayType::Invalid)
{
    ALOGV("Created display %" PRIu64, id);
@@ -553,7 +552,7 @@ Display::Display(Device& device, hwc2_display_t id)
Display::~Display()
{
    ALOGV("Destroyed display %" PRIu64, mId);
    if (mIsVirtual) {
    if (mType == DisplayType::Virtual) {
        mDevice.destroyVirtualDisplay(mId);
    }
}
+0 −7
Original line number Diff line number Diff line
@@ -352,12 +352,6 @@ public:
private:
    // For use by Device

    // Virtual displays are always connected
    void setVirtual() {
        mIsVirtual = true;
        mIsConnected = true;
    }

    void setConnected(bool connected) { mIsConnected = connected; }
    int32_t getAttribute(hwc2_config_t configId, Attribute attribute);
    void loadConfig(hwc2_config_t configId);
@@ -375,7 +369,6 @@ private:
    Device& mDevice;
    hwc2_display_t mId;
    bool mIsConnected;
    bool mIsVirtual;
    DisplayType mType;
    std::unordered_map<hwc2_layer_t, std::weak_ptr<Layer>> mLayers;
    std::unordered_map<hwc2_config_t, std::shared_ptr<const Config>> mConfigs;