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

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

Merge "Don't perform glCopyTextImage with coordinates outside the buffer."

parents d15949e6 ae517591
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -355,8 +355,16 @@ bool OpenGLRenderer::createLayer(sp<Snapshot> snapshot, float left, float top,
    Rect bounds(left, top, right, bottom);
    if (!fboLayer) {
        mSnapshot->transform->mapRect(bounds);

        // Layers only make sense if they are in the framebuffer's bounds
        bounds.intersect(*mSnapshot->clipRect);

        // When the layer is not an FBO, we may use glCopyTexImage so we
        // need to make sure the layer does not extend outside the bounds
        // of the framebuffer
        bounds.intersect(snapshot->previous->viewport);

        // We cannot work with sub-pixels in this case
        bounds.snapToPixelBoundaries();
    }