1 package sun.java2d.xr;
   2 
   3 public class XRSolidSrcPict {
   4     XRBackend con;
   5     
   6     XRSurfaceData srcPict;
   7     XRColor xrCol;
   8     int curPixVal = -1;
   9 
  10     public XRSolidSrcPict(XRBackend con, int parentXid) {
  11         this.con = con;
  12         
  13         xrCol = new XRColor();
  14         int solidPixmap = con.createPixmap(parentXid, 32, 1, 1);
  15         int solidSrcPictXID = con.createPicture(solidPixmap, XRUtils.PictStandardARGB32);
  16         con.setPictureRepeat(solidSrcPictXID, XRUtils.RepeatNormal);
  17         con.renderRectangle(solidSrcPictXID, XRUtils.PictOpSrc, XRColor.FULL_ALPHA, 0, 0, 1, 1);
  18         srcPict = new XRSurfaceData.XRInternalSurfaceData(con, solidSrcPictXID, null);
  19     }
  20     
  21     public XRSurfaceData prepareSrcPict(int pixelVal) {
  22         if(pixelVal != curPixVal) {
  23             xrCol.setColorValues(pixelVal, false);
  24             con.renderRectangle(srcPict.picture, XRUtils.PictOpSrc, xrCol, 0, 0, 1, 1);
  25             this.curPixVal = pixelVal;
  26         }
  27         
  28         return srcPict;
  29     }
  30 
  31 }