}
protected SurfaceData createAccelSurface() {
int transparency = vImg.getTransparency();
ColorModel cm;
Win32GraphicsConfig gc = (Win32GraphicsConfig) vImg.getGraphicsConfig();
if (transparency != Transparency.TRANSLUCENT) {
// REMIND: This will change when we accelerate bitmask VImages.
// Currently, we can only reach here if the image is either
// opaque or translucent
cm = getDeviceColorModel();
} else {
cm = gc.getColorModel(Transparency.TRANSLUCENT);
}
// createData will return null if the device doesnt support d3d surfaces
SurfaceData ret = null;
// avoid pulling in D3D classes unless d3d is enabled on the device
if (d3dAccelerationEnabled &&
((Win32GraphicsDevice)gc.getDevice()).isD3DEnabledOnDevice())
{
try {
ret =
D3DSurfaceData.createData(vImg.getWidth(), vImg.getHeight(),
D3DSurfaceData.D3D_PLAIN_SURFACE,