42 43 /*Don't cache already native surfaces*/ 44 if (srcData instanceof XRSurfaceData) { 45 return UNCACHED; 46 } 47 48 return new XRSurfaceDataProxy(dstConfig, srcData.getTransparency()); 49 } 50 51 XRGraphicsConfig xrgc; 52 int transparency; 53 54 public XRSurfaceDataProxy(XRGraphicsConfig x11gc) { 55 this.xrgc = x11gc; 56 } 57 58 @Override 59 public SurfaceData validateSurfaceData(SurfaceData srcData, 60 SurfaceData cachedData, int w, int h) { 61 if (cachedData == null) { 62 cachedData = XRSurfaceData.createData(xrgc, w, h, xrgc 63 .getColorModel(), null, 0, getTransparency()); 64 } 65 return cachedData; 66 } 67 68 public XRSurfaceDataProxy(XRGraphicsConfig x11gc, int transparency) { 69 this.xrgc = x11gc; 70 this.transparency = transparency; 71 } 72 73 //TODO: Is that really ok? 74 @Override 75 public boolean isSupportedOperation(SurfaceData srcData, int txtype, 76 CompositeType comp, Color bgColor) { 77 return (bgColor == null || transparency == Transparency.TRANSLUCENT); 78 } 79 80 public int getTransparency() { 81 return transparency; 82 } 83 } | 42 43 /*Don't cache already native surfaces*/ 44 if (srcData instanceof XRSurfaceData) { 45 return UNCACHED; 46 } 47 48 return new XRSurfaceDataProxy(dstConfig, srcData.getTransparency()); 49 } 50 51 XRGraphicsConfig xrgc; 52 int transparency; 53 54 public XRSurfaceDataProxy(XRGraphicsConfig x11gc) { 55 this.xrgc = x11gc; 56 } 57 58 @Override 59 public SurfaceData validateSurfaceData(SurfaceData srcData, 60 SurfaceData cachedData, int w, int h) { 61 if (cachedData == null) { 62 cachedData = XRSurfaceData.createData(xrgc, w, h, 63 xrgc.getColorModel(), null, 0, 64 getTransparency(), true); 65 } 66 return cachedData; 67 } 68 69 public XRSurfaceDataProxy(XRGraphicsConfig x11gc, int transparency) { 70 this.xrgc = x11gc; 71 this.transparency = transparency; 72 } 73 74 //TODO: Is that really ok? 75 @Override 76 public boolean isSupportedOperation(SurfaceData srcData, int txtype, 77 CompositeType comp, Color bgColor) { 78 return (bgColor == null || transparency == Transparency.TRANSLUCENT); 79 } 80 81 public int getTransparency() { 82 return transparency; 83 } 84 } |