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

Commit 45491690 authored by Mathias Agopian's avatar Mathias Agopian
Browse files

fix [3369743] SurfaceFlinger reads hardware composer hints before calling hwc.prepare()

Change-Id: If3277c7b9d4cb8ef20d1706155fac7b87e64fb20
parent 7a97ad42
Loading
Loading
Loading
Loading
+26 −20
Original line number Original line Diff line number Diff line
@@ -872,15 +872,19 @@ void SurfaceFlinger::composeSurfaces(const Region& dirty)
        for (size_t i=0 ; i<count ; i++) {
        for (size_t i=0 ; i<count ; i++) {
            const sp<LayerBase>& layer(layers[i]);
            const sp<LayerBase>& layer(layers[i]);
            layer->setPerFrameData(&cur[i]);
            layer->setPerFrameData(&cur[i]);
        }
        err = hwc.prepare();
        LOGE_IF(err, "HWComposer::prepare failed (%s)", strerror(-err));

        if (err == NO_ERROR) {
            for (size_t i=0 ; i<count ; i++) {
                if (cur[i].hints & HWC_HINT_CLEAR_FB) {
                if (cur[i].hints & HWC_HINT_CLEAR_FB) {
                    const sp<LayerBase>& layer(layers[i]);
                    if (!(layer->needsBlending())) {
                    if (!(layer->needsBlending())) {
                        transparent.orSelf(layer->visibleRegionScreen);
                        transparent.orSelf(layer->visibleRegionScreen);
                    }
                    }
                }
                }
            }
            }
        err = hwc.prepare();
        LOGE_IF(err, "HWComposer::prepare failed (%s)", strerror(-err));
    }


            /*
            /*
             *  clear the area of the FB that need to be transparent
             *  clear the area of the FB that need to be transparent
@@ -898,6 +902,8 @@ void SurfaceFlinger::composeSurfaces(const Region& dirty)
                    glClear(GL_COLOR_BUFFER_BIT);
                    glClear(GL_COLOR_BUFFER_BIT);
                }
                }
            }
            }
        }
    }




    /*
    /*