JDK-8128647 : Effects broken on Scene with gradient background
  • Type: Bug
  • Component: javafx
  • Sub-Component: graphics
  • Affected Version: fx2.0.2
  • Priority: P3
  • Status: Resolved
  • Resolution: Duplicate
  • Submitted: 2011-11-14
  • Updated: 2015-06-17
  • Resolved: 2011-11-29
Related Reports
Relates :  
Description
Test app below creates two stages one with a solid background scene and one with gradient. Both have some text with a drop shadow. The one with the gradient is all messed up, see attached pic.

import javafx.application.Application;
import javafx.geometry.Insets;
import javafx.scene.Scene;
import javafx.scene.effect.DropShadow;
import javafx.scene.layout.StackPaneBuilder;
import javafx.scene.paint.Color;
import javafx.scene.paint.CycleMethod;
import javafx.scene.paint.LinearGradient;
import javafx.scene.paint.Stop;
import javafx.scene.text.Font;
import javafx.scene.text.Text;
import javafx.stage.Stage;

/**
 * @author Jasper Potts
 */
public class EffectBug extends Application {

    public static void main(String[] args) {
        Application.launch(args);
    }
    
    @Override public void start(Stage primaryStage) {
        // BROKEN
        {
            Text label = new Text("Hello");
            label.setFont(Font.font("Arial Black", 72));
            label.setEffect(new DropShadow());
            Scene scene = new Scene(
                    StackPaneBuilder.create().children(label).padding(new Insets(20)).build(),
                    new LinearGradient(0, 0, 0, 1, true, CycleMethod.REPEAT, 
                        new Stop(0, Color.grayRgb(202)),
                        new Stop(1, Color.grayRgb(97))
                    ));
            primaryStage.setScene(scene);
            primaryStage.show();
        }
        
        // WORKING
        {
            Text label = new Text("Hello");
            label.setFont(Font.font("Arial Black", 72));
            label.setEffect(new DropShadow());
            Scene scene = new Scene(
                    StackPaneBuilder.create().children(label).padding(new Insets(20)).build(),
                    Color.YELLOW);
            Stage secondaryStage = new Stage();
            secondaryStage.setScene(scene);
            secondaryStage.show();
        }   
    }
}

Comments
This is a direct duplicate of RT-12852
29-11-2011

My best guess is that the clears to transparent on the backgrounds of the scratch images created by Decora in this and the RT-12852 issue aren't happening, or are getting corrupted, so we end up with a large black image instead of a large transparent image for scratch images on the Mac.
15-11-2011

This may be related to (or a duplicate of) RT-12852. The symptoms are very similar, and in both cases it works on Windows with the D3D, ES2, and J2D pipelines, works on Mac with the J2D pipeline, but fails on Mac with the ES2 pipeline.
15-11-2011

I'm able to reproduce this bug on my Mac too, however rendering looks correct if I uses the j2d pipe. On Windows, just as Kevin noted, d3d or es2 pipe works just fine.
15-11-2011

This may be Mac-specific or even driver-specific. When I run the "BROKEN" test on Windows, either using the d3d or es2 pipeline it renders correctly for me.
15-11-2011