From b3e4bb0347eeb9d3276178c99ad829e870cc5451 Mon Sep 17 00:00:00 2001 From: Scott Gilbertson Date: Fri, 5 Dec 2003 22:10:16 +0000 Subject: GC.java (updateClip): Added rectangles argument. 2003-12-05 Scott Gilbertson * 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 --- libjava/ChangeLog | 13 +++++++++++-- libjava/gnu/gcj/xlib/GC.java | 10 +++++----- libjava/gnu/gcj/xlib/natGC.cc | 24 ++++++++++++++++-------- 3 files changed, 32 insertions(+), 15 deletions(-) (limited to 'libjava') diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 5a3de58..74c4099 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,12 @@ +2003-12-05 Scott Gilbertson + + * 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 * 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 +2003-07-24 H. Väisänen * 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. -2003­03-28 Michael Koch +2003­03-28 Michael Koch * 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 24cd3bd..da427c9 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 17bcbe6..3819da4 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; ix; + 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, -- cgit v1.1