Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8108320

Regression: Flood with LinearGradient doesn't work

XMLWordPrintable

      This is a regression on the recently released 1.3 partner drop (b11) from the behavior in the JavaFX 1.2 release.

      I tried running my TimeWheel example (my submission for the JFXStudio 30 lines contest), and it failed while rendering the following effect:
                  effect: Blend {
                      mode: BlendMode.SRC_ATOP
                      topInput: Flood {
                          paint: LinearGradient {
                              endX: 0
                              stops: [
                                  Stop {offset: 0, color: color(0,0,0,.9)}
                                  Stop {offset: .3, color: TRANSPARENT}
                                  Stop {offset: .7, color: TRANSPARENT}
                                  Stop {offset: 1, color: color(0,0,0,.9)}
                              ]
                          }
                          y: y
                          width: 400
                          height: height
                      }
                  }

      With this exception:
      Unexpected exception caught in MasterTimer.timePulse():
      java.lang.UnsupportedOperationException: ProportionalPaint is not designed to be used directly by rendering operations
              at com.sun.javafx.tk.swing.Gradients$ProportionalGradientDelegate.createContext(Gradients.java:120)
              at sun.java2d.pipe.AlphaPaintPipe.startSequence(AlphaPaintPipe.java:65)
              at sun.java2d.pipe.SpanShapeRenderer$Composite.startSequence(SpanShapeRenderer.java:38)
              at sun.java2d.pipe.SpanShapeRenderer.renderRect(SpanShapeRenderer.java:143)
              at sun.java2d.pipe.SpanShapeRenderer.fill(SpanShapeRenderer.java:87)
              at sun.java2d.pipe.PixelToShapeConverter.fillRect(PixelToShapeConverter.java:44)
              at sun.java2d.pipe.ValidatePipe.fillRect(ValidatePipe.java:58)
              at sun.java2d.SunGraphics2D.fillRect(SunGraphics2D.java:2265)
              at com.sun.scenario.effect.impl.j2d.J2DFloodPeer.filter(J2DFloodPeer.java:77)
              at com.sun.scenario.effect.CoreEffect.filterImageDatas(CoreEffect.java:101)
              at com.sun.scenario.effect.Flood.filterImageDatas(Flood.java:38)
              at com.sun.scenario.effect.FilterEffect.filter(FilterEffect.java:100)
              at com.sun.scenario.effect.FilterEffect.filter(FilterEffect.java:92)
              at com.sun.scenario.effect.impl.j2d.J2DEffectHelper.render(J2DEffectHelper.java:82)
              at com.sun.scenario.scenegraph.EffectFilter.render(EffectFilter.java:25)
              at com.sun.scenario.scenegraph.SGNode.renderEffect(SGNode.java:784)
              at com.sun.scenario.scenegraph.SGNode.doRender(SGNode.java:592)
              at com.sun.scenario.scenegraph.SGNode.render(SGNode.java:572)
              at com.sun.scenario.scenegraph.SGGroup.renderContent(SGGroup.java:336)
              at com.sun.scenario.scenegraph.SGNode.doRender(SGNode.java:597)
              at com.sun.scenario.scenegraph.SGNode.render(SGNode.java:547)
              at com.sun.scenario.scenegraph.SGGroup.renderContent(SGGroup.java:336)
              at com.sun.scenario.scenegraph.SGNode.doRender(SGNode.java:597)
              at com.sun.scenario.scenegraph.SGNode.render(SGNode.java:547)
              at com.sun.scenario.scenegraph.JSGPanel.paintComponent(JSGPanel.java:248)
              at javax.swing.JComponent.paint(JComponent.java:1029)
              at javax.swing.JComponent.paintChildren(JComponent.java:864)
              at javax.swing.JComponent.paint(JComponent.java:1038)
              at javax.swing.JLayeredPane.paint(JLayeredPane.java:567)
              at javax.swing.JComponent.paintChildren(JComponent.java:864)
              at javax.swing.JComponent.paint(JComponent.java:1038)
              at javax.swing.JComponent.paintToOffscreen(JComponent.java:5124)
              at javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(RepaintManager.java:1475)
              at javax.swing.RepaintManager$PaintManager.paint(RepaintManager.java:1406)
              at javax.swing.RepaintManager.paint(RepaintManager.java:1220)
              at javax.swing.JComponent._paintImmediately(JComponent.java:5072)
              at javax.swing.JComponent.paintImmediately(JComponent.java:4882)
              at javax.swing.JComponent.paintImmediately(JComponent.java:4894)
              at com.sun.scenario.scenegraph.JSGPanel.repaintDirtyRegions(JSGPanel.java:338)
              at com.sun.scenario.scenegraph.JSGPanelRepainter.repaintAll(JSGPanelRepainter.java:122)
              at com.sun.scenario.scenegraph.JSGPanelRepainter$FrameDisplay.run(JSGPanelRepainter.java:134)
              at com.sun.scenario.animation.AbstractMasterTimer.timePulseImpl(AbstractMasterTimer.java:398)
              at com.sun.scenario.animation.AbstractMasterTimer$MainLoop.run(AbstractMasterTimer.java:274)
              at com.sun.embeddedswing.EmbeddedEventQueue.doPulse(EmbeddedEventQueue.java:563)
              at com.sun.embeddedswing.EmbeddedEventQueue.access$000(EmbeddedEventQueue.java:75)
              at com.sun.embeddedswing.EmbeddedEventQueue$2.run(EmbeddedEventQueue.java:466)
              at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
              at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
              at java.util.concurrent.FutureTask.run(FutureTask.java:138)
              at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
              at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
              at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
              at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
              at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
              at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
              at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
              at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

      Changing the LinearGradient to a flat color fixed the problem (without the desired effect), so I assume that it is an incompatibility between Flood and LinearGradient.

      I have attached the source of the full program, which can be run as a single, self-contained JavaFX file.

            flar Jim Graham
            schin Stephen Chin (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: