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

Commit f1243187 authored by Dan Stoza's avatar Dan Stoza Committed by android-build-merger
Browse files

HWC2: Use SolidColor composition for DimLayer am: 0183f7ac

am: b4365b8d

Change-Id: I89241809c69af21aa62a5af7562d8f3e6bb8dbd7
parents 860ff9c8 b4365b8d
Loading
Loading
Loading
Loading
+14 −5
Original line number Diff line number Diff line
@@ -716,16 +716,25 @@ void Layer::setPerFrameData(const sp<const DisplayDevice>& displayDevice) {
        return;
    }

    // Client or SolidColor layers
    if (mActiveBuffer == nullptr || mActiveBuffer->handle == nullptr ||
            mHwcLayers[hwcId].forceClientComposition) {
        // TODO: This also includes solid color layers, but no API exists to
        // setup a solid color layer yet
    // Client layers
    if (mHwcLayers[hwcId].forceClientComposition ||
            (mActiveBuffer != nullptr && mActiveBuffer->handle == nullptr)) {
        ALOGV("[%s] Requesting Client composition", mName.string());
        setCompositionType(hwcId, HWC2::Composition::Client);
        return;
    }

    // SolidColor layers
    if (mActiveBuffer == nullptr) {
        setCompositionType(hwcId, HWC2::Composition::SolidColor);
        error = hwcLayer->setColor({0, 0, 0, 255});
        if (error != HWC2::Error::None) {
            ALOGE("[%s] Failed to set color: %s (%d)", mName.string(),
                    to_string(error).c_str(), static_cast<int32_t>(error));
        }
        return;
    }

    // Device or Cursor layers
    if (mPotentialCursor) {
        ALOGV("[%s] Requesting Cursor composition", mName.string());