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

[Swing] NullPointerException when rendering SwingFXUtils.toFXImage() on 10,000x8,0000 image

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • 8u20
    • javafx
    • None
    • Windows 7x64

      Converted use SwingFXUtils.toFXImage() to convert BufferedImage then put result Image in ImageView. 10,000x8,000 fails on rendering, while 512x512 opens/renders fine. Debug text:

      PCS Texture allocating buffer: com.sun.prism.sw.SWRTTexture@5261bdfd, 1924x1040
      + PR.resetClip
      + concat scale com.sun.prism.sw.SWGraphics@1c357047; sx: 1.0; sy: 1.0
      + PR.resetClip
      + PR.clear: Color[r=0.0, g=0.0, b=0.0, a=1.0]
      PR.setColor: Color[r=0.0, g=0.0, b=0.0, a=1.0]
      + getTransformNoClone com.sun.prism.sw.SWGraphics@1c357047; tr: Affine2D[[1.0, 0.0, 0.0], [0.0, 1.0, 0.0]]
      + concatTransform com.sun.prism.sw.SWGraphics@1c357047; tr: Identity[]
      + getTransformNoClone com.sun.prism.sw.SWGraphics@1c357047; tr: Affine2D[[1.0, 0.0, 0.0], [0.0, 1.0, 0.0]]
      + concatTransform com.sun.prism.sw.SWGraphics@1c357047; tr: Identity[]
      java.lang.NullPointerException
      at com.sun.prism.sw.SWGraphics.drawTexture(SWGraphics.java:674)
      at com.sun.prism.sw.SWGraphics.drawTexture(SWGraphics.java:665)
      at com.sun.prism.sw.SWGraphics.drawTexture(SWGraphics.java:648)
      at com.sun.javafx.sg.prism.NGImageView.renderContent(NGImageView.java:123)
      at com.sun.javafx.sg.prism.NGNode.doRender(NGNode.java:2043)
      at com.sun.javafx.sg.prism.NGImageView.doRender(NGImageView.java:103)
      at com.sun.javafx.sg.prism.NGNode.render(NGNode.java:1951)
      at com.sun.javafx.sg.prism.NGGroup.renderContent(NGGroup.java:225)
      at com.sun.javafx.sg.prism.NGNode.doRender(NGNode.java:2043)
      at com.sun.javafx.sg.prism.NGNode.render(NGNode.java:1951)
      at com.sun.javafx.tk.quantum.ViewPainter.doPaint(ViewPainter.java:469)
      at com.sun.javafx.tk.quantum.ViewPainter.paintImpl(ViewPainter.java:324)
      at com.sun.javafx.tk.quantum.UploadingPainter.run(UploadingPainter.java:132)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
      at com.sun.javafx.tk.RenderJob.run(RenderJob.java:58)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:129)
      at java.lang.Thread.run(Thread.java:744)


      Tracing code looks like NGImageView.java:121
      >>>>121 Texture texture = factory.getCachedTexture(image, Texture.WrapMode.CLAMP_TO_EDGE);
      is good candidate for returning null, which is passed to drawTexture() in line 123 ultimately throwing null exception in SWGraphics.java:674
      >>>>674 ", tex.w: " + tex.getPhysicalWidth() + ", tex.h: " + tex.getPhysicalHeight() +

      Noticed as I write this that when I remove -Dprism.debug=true from input dump becomes:
      java.lang.NullPointerException
      at com.sun.prism.sw.SWGraphics.drawTexture(SWGraphics.java:686)
      at com.sun.prism.sw.SWGraphics.drawTexture(SWGraphics.java:665)
      at com.sun.prism.sw.SWGraphics.drawTexture(SWGraphics.java:648)
      at com.sun.javafx.sg.prism.NGImageView.renderContent(NGImageView.java:123)
      at com.sun.javafx.sg.prism.NGNode.doRender(NGNode.java:2043)
      at com.sun.javafx.sg.prism.NGImageView.doRender(NGImageView.java:103)
      at com.sun.javafx.sg.prism.NGNode.render(NGNode.java:1951)
      at com.sun.javafx.sg.prism.NGGroup.renderContent(NGGroup.java:225)
      at com.sun.javafx.sg.prism.NGNode.doRender(NGNode.java:2043)
      at com.sun.javafx.sg.prism.NGNode.render(NGNode.java:1951)
      at com.sun.javafx.tk.quantum.ViewPainter.doPaint(ViewPainter.java:469)
      at com.sun.javafx.tk.quantum.ViewPainter.paintImpl(ViewPainter.java:324)
      at com.sun.javafx.tk.quantum.UploadingPainter.run(UploadingPainter.java:132)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
      at com.sun.javafx.tk.RenderJob.run(RenderJob.java:58)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:129)
      at java.lang.Thread.run(Thread.java:744)

      where exception is moved to SWGraphics.java:686:
      >>>>686 int data[] = swTex.getDataNoClone();

      In both cases first concrete use of texture.

            Unassigned Unassigned
            duke J. Duke
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Imported: