Skip to content
This repository has been archived by the owner on Aug 27, 2022. It is now read-only.

Commit

Permalink
8244402: Lanai - Motif L&F - Non selected Radio button is barely rend…
Browse files Browse the repository at this point in the history
…ered on non-retina display

Reviewed-by: aghaisas
  • Loading branch information
dekonoplyov authored and aghaisas committed Jul 31, 2020
1 parent 7954d97 commit b01b4ed
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
Expand Up @@ -420,8 +420,7 @@ void MTLRenderQueue_CheckPreviousOp(jint op) {
jint x = NEXT_INT(b); jint x = NEXT_INT(b);
jint y = NEXT_INT(b); jint y = NEXT_INT(b);
CONTINUE_IF_NULL(mtlc); CONTINUE_IF_NULL(mtlc);
//TODO MTLRenderer_DrawPixel(mtlc, dstOps, x, y);
J2dTraceLn(J2D_TRACE_ERROR, "MTLRenderQueue_DRAW_PIXEL -- :TODO");
} }
break; break;
case sun_java2d_pipe_BufferedOpCodes_DRAW_SCANLINES: case sun_java2d_pipe_BufferedOpCodes_DRAW_SCANLINES:
Expand Down
Expand Up @@ -40,6 +40,8 @@


void MTLRenderer_DrawLine(MTLContext *mtlc, BMTLSDOps * dstOps, void MTLRenderer_DrawLine(MTLContext *mtlc, BMTLSDOps * dstOps,
jint x1, jint y1, jint x2, jint y2); jint x1, jint y1, jint x2, jint y2);
void MTLRenderer_DrawPixel(MTLContext *mtlc, BMTLSDOps * dstOps,
jint x, jint y);
void MTLRenderer_DrawRect(MTLContext *mtlc, BMTLSDOps * dstOps, void MTLRenderer_DrawRect(MTLContext *mtlc, BMTLSDOps * dstOps,
jint x, jint y, jint w, jint h); jint x, jint y, jint w, jint h);
void MTLRenderer_DrawPoly(MTLContext *mtlc, BMTLSDOps * dstOps, void MTLRenderer_DrawPoly(MTLContext *mtlc, BMTLSDOps * dstOps,
Expand Down
Expand Up @@ -85,6 +85,28 @@ void MTLRenderer_DrawLine(MTLContext *mtlc, BMTLSDOps * dstOps, jint x1, jint y1
[mtlEncoder drawPrimitives:MTLPrimitiveTypeLine vertexStart:0 vertexCount:2]; [mtlEncoder drawPrimitives:MTLPrimitiveTypeLine vertexStart:0 vertexCount:2];
} }


void MTLRenderer_DrawPixel(MTLContext *mtlc, BMTLSDOps * dstOps, jint x, jint y) {
if (mtlc == NULL || dstOps == NULL || dstOps->pTexture == NULL) {
J2dTraceLn(J2D_TRACE_ERROR, "MTLRenderer_DrawPixel: dest is null");
return;
}

id<MTLTexture> dest = dstOps->pTexture;
J2dTraceLn3(J2D_TRACE_INFO, "MTLRenderer_DrawPixel (x=%d y=%d), dst tex=%p", x, y, dest);

id<MTLRenderCommandEncoder> mtlEncoder = [mtlc.encoderManager getRenderEncoder:dstOps];
if (mtlEncoder == nil)
return;

// Translate each vertex by a fraction so
// that we hit pixel centers.
float fx = (float)x + 0.2f;
float fy = (float)y + 0.5f;
struct Vertex vert = {{fx, fy}};
[mtlEncoder setVertexBytes:&vert length:sizeof(vert) atIndex:MeshVertexBuffer];
[mtlEncoder drawPrimitives:MTLPrimitiveTypePoint vertexStart:0 vertexCount:1];
}

void MTLRenderer_DrawRect(MTLContext *mtlc, BMTLSDOps * dstOps, jint x, jint y, jint w, jint h) { void MTLRenderer_DrawRect(MTLContext *mtlc, BMTLSDOps * dstOps, jint x, jint y, jint w, jint h) {
if (mtlc == NULL || dstOps == NULL || dstOps->pTexture == NULL) { if (mtlc == NULL || dstOps == NULL || dstOps->pTexture == NULL) {
J2dTraceLn(J2D_TRACE_ERROR, "MTLRenderer_DrawRect: dest is null"); J2dTraceLn(J2D_TRACE_ERROR, "MTLRenderer_DrawRect: dest is null");
Expand Down

0 comments on commit b01b4ed

Please sign in to comment.