413 final SurfaceData dstData = sg.surfaceData; 414 SurfaceData srcData = dstData.getSourceSurfaceData(img, 415 SunGraphics2D.TRANSFORM_GENERIC, 416 sg.imageComp, 417 bgColor); 418 419 if (srcData == null) { 420 img = getBufferedImage(img); 421 srcData = dstData.getSourceSurfaceData(img, 422 SunGraphics2D.TRANSFORM_GENERIC, 423 sg.imageComp, 424 bgColor); 425 if (srcData == null) { 426 // REMIND: Is this correct? Can this happen? 427 return; 428 } 429 } 430 431 if (isBgOperation(srcData, bgColor)) { 432 // We cannot perform bg operations during transform so make 433 // an opaque temp image with the appropriate background 434 // and work from there. 435 img = makeBufferedImage(img, bgColor, BufferedImage.TYPE_INT_RGB, 436 sx1, sy1, sx2, sy2); 437 // Temp image has appropriate subimage at 0,0 now. 438 sx2 -= sx1; 439 sy2 -= sy1; 440 sx1 = sy1 = 0; 441 442 srcData = dstData.getSourceSurfaceData(img, 443 SunGraphics2D.TRANSFORM_GENERIC, 444 sg.imageComp, 445 bgColor); 446 } 447 448 SurfaceType srcType = srcData.getSurfaceType(); 449 TransformHelper helper = TransformHelper.getFromCache(srcType); 450 451 if (helper == null) { 452 /* We have no helper for this source image type. 453 * But we know that we do have helpers for both RGB and ARGB, 454 * so convert to one of those types depending on transparency. 455 * ARGB_PRE might be a better choice if the source image has | 413 final SurfaceData dstData = sg.surfaceData; 414 SurfaceData srcData = dstData.getSourceSurfaceData(img, 415 SunGraphics2D.TRANSFORM_GENERIC, 416 sg.imageComp, 417 bgColor); 418 419 if (srcData == null) { 420 img = getBufferedImage(img); 421 srcData = dstData.getSourceSurfaceData(img, 422 SunGraphics2D.TRANSFORM_GENERIC, 423 sg.imageComp, 424 bgColor); 425 if (srcData == null) { 426 // REMIND: Is this correct? Can this happen? 427 return; 428 } 429 } 430 431 if (isBgOperation(srcData, bgColor)) { 432 // We cannot perform bg operations during transform so make 433 // a temp image with the appropriate background 434 // and work from there. 435 img = makeBufferedImage(img, bgColor, BufferedImage.TYPE_INT_ARGB, 436 sx1, sy1, sx2, sy2); 437 // Temp image has appropriate subimage at 0,0 now. 438 sx2 -= sx1; 439 sy2 -= sy1; 440 sx1 = sy1 = 0; 441 442 srcData = dstData.getSourceSurfaceData(img, 443 SunGraphics2D.TRANSFORM_GENERIC, 444 sg.imageComp, 445 bgColor); 446 } 447 448 SurfaceType srcType = srcData.getSurfaceType(); 449 TransformHelper helper = TransformHelper.getFromCache(srcType); 450 451 if (helper == null) { 452 /* We have no helper for this source image type. 453 * But we know that we do have helpers for both RGB and ARGB, 454 * so convert to one of those types depending on transparency. 455 * ARGB_PRE might be a better choice if the source image has |