Skip to content
This repository was archived by the owner on Aug 27, 2022. It is now read-only.
/ lanai Public archive

Commit 0e024b3

Browse files
committed
8243547: Lanai - Netbeans IDE has BLACK background for the Toolbar and Statusbar
8240164: Test java/awt/Window/TranslucentShapedFrameTest/TranslucentShapedFrameTest.java fails for metal 8240074: Test java/awt/Window/TranslucentJAppletTest/TranslucentJAppletTest.java fails for metal
1 parent 6173a38 commit 0e024b3

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

src/java.desktop/macosx/native/libawt_lwawt/awt/shaders.metal

+1-1
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,7 @@ fragment half4 frag_txt_xorMode(
539539
ret.r = half( (unsigned char)(c.r * 255.0) ^ (unsigned char)(bgColor.r * 255.0)) / 255.0f;
540540
ret.g = half( (unsigned char)(c.g * 255.0) ^ (unsigned char)(bgColor.g * 255.0)) / 255.0f;
541541
ret.b = half( (unsigned char)(c.b * 255.0) ^ (unsigned char)(bgColor.b * 255.0)) / 255.0f;
542-
ret.a = c.a;
542+
ret.a = c.a + (1.0 - c.a) * bgColor.a;
543543

544544
return ret;
545545
}

src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLBlitLoops.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -636,7 +636,7 @@ jboolean clipDestCoords(
636636
#ifdef TRACE_BLIT
637637
J2dTraceImpl(J2D_TRACE_VERBOSE, JNI_TRUE," [via pooled + blit]");
638638
#endif //TRACE_BLIT
639-
MTLBlitSwToTextureViaPooledTexture(mtlc, &srcInfo, dstOps, &rfi, true, hint, dx1, dy1, dx2, dy2);
639+
MTLBlitSwToTextureViaPooledTexture(mtlc, &srcInfo, dstOps, &rfi, false, hint, dx1, dy1, dx2, dy2);
640640
}
641641
} else { // !useReplaceRegion
642642
#ifdef TRACE_BLIT

src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLLayer.m

+1
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ - (id) initWithJavaLayer:(JNFWeakJObjectWrapper *)layer
6969
self.leftInset = 0;
7070
self.framebufferOnly = NO;
7171
self.nextDrawableCount = 0;
72+
self.opaque = FALSE;
7273
return self;
7374
}
7475

src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLPaints.m

+4-4
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ static void initTemplatePipelineDescriptors() {
7373
templateRenderPipelineDesc.sampleCount = 1;
7474
templateRenderPipelineDesc.vertexDescriptor = vertDesc;
7575
templateRenderPipelineDesc.colorAttachments[0].pixelFormat = MTLPixelFormatBGRA8Unorm;
76+
templateRenderPipelineDesc.colorAttachments[0].sourceRGBBlendFactor = MTLBlendFactorOne;
77+
templateRenderPipelineDesc.colorAttachments[0].sourceAlphaBlendFactor = MTLBlendFactorOne;
78+
templateRenderPipelineDesc.colorAttachments[0].destinationRGBBlendFactor = MTLBlendFactorOneMinusSourceAlpha;
79+
templateRenderPipelineDesc.colorAttachments[0].destinationAlphaBlendFactor = MTLBlendFactorOneMinusSourceAlpha;
7680
templateRenderPipelineDesc.label = @"template_render";
7781

7882
templateTexturePipelineDesc = [templateRenderPipelineDesc copy];
@@ -85,10 +89,6 @@ static void initTemplatePipelineDescriptors() {
8589
templateTexturePipelineDesc.label = @"template_texture";
8690

8791
templateAATexturePipelineDesc = [templateTexturePipelineDesc copy];
88-
templateAATexturePipelineDesc.colorAttachments[0].sourceRGBBlendFactor = MTLBlendFactorOne;
89-
templateAATexturePipelineDesc.colorAttachments[0].sourceAlphaBlendFactor = MTLBlendFactorOne;
90-
templateAATexturePipelineDesc.colorAttachments[0].destinationRGBBlendFactor = MTLBlendFactorOneMinusSourceAlpha;
91-
templateAATexturePipelineDesc.colorAttachments[0].destinationAlphaBlendFactor = MTLBlendFactorOneMinusSourceAlpha;
9292
templateAATexturePipelineDesc.label = @"template_aa_texture";
9393

9494
}

0 commit comments

Comments
 (0)