JDK-8151744 : wrong width/height in texture update
  • Type: Bug
  • Component: javafx
  • Sub-Component: graphics
  • Affected Version: 8u60,9
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2016-03-11
  • Updated: 2020-01-31
  • Resolved: 2016-10-24
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
8u152Fixed 9Fixed
In BaseContext.flushVertexBuffer, the call to maskTex.update passes the physical width (maskText.getPhysicalWidth()) as the scanline stride instead of the contentWidth. 

As a consequence, the call to BaseContext.checkUpdateParams may fail because there are not enough elements in the buffer (the physical width can be higher than the content width).

The backport fix is committed by http://hg.openjdk.java.net/openjfx/8u-dev/rt/rev/f7aa09aaff90

Approved to backport to 8u-dev for 8u122. If the patch applies cleanly (which I believe it should), then no need for further review. You can push to 8u-dev with the same changeset comment as for 9-dev.

This is fixed by http://hg.openjdk.java.net/openjfx/9-dev/rt/rev/aaf30c1dff13 Can we backport this to 8u-dev?

Since Jim has now approved this, then you can commit it to 9-dev/rt. I will contact you privately with some details you will need, so please wait until I do that. If you want to also get this into 8u-dev, then once it is commited to 9, you can make a request to backport it to 8u-dev. I need to review / approve such requests.

Can I commit the patch?

That change looks fine to me...

Johan, is this bug fix still in your plans to meet ZBB (Oct 20)? http://openjdk.java.net/projects/jdk9/

@Jim: can you review this in the JIRA (I think it matches what you and Johan already discussed on the openjfx-dev list).

The following patch fixes this: diff -r 5096751eb3ab modules/graphics/src/main/java/com/sun/prism/impl/BaseContext.java --- a/modules/graphics/src/main/java/com/sun/prism/impl/BaseContext.java Wed Dec 16 05:56:05 2015 -0800 +++ b/modules/graphics/src/main/java/com/sun/prism/impl/BaseContext.java Fri Mar 11 21:56:53 2016 +0100 @@ -104,7 +104,7 @@ // since it was bound and unflushed... maskTex.update(maskBuffer, maskTex.getPixelFormat(), 0, 0, 0, 0, highMaskCol, nextMaskRow, - maskTex.getPhysicalWidth(), true); + maskTex.getContentWidth(), true); maskTex.unlock(); curMaskRow = curMaskCol = nextMaskRow = highMaskCol = 0; }