45 return true;
46 }
47
48 /**
49 * Create a pixmap-based SurfaceData object
50 */
51 protected SurfaceData initAcceleratedSurface() {
52 SurfaceData sData;
53
54 try {
55 XRGraphicsConfig gc = (XRGraphicsConfig) vImg.getGraphicsConfig();
56 ColorModel cm = gc.getColorModel();
57 long drawable = 0;
58 if (context instanceof Long) {
59 drawable = ((Long)context).longValue();
60 }
61 sData = XRSurfaceData.createData(gc,
62 vImg.getWidth(),
63 vImg.getHeight(),
64 cm, vImg, drawable,
65 vImg.getTransparency());
66 } catch (NullPointerException ex) {
67 sData = null;
68 } catch (OutOfMemoryError er) {
69 sData = null;
70 }
71
72 return sData;
73 }
74
75 /**
76 * XRender should allow copies between different formats and depths.
77 * TODO: verify that this assumption is correct.
78 */
79 protected boolean isConfigValid(GraphicsConfiguration gc) {
80 return true;
81 }
82
83 /**
84 * Need to override the default behavior because Pixmaps-based
85 * images are accelerated but not volatile.
|
45 return true;
46 }
47
48 /**
49 * Create a pixmap-based SurfaceData object
50 */
51 protected SurfaceData initAcceleratedSurface() {
52 SurfaceData sData;
53
54 try {
55 XRGraphicsConfig gc = (XRGraphicsConfig) vImg.getGraphicsConfig();
56 ColorModel cm = gc.getColorModel();
57 long drawable = 0;
58 if (context instanceof Long) {
59 drawable = ((Long)context).longValue();
60 }
61 sData = XRSurfaceData.createData(gc,
62 vImg.getWidth(),
63 vImg.getHeight(),
64 cm, vImg, drawable,
65 vImg.getTransparency(), false);
66 } catch (NullPointerException ex) {
67 sData = null;
68 } catch (OutOfMemoryError er) {
69 sData = null;
70 }
71
72 return sData;
73 }
74
75 /**
76 * XRender should allow copies between different formats and depths.
77 * TODO: verify that this assumption is correct.
78 */
79 protected boolean isConfigValid(GraphicsConfiguration gc) {
80 return true;
81 }
82
83 /**
84 * Need to override the default behavior because Pixmaps-based
85 * images are accelerated but not volatile.
|