X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;ds=sidebyside;f=src%2Forg%2Fxwt%2Fplat%2FX11.java;h=925593b2af8a1b4c6662ce0b0cf9b1b19717109a;hb=8ca06b850fb51673a7cfe751643ea45ec528070d;hp=5f579e458bce9d1601cdf738f5f33446ad541a92;hpb=42da60bd167403eccc3466575772819007388cfd;p=org.ibex.core.git diff --git a/src/org/xwt/plat/X11.java b/src/org/xwt/plat/X11.java index 5f579e4..925593b 100644 --- a/src/org/xwt/plat/X11.java +++ b/src/org/xwt/plat/X11.java @@ -125,11 +125,10 @@ public class X11 extends POSIX { if (doublebuf != null) return; // no point in using a shared pixmap since we'll only write to this image once X11PixelBuffer b = new X11PixelBuffer(width, height, false); - b.drawPicture(this, 0, 0); + b.drawPicture(this, 0, 0, width, height, 0, 0, width, height); if (needsStipple) b.createStipple(this); doublebuf = b; } - } /** @@ -176,9 +175,8 @@ public class X11 extends POSIX { cliph = y2 - y; if (cliph < 0) cliph = 0; } - public void drawPicture(Picture source, int x, int y) { - drawPicture(source, x, y, x + source.getWidth(), y + source.getHeight(), 0, 0, source.getWidth(), source.getHeight()); - } + public native void drawPictureAlphaOnly(Picture source, int dx1, int dy1, int dx2, int dy2, + int sx1, int sy1, int sx2, int sy2, int rgb); public void drawPicture(Picture source, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2) { if (!(dx2 - dx1 != sx2 - sx1 || dy2 - dy1 != sy2 - sy1) && ((X11Picture)source).doublebuf != null) @@ -199,6 +197,19 @@ public class X11 extends POSIX { public native void fillRect(int x, int y, int x2, int y2, int color); public native void finalize(); + // FIXME: try to use os acceleration + public void fillTrapezoid(int x1, int x2, int y1, int x3, int x4, int y2, int argb) { + if (x1 == x3 && x2 == x4) { + fillRect(x1, y1, x4, y2, argb); + } else for(int y=y1; y _x2) { int _x0 = _x1; _x1 = _x2; _x2 = _x0; } + fillRect(_x1, _y1, _x2, _y2, argb); + } + } } }