Revert "Use pre-multiplied alpha for path rasterization"

Junkui Zhang created

This reverts commit 8eea9aad40061d80f7f8e83c21671887336c0f2d.

Change summary

crates/gpui/src/platform/windows/directx_renderer.rs | 2 +-
crates/gpui/src/platform/windows/shaders.hlsl        | 3 +--
2 files changed, 2 insertions(+), 3 deletions(-)

Detailed changes

crates/gpui/src/platform/windows/directx_renderer.rs 🔗

@@ -1377,7 +1377,7 @@ fn create_blend_state(device: &ID3D11Device) -> Result<ID3D11BlendState> {
     desc.RenderTarget[0].BlendEnable = true.into();
     desc.RenderTarget[0].BlendOp = D3D11_BLEND_OP_ADD;
     desc.RenderTarget[0].BlendOpAlpha = D3D11_BLEND_OP_ADD;
-    desc.RenderTarget[0].SrcBlend = D3D11_BLEND_ONE;
+    desc.RenderTarget[0].SrcBlend = D3D11_BLEND_SRC_ALPHA;
     desc.RenderTarget[0].SrcBlendAlpha = D3D11_BLEND_ONE;
     desc.RenderTarget[0].DestBlend = D3D11_BLEND_INV_SRC_ALPHA;
     desc.RenderTarget[0].DestBlendAlpha = D3D11_BLEND_ONE;

crates/gpui/src/platform/windows/shaders.hlsl 🔗

@@ -957,8 +957,7 @@ float4 paths_fragment(PathFragmentInput input): SV_Target {
 
     float4 color = gradient_color(background, input.position.xy, input.bounds,
         input.solid_color, input.color0, input.color1);
-    // Return premultiplied alpha for correct blending
-    return float4(color.rgb * color.a, color.a);
+    return color;
 }
 
 // --- path sprite --- //