JDK-6570870 : non-integral translation behavior should be controlled by RenderingHints
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 5.0
  • Priority: P4
  • Status: Closed
  • Resolution: Won't Fix
  • OS: generic
  • CPU: generic
  • Submitted: 2007-06-18
  • Updated: 2014-03-14
  • Resolved: 2014-03-14
Related Reports
Relates :  
Description
In JDK 5, we fixed 4916948, which means that for non-integral image translations
(for BILINEAR and BICUBIC hints only), our Java 2D implementation will send the
image through slower transform loops.  This is important for correctness and
visual quality (as requested by many developers), but there are other developers
who may be less concerned with this exact behavior and would instead prefer the
old behavior, mainly because performance would be improved.

It is possible for developers to work around this issue in their code by checking
to see if there is only an integral translation set, and if so use the default
NEAREST_NEIGHBOR mode, which does not require going through the slow path.  Of
course, such workarounds are inconvenient and ideally unnecessary.  Therefore, we
should consider making this behavior selectable via the RENDER_QUALITY/SPEED RenderingHints, or some similar solution.

Comments
EVALUATION I am lowering the priority of this bug to 4 for the following reasons: - HW accelerated rendering is used on the most common platforms today and does not suffer these drastic performance losses. - The user had to enable the rendering hint themselves in order to get this performance impact. They enabled the hint in order to get higher quality results and we are delivering those higher quality results, so they are simply getting what they asked for. - There is a workaround - if they don't want interpolation to happen for simple translations (of non-integer values) then they can always turn off the interpolation hints for those blits. - This is an internal bug about a theoretical regression that customers might care about, but we have no reports from the field in a couple of years that they are actually concerned with this potential performance issue (most likely due to some combination of the above reasons/mitigating facts).
18-12-2010

EVALUATION Some simple benchmarks show that while bilinear translations are 3x faster in 1.6 than in 1.5, they are still about 10x slower than a simple image copy. The slowness is only seen however, when 2 conditions are both satisfied. The INTERPOLATION hint must be set to one if its interpolative settings (BILINEAR or BICUBIC) and the subpixel translation must be more than .0001 from an integer. Note that for determining if filtering is required the error allowed could be closer to 1/256 rather than 1/10,000 since less than that amount of translation will equate to no change in the filtered values if the color components are of 8-bit precision.
19-06-2007