if (pData == 0) {
return;
}
numBackBuffers = newNumBackBuffers;
SurfaceData oldData = surfaceData;
Win32GraphicsConfig gc =
(Win32GraphicsConfig)getGraphicsConfiguration();
surfaceData = gc.createSurfaceData(this, numBackBuffers);
if (oldData != null) {
oldData.invalidate();
// null out the old data to make it collected faster
oldData = null;
}
if (backBuffer != null) {
// this will remove the back buffer from the
// display change notification list
backBuffer.flush();
backBuffer = null;
}
if (numBackBuffers > 0) {
backBuffer = gc.createBackBuffer(this);
}
}
}
}