if (d3dSurfaceType == D3D_TEXTURE_SURFACE) {
// for non-rtt textures we have only one surface type
return D3DTexture;
} else {
int pixelSize = cm.getPixelSize();
Win32GraphicsDevice gd = (Win32GraphicsDevice)gc.getDevice();
int transparency = cm.getTransparency();
// We'll attempt to use render-to-texture if render target is
// requested, but it's not a back-buffer and we support RTT
// for this configuration.
boolean useRTT =
((d3dSurfaceType & D3D_RENDER_TARGET) != 0) &&
((d3dSurfaceType & D3D_BACKBUFFER_SURFACE) == 0) &&
gd.getD3DContext().isRTTSupported();
// if there's no RTT available, we can't accelerate non-opaque
// surfaces, so we return null.
if (transparency == Transparency.TRANSLUCENT ||
transparency == Transparency.BITMASK)