// ignore
}
}
WritableRaster raster = bi.getRaster();
DataBufferInt buffer = (DataBufferInt) raster.getDataBuffer();
ThemeReader.paintBackground(buffer.getData(),
part.getControlName(c), part.getValue(),
TMSchema.State.getValue(part, state),
0, 0, w, h, w);
if (sm.getClass().getName().equals("sun.awt.image.CachingSurfaceManager")) {
try {
boolean oldAccEnabled = (Boolean) ReflectionUtils.callGet(sm, "isLocalAccelerationEnabled");
if (accEnabled != oldAccEnabled) {
ReflectionUtils.callSet(sm, "setLocalAccelerationEnabled", accEnabled);
ReflectionUtils.call(sm, "rasterChanged");
}
}
catch (Exception e) {
// ignore
}
}
}
else { // copied from JDK7 XPStyle. To make the code compilable under JDk6, we use RefectionUtils
boolean accEnabled = false;
Skin skin = (Skin) args[0];
Part part = skin.part;
State state = (State) args[1];
if (state == null) {
state = skin.state;
}
if (c == null) {
c = skin.component;
}
BufferedImage bi = (BufferedImage) image;
WritableRaster raster = bi.getRaster();
DataBufferInt dbi = (DataBufferInt) raster.getDataBuffer();
// Note that stealData() requires a markDirty() afterwards
// since we modify the data in it.
try {
ThemeReader.paintBackground(
(int[]) ReflectionUtils.callStatic(SunWritableRaster.class, "stealData", new Class[]{DataBufferInt.class, int.class}, new Object[]{dbi, 0}),