diff options
author | Scott Gilbertson <sgilbertson@gcc.gnu.org> | 2003-12-05 22:10:16 +0000 |
---|---|---|
committer | Scott Gilbertson <sgilbertson@gcc.gnu.org> | 2003-12-05 22:10:16 +0000 |
commit | b3e4bb0347eeb9d3276178c99ad829e870cc5451 (patch) | |
tree | d43341b19fb3c144239db46d91e3cd5c33056c61 | |
parent | 07a3c905b3608f7631f6e146b77fda01daddaea5 (diff) | |
download | gcc-b3e4bb0347eeb9d3276178c99ad829e870cc5451.tar.gz |
GC.java (updateClip): Added rectangles argument.
2003-12-05 Scott Gilbertson <scottg@mantatest.com>
* gnu/gcj/xlib/GC.java (updateClip): Added rectangles argument.
(clip): Removed field
(clipRectangles): New field.
(clone): Use new updateClip.
(setClipRectangles): Use new updateClip.
* gnu/gcj/xlib/natGC.cc (updateClip): Prepare passed rectangles.
From-SVN: r74348
-rw-r--r-- | libjava/ChangeLog | 13 | ||||
-rw-r--r-- | libjava/gnu/gcj/xlib/GC.java | 10 | ||||
-rw-r--r-- | libjava/gnu/gcj/xlib/natGC.cc | 24 |
3 files changed, 32 insertions, 15 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 5a3de583bf5..74c4099708a 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,12 @@ +2003-12-05 Scott Gilbertson <scottg@mantatest.com> + + * gnu/gcj/xlib/GC.java (updateClip): Added rectangles argument. + (clip): Removed field + (clipRectangles): New field. + (clone): Use new updateClip. + (setClipRectangles): Use new updateClip. + * gnu/gcj/xlib/natGC.cc (updateClip): Prepare passed rectangles. + 2003-12-04 Michael Koch <konqueror@gmx.de> * java/io/FilePermission.java: @@ -4145,7 +4154,7 @@ (_Jv_BytecodeVerifier): Initialize it. (~_Jv_BytecodeVerifier): Destroy ref_intersection objects. -2003-07-24 H. Väisänen <hvaisane@joyx.joensuu.fi> +2003-07-24 H. Väisänen <hvaisane@joyx.joensuu.fi> * java/text/SimpleDateFormat.java (format) [YEAR_FIELD]: Zero pad unless field size is 2. @@ -7232,7 +7241,7 @@ * java/io/ObjectOutputStream.java (PutField.put): Doesnt throws anything. -200303-28 Michael Koch <konqueror@gmx.de> +2003Â03-28 Michael Koch <konqueror@gmx.de> * java/io/FileOutputStream.java: Merged class documentation and authors with classpath. diff --git a/libjava/gnu/gcj/xlib/GC.java b/libjava/gnu/gcj/xlib/GC.java index 24cd3bd1f53..da427c9ab9d 100644 --- a/libjava/gnu/gcj/xlib/GC.java +++ b/libjava/gnu/gcj/xlib/GC.java @@ -45,7 +45,7 @@ public class GC implements Cloneable gcClone.structure = null; } gcClone.initStructure(this); - gcClone.updateClip(); + gcClone.updateClip(clipRectangles); return gcClone; } catch (CloneNotSupportedException ex) @@ -107,8 +107,8 @@ public class GC implements Cloneable */ public void setClipRectangles(Rectangle[] rectangles) { - clip = new Clip(rectangles); - updateClip(); + clipRectangles = rectangles; + updateClip(clipRectangles); } public native void drawString(String text, int x, int y); @@ -148,10 +148,10 @@ public class GC implements Cloneable return target; } - private native void updateClip(); + private native void updateClip(Rectangle[] rectangles); private Drawable target; private RawData structure; - private Clip clip; + private Rectangle[] clipRectangles; } diff --git a/libjava/gnu/gcj/xlib/natGC.cc b/libjava/gnu/gcj/xlib/natGC.cc index 17bcbe67b5a..3819da45005 100644 --- a/libjava/gnu/gcj/xlib/natGC.cc +++ b/libjava/gnu/gcj/xlib/natGC.cc @@ -217,25 +217,33 @@ void gnu::gcj::xlib::GC::putImage(XImage* image, // no fast fail } -void gnu::gcj::xlib::GC::updateClip() +void gnu::gcj::xlib::GC::updateClip(AWTRectArray* rectangles) { - if (clip == 0) - return; + int numRect = JvGetArrayLength(rectangles); + XRectVector* xrectvector = new XRectVector(numRect); + for (int i=0; i<numRect; i++) + { + AWTRect* awtrect = elements(rectangles)[i]; + XRectangle& xrect = (*xrectvector)[i]; + + xrect.x = awtrect->x; + xrect.y = awtrect->y; + xrect.width = awtrect->width; + xrect.height = awtrect->height; + } + Display* display = target->getDisplay(); ::Display* dpy = (::Display*) (display->display); ::GC gc = (::GC) structure; - - XRectVector* xrectvector = (XRectVector*) (clip->xrects); - int numRect = xrectvector->size(); - + int originX = 0; int originY = 0; int ordering = Unsorted; XSetClipRectangles(dpy, gc, originX, originY, &(xrectvector->front()), numRect, ordering); - // no fast fail + delete xrectvector; } void gnu::gcj::xlib::GC::copyArea (gnu::gcj::xlib::Drawable * source, |