United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6662388 D3D: D3DContext::SetRectClip doesn't clip the input coordinates correctly in some cases
JDK-6662388 : D3D: D3DContext::SetRectClip doesn't clip the input coordinates correctly in some cases

Details
Type:
Bug
Submit Date:
2008-02-13
Status:
Resolved
Updated Date:
2010-10-14
Project Name:
JDK
Resolved Date:
2008-03-04
Component:
client-libs
OS:
windows_xp
Sub-Component:
2d
CPU:
x86
Priority:
P4
Resolution:
Fixed
Affected Versions:
6u10
Fixed Versions:
6u10 (b13)

Related Reports

Sub Tasks

Description
D3DContext::SetRectClip doesn't clip incoming coordinates correclty
which leads to errors with the debug d3d runtime.

                                    

Comments
EVALUATION

We have to clip incoming coordinates because otherwise SetScissorRect fails
with the debug d3d runtime. Unfortunately the clipping code doesn't do it
correctly in some cases.

The clipping code looks like this:
    if (x1 < 0)                 x1 = 0;
    if (y1 < 0)                 y1 = 0;
    if ((UINT)x2 > desc.Width)  x2 = desc.Width;
    if ((UINT)y2 > desc.Height) y2 = desc.Height;
    if (x1 > x2)                x2 = x1;
    if (y1 > y2)                y2 = y1;
    RECT newRect = { x1, y1, x2, y2 };

It is not correct for cases when say, both x1 and x2 are greater than 
render target's width. In this case we'll end up with
x1 == x2 > desc.Width. Same with y1/2 and Height.

The fix is to set both x1,x2 or y1,y2 to 0 if the clip rect is empty
so that scissor rect is empty.
                                     
2008-02-13
SUGGESTED FIX

http://sa.sfbay.sun.com/projects/java2d_data/6u10/6662388.0
                                     
2008-02-14



Hardware and Software, Engineered to Work Together