406 int boundsWidth = (int) rotBounds.getWidth();
407 int boundsHeight = (int) rotBounds.getHeight();
408
409 if (boundsWidth > 0 && boundsHeight > 0) {
410
411
412 /* If the image has transparent or semi-transparent
413 * pixels then we'll have the application re-render
414 * the portion of the page covered by the image.
415 * This will be done in a later call to print using the
416 * saved graphics state.
417 * However several special cases can be handled otherwise:
418 * - bitmask transparency with a solid background colour
419 * - images which have transparency color models but no
420 * transparent pixels
421 * - images with bitmask transparency and an IndexColorModel
422 * (the common transparent GIF case) can be handled by
423 * rendering just the opaque pixels.
424 */
425 boolean drawOpaque = true;
426 if (!handlingTransparency && hasTransparentPixels(img)) {
427 drawOpaque = false;
428 if (isBitmaskTransparency(img)) {
429 if (bgcolor == null) {
430 if (drawBitmaskImage(img, xform, bgcolor,
431 srcX, srcY,
432 srcWidth, srcHeight)) {
433 // image drawn, just return.
434 return true;
435 }
436 } else if (bgcolor.getTransparency()
437 == Transparency.OPAQUE) {
438 drawOpaque = true;
439 }
440 }
441 if (!canDoRedraws()) {
442 drawOpaque = true;
443 }
444 } else {
445 // if there's no transparent pixels there's no need
446 // for a background colour. This can avoid edge artifacts
|
406 int boundsWidth = (int) rotBounds.getWidth();
407 int boundsHeight = (int) rotBounds.getHeight();
408
409 if (boundsWidth > 0 && boundsHeight > 0) {
410
411
412 /* If the image has transparent or semi-transparent
413 * pixels then we'll have the application re-render
414 * the portion of the page covered by the image.
415 * This will be done in a later call to print using the
416 * saved graphics state.
417 * However several special cases can be handled otherwise:
418 * - bitmask transparency with a solid background colour
419 * - images which have transparency color models but no
420 * transparent pixels
421 * - images with bitmask transparency and an IndexColorModel
422 * (the common transparent GIF case) can be handled by
423 * rendering just the opaque pixels.
424 */
425 boolean drawOpaque = true;
426 if (isCompositing(getComposite())) {
427 drawOpaque = false;
428 } else if (!handlingTransparency && hasTransparentPixels(img)) {
429 drawOpaque = false;
430 if (isBitmaskTransparency(img)) {
431 if (bgcolor == null) {
432 if (drawBitmaskImage(img, xform, bgcolor,
433 srcX, srcY,
434 srcWidth, srcHeight)) {
435 // image drawn, just return.
436 return true;
437 }
438 } else if (bgcolor.getTransparency()
439 == Transparency.OPAQUE) {
440 drawOpaque = true;
441 }
442 }
443 if (!canDoRedraws()) {
444 drawOpaque = true;
445 }
446 } else {
447 // if there's no transparent pixels there's no need
448 // for a background colour. This can avoid edge artifacts
|