JDK-6593406 : the BlitBg generic loop doesn't do bounds clipping properly
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 5.0
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • OS: generic
  • CPU: generic
  • Submitted: 2007-08-15
  • Updated: 2018-09-05
Related Reports
Relates :  
Description
The sun.java2d.loops.BlitBg.Generic loop doesn't do proper
clipping of the source and destination surfaces.

Run the attached test case, and it will fail with the following:
Testing source: BufferedImage@186768e: type = 2 DirectColorModel: rmask=ff0000 gmask=ff00 bmask=ff amask=ff000000 IntegerInterleavedRaster: width = 50 height = 50 #Bands = 4 xOff = 0 yOff = 0 dataOffset[0] 0
testing blit rect src: java.awt.Rectangle[x=0,y=0,width=30,height=30]
                  dst: java.awt.Rectangle[x=-10,y=-10,width=30,height=30]
calculated dest rect:java.awt.Rectangle[x=0,y=0,width=20,height=20]
subtest passed
testing blit rect src: java.awt.Rectangle[x=-10,y=-10,width=50,height=50]
                  dst: java.awt.Rectangle[x=0,y=0,width=50,height=50]
calculated dest rect:java.awt.Rectangle[x=10,y=10,width=40,height=40]
Test failed at x=0 y=0
 expected: ff00ff00 got:ffff0000
Exception in thread "AWT-EventQueue-0" java.lang.RuntimeException: Test failed at x=0 y=0
        at SourceClippingBlitTest.test(SourceClippingBlitTest.java:212)
        at SourceClippingBlitTest.runTests(SourceClippingBlitTest.java:133)
        at SourceClippingBlitTest$1.windowActivated(SourceClippingBlitTest.java:69)

It fails with the default, d3d and opengl pipelines starting at least
on 1.5 (haven't tested earlier releases) through 1.7 (b18).

Comments
EVALUATION During the investigation of this bug: 6588884: PIT:D3D: Few regression test fails on WinXP with Nvidia FX boards. it was found that one of the tests fails because of this bug: sun/java2d/SunGraphics2D/SourceClippingBlitTest/SourceClippingBlitTest.java See the evaluation of 6588884 for more info. The test will fail for ARGB source image (since we don't have optimized BlitBg loops for Argb). A modified version of the test is attached.
15-08-2007