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

Commit 2654a36a authored by Jesse Hall's avatar Jesse Hall Committed by Android (Google) Code Review
Browse files

Merge "Handle empty HWC layer list when composing"

parents 180eaad1 a6b32db1
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -1151,11 +1151,11 @@ void SurfaceFlinger::composeSurfaces(const DisplayHardware& hw, const Region& di
        const Vector< sp<LayerBase> >& layers(hw.getVisibleLayersSortedByZ());
        const size_t count = layers.size();
        const Transform& tr = hw.getTransform();
        for (size_t i=0 ; cur!=end && i<count ; ++i, ++cur) {
        for (size_t i=0 ; i<count ; ++i) {
            const sp<LayerBase>& layer(layers[i]);
            const Region clip(dirty.intersect(tr.transform(layer->visibleRegion)));
            if (!clip.isEmpty()) {
                if (cur->getCompositionType() == HWC_OVERLAY) {
                if (cur != end && cur->getCompositionType() == HWC_OVERLAY) {
                    if (i && (cur->getHints() & HWC_HINT_CLEAR_FB)
                            && layer->isOpaque()) {
                        // never clear the very first layer since we're
@@ -1167,6 +1167,9 @@ void SurfaceFlinger::composeSurfaces(const DisplayHardware& hw, const Region& di
                // render the layer
                layer->draw(hw, clip);
            }
            if (cur != end) {
                ++cur;
            }
        }
    }
}