JDK-6690659 : Simple primitives (rectangle and lines) are slow when rendered with a transform
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 6
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2008-04-18
  • Updated: 2010-04-02
  • Resolved: 2008-04-27
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.
6u10 b23Fixed 7Fixed
Related Reports
Relates :  
Relates :  
Relates :  
A short test case is attached which shows that simple transformed rectangle
fills and AA rectangles are up to 20 or more times slower than simple
untransformed rectangle fills, even on the latest hardware.  With the power
of the hardware GPUs in todays machines, there should be little, if any,
difference in the rendering speed of these primitives.

Indeed, experiments show that we can achieve near-parity for transformed and
AA rectangles and wide lines using simple variations of the D3D and OGL
FillRect primitive and a small Pixel Shader program that runs on most
graphics cards that have been common for the past 3 or 4 years.

EVALUATION With a simple shader program and some new internal pipeline pathways the performance of the following primitives can improve by a factor of around 10x depending on the hardware: fillRect() AA and transformed fill(Rectangle2D) non-AA, AA, and transformed drawRect() AA and transformed draw(Rectangle2D) non-AA, AA, and transformed drawLine() AA and transformed draw(Line2D) non-AA, AA, and transformed Running tests on a 512MB nVidia 8600GT M: With these changes the attached test case improves by a factor of about 9x to 20x for the 3 cases where AA or transforms are involved. A very dramatic improvement can be seen in the Scenario demo DynamicDemo which improves by the following amounts: orig6u10 newshader AA stroke/fill 6984ms 656ms (10.6x) AA stroke 4468ms 531ms ( 8.4x) AA fill 2922ms 437ms ( 6.7x) non-AA stroke/fill 1656ms 656ms ( 2.5x) non-AA stroke 797ms 531ms ( 1.5x) non-AA fill 1141ms 422ms ( 2.7x)