--- old/src/macosx/native/sun/awt/QuartzRenderer.m 2012-08-31 10:22:55.000000000 -0700 +++ new/src/macosx/native/sun/awt/QuartzRenderer.m 2012-08-31 10:22:55.000000000 -0700 @@ -50,9 +50,6 @@ // same value as defined in Sun's own code #define XOR_ALPHA_CUTOFF 128 -// private Quartz routines needed here -CG_EXTERN void CGContextSetCTM(CGContextRef ref, CGAffineTransform tx); - static CGFloat gRoundRectCtrlpts[10][12] = { @@ -537,7 +534,8 @@ makeSureImageIsCreated(isdo); CGAffineTransform ctm = CGContextGetCTM(cgRef); - CGContextConcatCTM(cgRef, CGAffineTransformMake(a, b, c, d, tx, ty)); + CGAffineTransform newTm = CGAffineTransformMake(a, b, c, d, tx, ty); + CGContextConcatCTM(cgRef, newTm); jint alphaInfo = isdo->contextInfo.alphaInfo & kCGBitmapAlphaInfoMask; if ((sx == 0) && (sy == 0) && (sw == w) && (sh == h)) // no subimages allowed here @@ -551,7 +549,8 @@ CGImageRelease(subImg); } - CGContextSetCTM(cgRef, ctm); + CGAffineTransform inverse = CGAffineTransformInvert(newTm); + CGContextConcatCTM(cgRef, inverse); UnlockImage(env, isdo); }