Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
8244402: Lanai - Motif L&F - Non selected Radio button is barely rend…
…ered on non-retina display

Reviewed-by: aghaisas
  • Loading branch information
dekonoplyov authored and aghaisas committed Jul 31, 2020
1 parent 7954d97 commit b01b4ed2d9532058261e9a8fd717375e6b33de6c
@@ -420,8 +420,7 @@ void MTLRenderQueue_CheckPreviousOp(jint op) {
jint x = NEXT_INT(b);
jint y = NEXT_INT(b);
CONTINUE_IF_NULL(mtlc);
//TODO
J2dTraceLn(J2D_TRACE_ERROR, "MTLRenderQueue_DRAW_PIXEL -- :TODO");
MTLRenderer_DrawPixel(mtlc, dstOps, x, y);
}
break;
case sun_java2d_pipe_BufferedOpCodes_DRAW_SCANLINES:
@@ -40,6 +40,8 @@

void MTLRenderer_DrawLine(MTLContext *mtlc, BMTLSDOps * dstOps,
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,
jint x, jint y, jint w, jint h);
void MTLRenderer_DrawPoly(MTLContext *mtlc, BMTLSDOps * dstOps,
@@ -85,6 +85,28 @@ void MTLRenderer_DrawLine(MTLContext *mtlc, BMTLSDOps * dstOps, jint x1, jint y1
[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) {
if (mtlc == NULL || dstOps == NULL || dstOps->pTexture == NULL) {
J2dTraceLn(J2D_TRACE_ERROR, "MTLRenderer_DrawRect: dest is null");

0 comments on commit b01b4ed

Please sign in to comment.