United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: 6749060 LCD AA text rendered incorrectly when destination is non opaque (sw pipeline only)
6749060 : LCD AA text rendered incorrectly when destination is non opaque (sw pipeline only)

Details
Type:
Bug
Submit Date:
2008-09-16
Status:
Resolved
Updated Date:
2010-04-02
Project Name:
JDK
Resolved Date:
2009-01-09
Component:
client-libs
OS:
generic
Sub-Component:
2d
CPU:
generic
Priority:
P3
Resolution:
Fixed
Affected Versions:
6u10
Fixed Versions:
7

Related Reports
Backport:
Relates:
Relates:

Sub Tasks

Description
Run this test on 6u10 on javafx1.0 runtime with Direct3D pipeline disabled
(if on windows), you'll see artifacts on the edges of the text rendered with
the effect:

import javafx.application.*;
import javafx.scene.paint.*;
import javafx.scene.*;
import javafx.scene.text.*;
import javafx.scene.effect.*;

Frame {
    title: "MyApplication"
    width: 600
    height: 200
    closeAction: function() {
        java.lang.System.exit( 0 );
    }
    visible: true

    scene: Scene {
        fill: Color.LIGHTBLUE
        content: [
            Text {
                effect: DropShadow{offsetX:3 offsetY:3 radius: 18 color:Color.WHITE}
                font: Font.font("Arial",FontWeight.BOLD,40.0)
                fill: Color.web("xF2F2F2")
                x: 20, y: 70
                content: "Text with the DropShadow"
                fill: Color.WHITE
            },
            Text {
                font: Font.font("Arial",FontWeight.BOLD,40.0)
                fill: Color.web("xF2F2F2")
                x: 20, y: 130
                content: "Text without the effect"
                fill: Color.WHITE
            }
        ]

    }
}

The issue is very similar to one described in 6728834, but this one is SW
pipeline only.

                                    

Comments
SUGGESTED FIX

http://hg.openjdk.java.net/jdk7/2d/jdk/rev/3bc4d79d8123
                                     
2008-10-10
EVALUATION

The original test case for 6728834 didn't show the problem with SW-rendered
text so I assumed that the sw lcd loops can handle destination with alpha.
But the problem becomes apparent in the test in the descripion.

The fix is the same - add a check for opaque destination to SurfaceData.canRenderLCDText().
                                     
2008-09-16
SUGGESTED FIX

------- SurfaceData.java -------
*** /tmp/sccs.003284    Tue Sep 16 11:38:25 2008
--- SurfaceData.java    Tue Sep 16 11:38:05 2008
***************
*** 365,370 ****
--- 365,371 ----
          if (sg2d.compositeState <= SunGraphics2D.COMP_ISCOPY &&
            sg2d.paintState <= SunGraphics2D.PAINT_ALPHACOLOR &&
            sg2d.clipState <= SunGraphics2D.CLIP_RECTANGULAR &&
+           sg2d.surfaceData.getTransparency() == Transparency.OPAQUE &&
            // This last test is a workaround until we fix loop selection
            // in the pipe validation
            sg2d.antialiasHint != SunHints.INTVAL_ANTIALIAS_ON) {
                                     
2008-09-16



Hardware and Software, Engineered to Work Together