// forces the rebinding when the drawable uses a frame buffer object
final boolean fbo = drawable.getChosenGLCapabilities().isFBO();
// texture already exists in OpenGL, just bind it if needed
if (!unitRecord.isValid() || unitRecord.boundTexture != textureId || fbo) {
checkAndSetUnit(i, record, caps);
gl.glBindTexture(getGLType(type), textureId);
if (Constants.stats) {
StatCollector.addStat(StatType.STAT_TEXTURE_BINDS, 1);
}
unitRecord.boundTexture = textureId;
}