Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/ikvm-fork.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--awt/converter.cs7
-rw-r--r--openjdk/sun/awt/image/ImageRepresentation.java21
2 files changed, 9 insertions, 19 deletions
diff --git a/awt/converter.cs b/awt/converter.cs
index d9fb0438..a0abf0cb 100644
--- a/awt/converter.cs
+++ b/awt/converter.cs
@@ -69,7 +69,12 @@ namespace ikvm.awt
{
sun.awt.image.ImageRepresentation ir = ((sun.awt.image.ToolkitImage)img).getImageRep();
// start the production and wait if not produce the image
- ir.reconstruct(java.awt.image.ImageObserver.__Fields.ALLBITS);
+ lock( ir ) {
+ ir.prepare(null);
+ while ( ir.getBufferedImage() == null ) {
+ ir.wait();
+ }
+ }
return ir.getBufferedImage().getBitmap();
}
if (img is NoImage)
diff --git a/openjdk/sun/awt/image/ImageRepresentation.java b/openjdk/sun/awt/image/ImageRepresentation.java
index 92771953..962d46e0 100644
--- a/openjdk/sun/awt/image/ImageRepresentation.java
+++ b/openjdk/sun/awt/image/ImageRepresentation.java
@@ -30,11 +30,8 @@ import java.awt.image.BufferedImage;
import java.awt.image.ColorModel;
import java.awt.image.ImageConsumer;
import java.awt.image.ImageObserver;
-import java.util.Arrays;
import java.util.Hashtable;
-import com.sun.jdi.InvalidStackFrameException;
-
import cli.System.Drawing.Bitmap;
import cli.System.Drawing.Imaging.BitmapData;
import cli.System.Drawing.Imaging.ImageLockMode;
@@ -328,10 +325,9 @@ public class ImageRepresentation extends ImageWatched implements ImageConsumer{
if (done) {
image.getSource().removeConsumer(this);
consuming = false;
-
- if (bimage == null) {
- bimage = new BufferedImage(getBitmapRef());
- }
+ }
+ if (bimage == null ) {
+ bimage = new BufferedImage(getBitmapRef());
}
availinfo |= info;
notifyAll();
@@ -422,15 +418,4 @@ public class ImageRepresentation extends ImageWatched implements ImageConsumer{
| ImageObserver.FRAMEBITS
| ImageObserver.ALLBITS);
}
-
- /**
- * Get the .NET Bitmap object.
- */
- @cli.IKVM.Attributes.HideFromJavaAttribute.Annotation
- public cli.System.Drawing.Bitmap getBitmap(){
- if( bitmap == null ){
- throw new IllegalStateException("Image not complete.");
- }
- return bitmap;
- }
}