summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
author Lucas Dupin <dupin@google.com> 2019-09-26 13:46:04 -0700
committer Lucas Dupin <dupin@google.com> 2019-09-26 13:50:36 -0700
commitc9691d57787e43ad26ac6edb3880d25365c4a43e (patch)
treec5a9d0063912583e325e49062f5d819ef8ac2a14 /libs
parentb1fef3f70dde5e6310dca8333c4defe1723ac701 (diff)
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
Diffstat (limited to 'libs')
-rw-r--r--libs/renderengine/gl/GLESRenderEngine.cpp13
1 files changed, 8 insertions, 5 deletions
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();
}