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

Commit 1560941b authored by Peiyong Lin's avatar Peiyong Lin Committed by android-build-merger
Browse files

Merge "[SurfaceFlinger] Checking nullptr for HWC layer."

am: 7038766b

Change-Id: I91c890583b6a1d40d7df8cb7f00911ee67012ab2
parents c695938a 7038766b
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -622,6 +622,9 @@ void BufferLayer::setPerFrameData(const sp<const DisplayDevice>& displayDevice)
    const auto& viewport = displayDevice->getViewport();
    Region visible = tr.transform(visibleRegion.intersect(viewport));
    auto hwcId = displayDevice->getHwcDisplayId();
    if (!hasHwcLayer(hwcId)) {
        return;
    }
    auto& hwcInfo = getBE().mHwcLayers[hwcId];
    auto& hwcLayer = hwcInfo.layer;
    auto error = hwcLayer->setVisibleRegion(visible);
+3 −0
Original line number Diff line number Diff line
@@ -66,6 +66,9 @@ void ColorLayer::setPerFrameData(const sp<const DisplayDevice>& displayDevice) {
    const auto& viewport = displayDevice->getViewport();
    Region visible = tr.transform(visibleRegion.intersect(viewport));
    auto hwcId = displayDevice->getHwcDisplayId();
    if (!hasHwcLayer(hwcId)) {
        return;
    }
    auto& hwcInfo = getBE().mHwcLayers[hwcId];
    auto& hwcLayer = hwcInfo.layer;
    auto error = hwcLayer->setVisibleRegion(visible);
+6 −0
Original line number Diff line number Diff line
@@ -500,6 +500,9 @@ FloatRect Layer::computeCrop(const sp<const DisplayDevice>& hw) const {
void Layer::setGeometry(const sp<const DisplayDevice>& displayDevice, uint32_t z)
{
    const auto hwcId = displayDevice->getHwcDisplayId();
    if (!hasHwcLayer(hwcId)) {
        return;
    }
    auto& hwcInfo = getBE().mHwcLayers[hwcId];

    // enable this layer
@@ -2009,6 +2012,9 @@ void Layer::writeToProto(LayerProto* layerInfo, LayerVector::StateSet stateSet)
}

void Layer::writeToProto(LayerProto* layerInfo, int32_t hwcId) {
    if (!hasHwcLayer(hwcId)) {
        return;
    }
    writeToProto(layerInfo, LayerVector::StateSet::Drawing);

    const auto& hwcInfo = getBE().mHwcLayers.at(hwcId);