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

Commit 44080524 authored by Romain Guy's avatar Romain Guy Committed by Android (Google) Code Review
Browse files

Merge "Remove C++11 related warning"

parents f947930e dcfc836b
Loading
Loading
Loading
Loading
+13 −8
Original line number Diff line number Diff line
@@ -183,14 +183,7 @@ status_t OpenGLRenderer::prepareDirty(float left, float top, float right, float

    updateLayers();

    // If we know that we are going to redraw the entire framebuffer,
    // perform a discard to let the driver know we don't need to preserve
    // the back buffer for this frame.
    if (mCaches.extensions.hasDiscardFramebuffer() &&
            left <= 0.0f && top <= 0.0f && right >= mWidth && bottom >= mHeight) {
        const GLenum attachments[] = { getTargetFbo() == 0 ? GL_COLOR_EXT : GL_COLOR_ATTACHMENT0 };
        glDiscardFramebufferEXT(GL_FRAMEBUFFER, 1, attachments);
    }
    discardFramebuffer(left, top, right, bottom);

    syncState();

@@ -207,6 +200,18 @@ status_t OpenGLRenderer::prepareDirty(float left, float top, float right, float
    return clear(left, top, right, bottom, opaque);
}

void OpenGLRenderer::discardFramebuffer(float left, float top, float right, float bottom) {
    // If we know that we are going to redraw the entire framebuffer,
    // perform a discard to let the driver know we don't need to preserve
    // the back buffer for this frame.
    if (mCaches.extensions.hasDiscardFramebuffer() &&
            left <= 0.0f && top <= 0.0f && right >= mWidth && bottom >= mHeight) {
        const GLenum attachments[] = { getTargetFbo() == 0 ? (const GLenum) GL_COLOR_EXT :
                (const GLenum) GL_COLOR_ATTACHMENT0 };
        glDiscardFramebufferEXT(GL_FRAMEBUFFER, 1, attachments);
    }
}

status_t OpenGLRenderer::clear(float left, float top, float right, float bottom, bool opaque) {
    if (!opaque) {
        mCaches.enableScissor();
+7 −0
Original line number Diff line number Diff line
@@ -365,6 +365,13 @@ protected:
    }

private:
    /**
     * Discards the content of the framebuffer if supported by the driver.
     * This method should be called at the beginning of a frame to optimize
     * rendering on some tiler architectures.
     */
    void discardFramebuffer(float left, float top, float right, float bottom);

    /**
     * Ensures the state of the renderer is the same as the state of
     * the GL context.
+1 −1

File changed.

Contains only whitespace changes.