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

Commit 4b2ba534 authored by Mathias Agopian's avatar Mathias Agopian
Browse files

better workaround for bug: 6020860

this prevents the GPU from running when composition
is fully handled by overlays. this should improve
animations a bit.

Change-Id: If4ae584b7a3976e6bdd36e318686ac3940b6b075
parent 9e0b1f88
Loading
Loading
Loading
Loading
+17 −6
Original line number Diff line number Diff line
@@ -1013,18 +1013,29 @@ void SurfaceFlinger::composeSurfaces(const Region& dirty)
        drawWormhole();
    }

    // FIXME: workaroud for b/6020860
    glEnable(GL_SCISSOR_TEST);
    glScissor(0,0,0,0);
    glClear(GL_COLOR_BUFFER_BIT);
    // end-workaround

    /*
     * and then, render the layers targeted at the framebuffer
     */

    hwc_layer_t* const cur(hwc.getLayers());
    const Vector< sp<LayerBase> >& layers(mVisibleLayersSortedByZ);
    size_t count = layers.size();


    // FIXME: workaround for b/6020860
    if (hw.getFlags() & DisplayHardware::BUFFER_PRESERVED) {
        for (size_t i=0 ; i<count ; i++) {
            if (cur && (cur[i].compositionType == HWC_FRAMEBUFFER)) {
                glEnable(GL_SCISSOR_TEST);
                glScissor(0,0,0,0);
                glClear(GL_COLOR_BUFFER_BIT);
                break;
            }
        }
    }
    // FIXME: bug6020860 for b/6020860


    for (size_t i=0 ; i<count ; i++) {
        if (cur && (cur[i].compositionType != HWC_FRAMEBUFFER)) {
            continue;