mirror of
https://github.com/openRuyi-Project/gcc.git
synced 2026-06-18 01:15:50 +00:00
e0441a5bfb
libjava/ 2008-06-28 Matthias Klose <doko@ubuntu.com> Import GNU Classpath (classpath-0_97_2-release). * Regenerate class and header files. * Regenerate auto* files. * gcj/javaprims.h: Define jobjectRefType. * jni.cc (_Jv_JNI_GetObjectRefType): New (stub only). (_Jv_JNIFunctions): Initialize GetObjectRefType. * gnu/classpath/jdwp/VMVirtualMachine.java, java/security/VMSecureRandom.java: Merge from classpath. * HACKING: Fix typo. * ChangeLog-2007: New file. * configure.ac: Set JAVAC, pass --disable-regen-headers to classpath. libjava/classpath/ 2008-06-28 Matthias Klose <doko@ubuntu.com> * m4/ac_prog_javac.m4: Disable check for JAVAC, when not configured with --enable-java-maintainer-mode. * aclocal.m4, configure: Regenerate. * native/jni/gstreamer-peer/Makefile.am: Do not link with libclasspathnative. * native/jni/gstreamer-peer/Makefile.in: Regenerate. * tools/Makefile.am, lib/Makefile.am: Use JAVAC for setting JCOMPILER, drop flags not understood by gcj. From-SVN: r137223
68 lines
1.4 KiB
Java
68 lines
1.4 KiB
Java
package gnu.java.awt.peer.x;
|
|
|
|
import gnu.x11.Display;
|
|
import gnu.x11.image.ZPixmap;
|
|
|
|
import java.awt.GraphicsEnvironment;
|
|
import java.awt.image.DataBuffer;
|
|
|
|
/**
|
|
* A DataBuffer implementation that is based on a ZPixmap. This is used
|
|
* as backing store for BufferedImages.
|
|
*/
|
|
class ZPixmapDataBuffer
|
|
extends DataBuffer
|
|
{
|
|
|
|
/**
|
|
* The backing ZPixmap.
|
|
*/
|
|
private ZPixmap zpixmap;
|
|
|
|
/**
|
|
* Creates a new ZPixmapDataBuffer with a specified width and height.
|
|
*
|
|
* @param d the X display
|
|
* @param w the width
|
|
* @param h the height
|
|
*/
|
|
ZPixmapDataBuffer(int w, int h)
|
|
{
|
|
super(TYPE_BYTE, w * h * 3); // TODO: Support non-24-bit-resolutions.
|
|
GraphicsEnvironment env =
|
|
GraphicsEnvironment.getLocalGraphicsEnvironment();
|
|
XGraphicsDevice dev = (XGraphicsDevice) env.getDefaultScreenDevice();
|
|
Display d = dev.getDisplay();
|
|
zpixmap = new ZPixmap(d, w, h, d.default_pixmap_format);
|
|
}
|
|
|
|
/**
|
|
* Creates a ZPixmapDataBuffer from an existing ZPixmap.
|
|
*
|
|
* @param zpixmap the ZPixmap to wrap
|
|
*/
|
|
ZPixmapDataBuffer(ZPixmap zpixmap)
|
|
{
|
|
super(TYPE_BYTE, zpixmap.get_data_length());
|
|
this.zpixmap = zpixmap;
|
|
}
|
|
|
|
@Override
|
|
public int getElem(int bank, int i)
|
|
{
|
|
return 0xff & zpixmap.get_data_element(i);
|
|
}
|
|
|
|
@Override
|
|
public void setElem(int bank, int i, int val)
|
|
{
|
|
zpixmap.set_data_element(i, (byte) val);
|
|
}
|
|
|
|
ZPixmap getZPixmap()
|
|
{
|
|
return zpixmap;
|
|
}
|
|
|
|
}
|