Commit 30ed0c45 by Bryce McKinlay Committed by Bryce McKinlay

PixelGrabber.java (grabPixels()): Call grabPixels(0).

	* java/awt/image/PixelGrabber.java (grabPixels()): Call grabPixels(0).
	* java/awt/image/PixelGrabber.java (grabPixels(long)): Wait to be
	notified that the ImageProducer has completed.

From-SVN: r49201
parent 70e531f5
2002-01-25 Bryce McKinlay <bryce@waitaki.otago.ac.nz> 2002-01-25 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
* java/lang/natObject.cc (X86 compare_and_swap): Use +m constraint. * java/lang/natObject.cc (X86 compare_and_swap): Use +m constraint.
* java/awt/image/PixelGrabber.java (grabPixels()): Call grabPixels(0).
* java/awt/image/PixelGrabber.java (grabPixels(long)): Wait to be
notified that the ImageProducer has completed.
2002-01-24 Per Bothner <per@bothner.com> 2002-01-24 Per Bothner <per@bothner.com>
......
...@@ -155,15 +155,7 @@ public class PixelGrabber implements ImageConsumer ...@@ -155,15 +155,7 @@ public class PixelGrabber implements ImageConsumer
*/ */
public boolean grabPixels() throws InterruptedException public boolean grabPixels() throws InterruptedException
{ {
startGrabbing(); return grabPixels(0);
while ( (status != ImageObserver.ALLBITS ) ||
(status != ImageObserver.ERROR ) ||
(status != ImageObserver.ABORT ) );
if( status == ImageObserver.ALLBITS )
return true;
else
return false;
} }
/** /**
...@@ -176,24 +168,17 @@ public class PixelGrabber implements ImageConsumer ...@@ -176,24 +168,17 @@ public class PixelGrabber implements ImageConsumer
*/ */
public synchronized boolean grabPixels(long ms) throws InterruptedException public synchronized boolean grabPixels(long ms) throws InterruptedException
{ {
long start = System.currentTimeMillis();
startGrabbing(); startGrabbing();
while ( (status != ImageObserver.ALLBITS ) ||
(status != ImageObserver.ERROR ) || if (ms < 0)
(status != ImageObserver.ABORT ) ) return (status == ImageObserver.ALLBITS);
{
if( (System.currentTimeMillis() - start ) >= ms ) wait(ms);
{
abortGrabbing(); if (status == ImageObserver.ALLBITS)
throw new InterruptedException();
}
}
if( status == ImageObserver.ALLBITS )
return true; return true;
else else
return false; return false;
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment