From c9691d57787e43ad26ac6edb3880d25365c4a43e Mon Sep 17 00:00:00 2001 From: Lucas Dupin Date: Thu, 26 Sep 2019 13:46:04 -0700 Subject: Fix rounded corner scission clipping In cases where the corner radius is too big, the middle section that's rendered without blending might have negative size, causing drawing artifacts. Test: manual, by slowing down app launch animation Fixes: 141612402 Change-Id: I901e6b77791207360d06dea30496b7cbb65041c4 --- libs/renderengine/gl/GLESRenderEngine.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'libs') diff --git a/libs/renderengine/gl/GLESRenderEngine.cpp b/libs/renderengine/gl/GLESRenderEngine.cpp index dd4c55d8a7..f39f0663ac 100644 --- a/libs/renderengine/gl/GLESRenderEngine.cpp +++ b/libs/renderengine/gl/GLESRenderEngine.cpp @@ -827,11 +827,14 @@ void GLESRenderEngine::handleRoundedCorners(const DisplaySettings& display, drawMesh(mesh); // The middle part of the layer can turn off blending. - const Rect middleRect(bounds.left, bounds.top + radius, bounds.right, bounds.bottom - radius); - setScissor(middleRect); - mState.cornerRadius = 0.0; - disableBlending(); - drawMesh(mesh); + if (topRect.bottom < bottomRect.top) { + const Rect middleRect(bounds.left, bounds.top + radius, bounds.right, + bounds.bottom - radius); + setScissor(middleRect); + mState.cornerRadius = 0.0; + disableBlending(); + drawMesh(mesh); + } disableScissor(); } -- cgit v1.2.3-59-g8ed1b