Skip to content
Permalink
Browse files
8266040: Lanai: Incorrect calculations of clipping boundaries
Reviewed-by: jdv
  • Loading branch information
Alexey Ushakov authored and jayathirthrao committed Apr 30, 2021
1 parent eb8db12 commit 87de5b750d2289512f002ecd307117734781f862
@@ -156,7 +156,8 @@ - (void)beginShapeClip:(BMTLSDOps *)dstOps context:(MTLContext *)mtlc {
}

_clipShapeSize = MTLSizeMake(0, 0, 1);
_clipShapeOrigin = MTLOriginMake(0, 0, 0);
// Use out of bounds origin to correctly calculate shape boundaries
_clipShapeOrigin = MTLOriginMake((NSUInteger) dstOps->width, (NSUInteger) dstOps->height, 0);

MTLRenderPassDescriptor* clearPassDescriptor = [MTLRenderPassDescriptor renderPassDescriptor];
// set color buffer properties
@@ -470,8 +470,8 @@ void MTLRenderer_FillSpans(MTLContext *mtlc, BMTLSDOps * dstOps, jint spanCount,

jfloat shapeX1 = mtlc.clip.shapeX;
jfloat shapeY1 = mtlc.clip.shapeY;
jfloat shapeX2 = shapeX1 + mtlc.clip.shapeWidth;
jfloat shapeY2 = shapeY1 + mtlc.clip.shapeHeight;
jfloat shapeX2 = (mtlc.clip.shapeWidth > 0)? shapeX1 + mtlc.clip.shapeWidth : 0;
jfloat shapeY2 = (mtlc.clip.shapeHeight > 0)? shapeY1 + mtlc.clip.shapeHeight : 0;

int counter = 0;
for (int i = 0; i < spanCount; i++) {

0 comments on commit 87de5b7

Please sign in to comment.