public SurfaceData getSourceSurfaceData(Image img,
int txtype,
CompositeType comp,
Color bgColor)
{
SurfaceManager srcMgr = SurfaceManager.getManager(img);
SurfaceData srcData = srcMgr.getPrimarySurfaceData();
if (img.getAccelerationPriority() > 0.0f &&
blitProxyKey != null)
{
SurfaceDataProxy sdp =
(SurfaceDataProxy) srcMgr.getCacheData(blitProxyKey);
if (sdp == null || !sdp.isValid()) {
if (srcData.getState() == State.UNTRACKABLE) {
sdp = SurfaceDataProxy.UNCACHED;
} else {
sdp = makeProxyFor(srcData);
}
srcMgr.setCacheData(blitProxyKey, sdp);
}
srcData = sdp.replaceData(srcData, txtype, comp, bgColor);
}
return srcData;
}