Esempio n. 1
0
  private void setComposite(Composite comp) {
    if (comp instanceof AlphaComposite) {
      AlphaComposite aComp = (AlphaComposite) comp;
      validatedExtraAlpha = aComp.getAlpha();

      this.compRule = XRUtils.j2dAlphaCompToXR(aComp.getRule());
      this.extraAlpha = validatedExtraAlpha;

      if (extraAlpha == 1.0f) {
        alphaMask = XRUtils.None;
        alphaColor.alpha = XRColor.FULL_ALPHA.alpha;
      } else {
        alphaColor.alpha = XRColor.byteToXRColorValue((int) (extraAlpha * 255));
        alphaMask = alphaMaskPict;
        con.renderRectangle(alphaMaskPict, XRUtils.PictOpSrc, alphaColor, 0, 0, 1, 1);
      }

      xorEnabled = false;
    } else if (comp instanceof XORComposite) {
      /* XOR composite validation is handled in XRSurfaceData */
      xorEnabled = true;
    } else {
      throw new InternalError(
          "Composite accaleration not implemented for: " + comp.getClass().getName());
    }
  }
Esempio n. 2
0
 public void setForeground(int pixel) {
   solidColor.setColorValues(pixel, false);
   con.renderRectangle(solidSrcPict.picture, XRUtils.PictOpSrc, solidColor, 0, 0, 1, 1);
 }