Beispiel #1
0
 protected void blitSurfaceData(
     SunGraphics2D sg,
     Region clipRegion,
     SurfaceData srcData,
     SurfaceData dstData,
     SurfaceType srcType,
     SurfaceType dstType,
     int sx,
     int sy,
     int dx,
     int dy,
     int w,
     int h,
     Color bgColor) {
   if (w <= 0 || h <= 0) {
     /*
      * Fix for bugid 4783274 - BlitBg throws an exception for
      * a particular set of anomalous parameters.
      * REMIND: The native loops do proper clipping and would
      * detect this situation themselves, but the Java loops
      * all seem to trust their parameters a little too well
      * to the point where they will try to process a negative
      * area of pixels and throw exceptions.  The real fix is
      * to modify the Java loops to do proper clipping so that
      * they can deal with negative dimensions as well as
      * improperly large dimensions, but that fix is too risky
      * to integrate for Mantis at this point.  In the meantime
      * eliminating the negative or zero dimensions here is
      * "correct" and saves them from some nasty exceptional
      * conditions, one of which is the test case of 4783274.
      */
     return;
   }
   CompositeType comp = sg.imageComp;
   if (CompositeType.SrcOverNoEa.equals(comp)
       && (srcData.getTransparency() == Transparency.OPAQUE
           || (bgColor != null && bgColor.getTransparency() == Transparency.OPAQUE))) {
     comp = CompositeType.SrcNoEa;
   }
   if (!isBgOperation(srcData, bgColor)) {
     Blit blit = Blit.getFromCache(srcType, comp, dstType);
     blit.Blit(srcData, dstData, sg.composite, clipRegion, sx, sy, dx, dy, w, h);
   } else {
     BlitBg blit = BlitBg.getFromCache(srcType, comp, dstType);
     blit.BlitBg(
         srcData, dstData, sg.composite, clipRegion, bgColor.getRGB(), sx, sy, dx, dy, w, h);
   }
 }
 public boolean isTransparent() {
   return (color.getTransparency() == Transparency.TRANSLUCENT);
 }