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

Commit 379d2f35 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "HWC2: Clear transform for SolidColor layers" into nyc-mr1-dev

parents 02b7e00c c6c8954b
Loading
Loading
Loading
Loading
+11 −0
Original line number Original line Diff line number Diff line
@@ -732,11 +732,22 @@ void Layer::setPerFrameData(const sp<const DisplayDevice>& displayDevice) {
    // SolidColor layers
    // SolidColor layers
    if (mActiveBuffer == nullptr) {
    if (mActiveBuffer == nullptr) {
        setCompositionType(hwcId, HWC2::Composition::SolidColor);
        setCompositionType(hwcId, HWC2::Composition::SolidColor);

        // For now, we only support black for DimLayer
        error = hwcLayer->setColor({0, 0, 0, 255});
        error = hwcLayer->setColor({0, 0, 0, 255});
        if (error != HWC2::Error::None) {
        if (error != HWC2::Error::None) {
            ALOGE("[%s] Failed to set color: %s (%d)", mName.string(),
            ALOGE("[%s] Failed to set color: %s (%d)", mName.string(),
                    to_string(error).c_str(), static_cast<int32_t>(error));
                    to_string(error).c_str(), static_cast<int32_t>(error));
        }
        }

        // Clear out the transform, because it doesn't make sense absent a
        // source buffer
        error = hwcLayer->setTransform(HWC2::Transform::None);
        if (error != HWC2::Error::None) {
            ALOGE("[%s] Failed to clear transform: %s (%d)", mName.string(),
                    to_string(error).c_str(), static_cast<int32_t>(error));
        }

        return;
        return;
    }
    }