JDK-8165173 : canvas/philip/tests/2d.path.clip.empty.html fails with 8u112
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.
On OS X , I didn't see any other failure (Running DRT with your fix).
"The clip() method must create a new clipping region by calculating the intersection of the current clipping region and the area described by the current path, using the non-zero winding number rule."
Tested on Ubuntu 16.
Looks fine, no breaking of other tests.
Two test case is passing with your changes (On OS X)
canvas/philip/tests/2d.path.clip.empty.html -> succeeded (earlier used to fail)
imported/w3c/canvas/2d.path.clip.empty.html -> succeeded (earlier used to fail) , one of the test case from JDK-8165034
Looks good to me, Please run DRT on Ubuntu 16.04 and update the observation with this patch and let's see if this is not breaking any other tests.
Webrev : http://cr.openjdk.java.net/~asrivastava/8165173/webrev.00/
Tested on Win64 and Linux 64
The null path check was redundant, applied making an assumption that null path can���t be a use case.
But it seems we have a use case in the form of drt test case ���2d.path.clip.empty.html���.
In this test case :2d.path.clip.empty.html cliip path has not been provided
So the function :
static void setClipPath(
const Path& path,
if (gc.paintingDisabled() || path.isEmpty())
returns causing test to fail.
Checked with another test case 2d.path.clip.basic.2.html:
ctx.rect(-100, 0, 100, 50);
It is getting passed as clip Path is set.
Just for debugging modified the code :
//if (gc.paintingDisabled() || path.isEmpty())
And the test is getting passes.
Also checked with test case mentioned in bug 8160260 "svg-background-image.html"
SVG image is getting rendered correctly.
Will try to analyse whether the above null path check is actually needed or not.