Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
8251167: Drawing polyline twice in XOR mode leaves out some traces on…
… screen (only with uiScale=1.0)
- Loading branch information
|
@@ -414,19 +414,33 @@ void MTLRenderQueue_CheckPreviousOp(jint op) { |
|
|
case sun_java2d_pipe_BufferedOpCodes_DRAW_POLY: |
|
|
{ |
|
|
CHECK_PREVIOUS_OP(MTL_OP_OTHER); |
|
|
|
|
|
if ([mtlc useXORComposite]) { |
|
|
commitEncodedCommands(); |
|
|
J2dTraceLn(J2D_TRACE_VERBOSE, "DRAW_POLY in XOR mode - Force commit earlier draw calls before DRAW_POLY."); |
|
|
} |
|
|
|
|
|
jint nPoints = NEXT_INT(b); |
|
|
jboolean isClosed = NEXT_BOOLEAN(b); |
|
|
jint transX = NEXT_INT(b); |
|
|
jint transY = NEXT_INT(b); |
|
|
jint *xPoints = (jint *)b; |
|
|
jint *yPoints = ((jint *)b) + nPoints; |
|
|
MTLRenderer_DrawPoly(mtlc, dstOps, nPoints, isClosed, transX, transY, xPoints, yPoints); |
|
|
|
|
|
if ([mtlc useXORComposite]) { |
|
|
commitEncodedCommands(); |
|
|
J2dTraceLn(J2D_TRACE_VERBOSE, "DRAW_POLY in XOR mode - Force commit earlier draw calls before DRAW_POLY."); |
|
|
|
|
|
// draw separate (N-1) lines using N points |
|
|
for(int point = 0; point < nPoints-1; point++) { |
|
|
jint x1 = xPoints[point] + transX; |
|
|
jint y1 = yPoints[point] + transY; |
|
|
jint x2 = xPoints[point + 1] + transX; |
|
|
jint y2 = yPoints[point + 1] + transY; |
|
|
MTLRenderer_DrawLine(mtlc, dstOps, x1, y1, x2, y2); |
|
|
} |
|
|
|
|
|
if (isClosed) { |
|
|
MTLRenderer_DrawLine(mtlc, dstOps, xPoints[0] + transX, yPoints[0] + transY, xPoints[nPoints-1] + transX, yPoints[nPoints-1] + transY); |
|
|
} |
|
|
} else { |
|
|
MTLRenderer_DrawPoly(mtlc, dstOps, nPoints, isClosed, transX, transY, xPoints, yPoints); |
|
|
} |
|
|
|
|
|
SKIP_BYTES(b, nPoints * BYTES_PER_POLY_POINT); |
|
|
} |
|
|
break; |
|
|