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

Commit b4cfbb3c authored by Rama Vaddula's avatar Rama Vaddula Committed by Steve Kondik
Browse files

Remove opaque check in preparing dirty region

Since preserve swap is enabled, we need to clear the color buffer
when the scissor rect is prepared for a new process. This prevents
garbage being present from the previous process in the color buffer.

CRs-Fixed: 549755

Change-Id: Icd12ae388077b8c9ed329c37314e896500078543
(cherry picked from commit 48b6a9767317e08a24e189c9cbee21043543682a)
(cherry picked from commit 777610a5ddf19cebcad30b7e9a481e9dfe38b74c)
parent c5bb1bbd
Loading
Loading
Loading
Loading
+12 −1
Original line number Original line Diff line number Diff line
@@ -264,15 +264,26 @@ void OpenGLRenderer::discardFramebuffer(float left, float top, float right, floa
}
}


status_t OpenGLRenderer::clear(float left, float top, float right, float bottom, bool opaque) {
status_t OpenGLRenderer::clear(float left, float top, float right, float bottom, bool opaque) {
#ifdef QCOM_HARDWARE
    mCaches.enableScissor();
    mCaches.setScissor(left, mSnapshot->height - bottom, right - left, bottom - top);
    glClear(GL_COLOR_BUFFER_BIT);
    if (opaque && !mCountOverdraw) {
        mCaches.resetScissor();
        return DrawGlInfo::kStatusDone;
    }
    return DrawGlInfo::kStatusDrew;  
#else
    if (!opaque || mCountOverdraw) {
    if (!opaque || mCountOverdraw) {
        mCaches.enableScissor();
        mCaches.enableScissor();
        mCaches.setScissor(left, mSnapshot->height - bottom, right - left, bottom - top);
        mCaches.setScissor(left, mSnapshot->height - bottom, right - left, bottom - top);
        glClear(GL_COLOR_BUFFER_BIT);
        glClear(GL_COLOR_BUFFER_BIT);

        return DrawGlInfo::kStatusDrew;
        return DrawGlInfo::kStatusDrew;
    }
    }

    mCaches.resetScissor();
    mCaches.resetScissor();
    return DrawGlInfo::kStatusDone;
    return DrawGlInfo::kStatusDone;
#endif
}
}


void OpenGLRenderer::syncState() {
void OpenGLRenderer::syncState() {