return null;
}
SunGraphics2D sg2d = (SunGraphics2D)g;
SurfaceData sData = (SurfaceData)sg2d.surfaceData;
Region r = sg2d.getCompClip();
if (!r.isRectangular()) {
// caller probably doesn't know how to handle shape clip
// appropriately, so just return null (Swing currently never
// sets a shape clip, but that could change in the future)
return null;
}
// this is the upper-left origin of the scissor box relative to the
// upper-left origin of the surface (in Java 2D coordinates)
int x0 = r.getLoX();
int y0 = r.getLoY();
// this is the width and height of the scissor region
int w = r.getWidth();
int h = r.getHeight();
// this is the lower-left origin of the scissor box relative to the
// lower-left origin of the surface (in OpenGL coordinates)
Rectangle surfaceBounds = sData.getBounds();
int x1 = x0;