JDK-8098079 : NGCanvas should take advantage of new 1-step clip support
  • Type: Enhancement
  • Component: javafx
  • Sub-Component: graphics
  • Affected Version: 8
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2013-04-30
  • Updated: 2015-06-12
  • Resolved: 2014-07-14
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.
JDK 8
8u40Fixed
Related Reports
Blocks :  
Relates :  
Relates :  
Relates :  
Relates :  
Description
The fix for RT-23690 introduced a new mechanism for fast clip rendering for use by the web node.  The NGCanvas implementation uses similar operations and should be converted to the new mechanism for performance.
Comments
Small oval clip gets ~5X boost on my Intel HD 3000 and ~3X boost on my iMX6 device.
15-07-2014

I've pushed the fix to the 8u-dev workspace with the following changeset: changeset: 7479:66866f7568a5 date: Mon Jul 14 15:47:49 2014 -0700 summary: Fix RT-30107: NGCanvas should take advantage of new 1-step clipping support http://hg.openjdk.java.net/openjfx/8u-dev/rt/rev/66866f7568a5
14-07-2014

Here is what I get on my Windows 7 machine. I have two graphics chips, Intel HD and NVIDIA, and I ran on both. NVIDIA: w/o patch oval clip: 22 small oval clip: 22 with patch oval clip: 35 small oval clip: 52 Intel HD: w/o patch oval clip: 4.3 small oval clip: 4.3 with patch oval clip: 6.4 small oval clip: 7.3
14-07-2014

No. With the call commented out: 600 monsters oval: 6.43 FPS small oval 6.67 FPS 3000 monsters oval 1.57 FPS small oval: 1.58 FPS
14-07-2014

Did the performance at least jump up with that call commented out?
14-07-2014

I commented out the call to "mtg.drawPixelsMasked", to make sure I'm running the right code, and oval/small oval didn't render. So i think i am testing the right code. Next time you are in the office we can test this together, make sure I'm not testing it wrong.
14-07-2014

There is something odd there. The clip bounds testing alone should be driving the performance of 3k monsters higher with the small oval. And, you are using a newer machine than I am so it's odd that your FPS are so much lower than mine.
14-07-2014

I tried with 3000 monsters, no performance gain. Tested oval and small oval ~1.5 FPS. More than 3000 monsters brings the FPS to nearly 0, can't measure it.
14-07-2014

Felipe, try larger numbers of monsters as well. I'm surprised that you don't get more improvement on small oval since we now should be ignoring the vast majority of the monsters when we render through that small clip.
14-07-2014

VectorChartingTest for small oval is much faster (tested on Mac) Rectangle clip: 20 FPS => 20 FPS Oval clip: 15 FPS => 16 FPS Small oval clip: 14.63 FPS => 37.49 FPS
14-07-2014

Looks fine to me, but I don't see the same improvement: 600 monsters on Retina, 15-inch, Early 2013/2.4 GHz Intel Core i7/NVIDIA GeForce GT 650M 1024 MB Rectangle clip: 60 FPS => 60 Oval clip: 5.6 FPS => 6.0 FPS Small oval clip: 5.8 FPS => 6.5 FPS
14-07-2014

Fix: http://cr.openjdk.java.net/~flar/RT-30107/webrev.00/ There are 2 parts to this fix. First, the new drawPixelsMasked() method is used to implement the shaped clip masking and that is responsible for most of the performance gains under "large oval". Second, the cumulative intersected bounds of all of the clip paths is kept and used to restrict the clip masking operations - this is responsible for the further gains under "small oval". Some small cleanups to a few variables being over-initialized in the clipping code were also included but should have no impact on the performance at all (extra assign of a boolean to a local variable for example). The gains I saw on my Mid 2012 retina MBP (nvidia GT 650M, 2.6GHz Intel i7) were: Windows 7, D3D pipeline: Bitmap with 600 monsters: Rectangle clip: 60 FPS => 60 FPS Oval clip: 31.25 FPS => 34.5 FPS Small oval clip: 31.25 FPS => 60 FPS Bitmap with 3,000 monsters: Rectangle clip: 60 FPS => 60 FPS Oval clip: 7.14 FPS => 13.25 FPS Small oval clip: 7.14 FPS => 26.5 FPS Bitmap with 15,000 monsters: Rectangle clip: 13.67 FPS => 13.67 FPS Oval clip: 1.48 FPS => 2.77 FPS Small oval clip: 1.48 FPS => 5.51 FPS Vector: Rectangle clip: 41 FPS => 41 FPS Oval clip: 37.87 FPS => 37.87 FPS Small oval clip: 37.87 FPS => 60 FPS Mac with OpenGL: Bitmap with 600 monsters: Rectangle clip: 60 FPS => 60 FPS Oval clip: 14 FPS => 20 FPS Small oval clip: 14.5 FPS => 36 FPS Bitmap with 3,000 monsters: Rectangle clip: 50 FPS => 50 FPS Oval clip: 3.5 FPS => 5.6 FPS Small oval clip: 3.5 FPS => 12.72 FPS Bitmap with 15,000 monsters: Rectangle clip: 16.3 FPS => 16.3 FPS Oval clip: 0.73 FPS => 1.15 FPS Small oval clip: 0.73 FPS => 3 FPS Vector: Rectangle clip: 25 FPS => 25 FPS Oval clip: 20 FPS => 20.5 FPS Small oval clip: 22 FPS => 60 FPS
11-07-2014