コード例 #1
0
  private XRCompositeManager(XRSurfaceData surface) {
    con = new XRBackendNative();
    // con = XRBackendJava.getInstance();

    String gradProp = System.getProperty("sun.java2d.xrgradcache");
    enableGradCache =
        gradProp == null || !(gradProp.equalsIgnoreCase("false") || gradProp.equalsIgnoreCase("f"));

    XRPaints.register(this);

    initResources(surface);

    maskBuffer = new MaskTileManager(this, surface.getXid());
    textRenderer = new XRTextRenderer(this);
    maskImage = new XRMaskImage(this, surface.getXid());
  }
コード例 #2
0
 public void XRRenderRectangles(XRSurfaceData dst, GrowableRectArray rects) {
   if (xorEnabled) {
     con.GCRectangles(dst.getXid(), dst.getGC(), rects);
   } else {
     con.renderRectangles(dst.getPicture(), compRule, solidColor, rects);
   }
 }
コード例 #3
0
  public void initResources(XRSurfaceData surface) {
    int parentXid = surface.getXid();

    int solidPixmap = con.createPixmap(parentXid, 32, 1, 1);
    int solidSrcPictXID = con.createPicture(solidPixmap, XRUtils.PictStandardARGB32);
    con.setPictureRepeat(solidSrcPictXID, XRUtils.RepeatNormal);
    con.renderRectangle(solidSrcPictXID, XRUtils.PictOpSrc, XRColor.FULL_ALPHA, 0, 0, 1, 1);
    solidSrcPict = new XRSurfaceData.XRInternalSurfaceData(con, solidSrcPictXID, null);
    setForeground(0);

    int extraAlphaMask = con.createPixmap(parentXid, 8, 1, 1);
    alphaMaskPict = con.createPicture(extraAlphaMask, XRUtils.PictStandardA8);
    con.setPictureRepeat(alphaMaskPict, XRUtils.RepeatNormal);
    con.renderRectangle(alphaMaskPict, XRUtils.PictOpClear, XRColor.NO_ALPHA, 0, 0, 1, 1);

    if (enableGradCache) {
      gradCachePixmap =
          con.createPixmap(parentXid, 32, MaskTileManager.MASK_SIZE, MaskTileManager.MASK_SIZE);
      gradCachePicture = con.createPicture(gradCachePixmap, XRUtils.PictStandardARGB32);
    }
  }