[kaffe] CVS kaffe (robilad): Resynced with gnu classpath: mediatracker fixes

Kaffe CVS cvs-commits at kaffe.org
Tue Apr 19 11:36:02 PDT 2005


PatchSet 5723 
Date: 2005/04/19 18:12:04
Author: robilad
Branch: HEAD
Tag: (none) 
Log:
Resynced with gnu classpath: mediatracker fixes

2005-04-19  Dalibor Topic  <robilad at kaffe.org>

        Resynced with GNU Classpath.

        2005-04-13  Roman Kennke  <roman at kennke.org>

        * java/awt/MediaTracker.java:
        Reindented tabs to spaces.

        2005-04-13  Roman Kennke  <roman at kennke.org>

        * java/awt/MediaTracker.java
        (MediaEntry.imageUpdate): Removed check for SOMEBITS, this
        confused the media tracker and lead to lockups. The LOADING
        bit is handled on other places.
        (addImage): Removed the 'start image tracking' stuff. This
        is not necessary and could confuse the media tracker.
        (checkAll): Improved the check for image status so that
        images that already complete images are detected. Also now
        are really all images checked and if necessary loaded. Before
        the method bailed out after the first incomplete image.
        (statusAll): Detect images that are complete after the
        call to Component.prepareImage(..).
        (checkID): The same as in checkAll.
        (statusID): The same as in statusAll.

Members: 
	libraries/javalib/java/awt/MediaTracker.java:1.17->1.18 
	ChangeLog:1.3890->1.3891 

Index: kaffe/libraries/javalib/java/awt/MediaTracker.java
diff -u kaffe/libraries/javalib/java/awt/MediaTracker.java:1.17 kaffe/libraries/javalib/java/awt/MediaTracker.java:1.18
--- kaffe/libraries/javalib/java/awt/MediaTracker.java:1.17	Tue Apr 19 18:04:43 2005
+++ kaffe/libraries/javalib/java/awt/MediaTracker.java	Tue Apr 19 18:12:04 2005
@@ -126,7 +126,7 @@
      * @see {@link java.awt.image.ImageObserver}
      */
     public boolean imageUpdate(Image img, int flags, int x, int y, 
-			       int width, int height)
+                               int width, int height)
     {
       if ((flags & ABORT) != 0)
         status = ABORTED;
@@ -134,13 +134,11 @@
         status = ERRORED;
       else if ((flags & ALLBITS) != 0)
         status = COMPLETE;
-      else if ((flags & SOMEBITS) != 0)
-        status = LOADING;
       else
         status = 0;
 
       synchronized (MediaTracker.this)
-	{
+        {
           MediaTracker.this.notifyAll();
         }
 
@@ -176,9 +174,6 @@
         e.next = head;
         head = e;
       }
-    // Start tracking image status.
-    int flags = target.checkImage(image, e);
-    e.imageUpdate(image, flags, -1, -1, -1, -1);
   }
 
   /**
@@ -203,9 +198,6 @@
         e.next = head;
         head = e;
       }
-    // Start tracking image status.
-    int flags = target.checkImage(image, width, height, e);
-    e.imageUpdate(image, flags, -1, -1, width, height);
   }
 
   /**
@@ -245,21 +237,23 @@
     
     while (e != null)
       {
-	if ((e.status & (COMPLETE | ERRORED | ABORTED)) == 0)
-	  {
-	    if (load)
-	      {
-		result = false;
-	        if (e.status == 0)
-		  {
-		    target.prepareImage(e.image, e);
-		    e.status = LOADING;
-		  }
-	      }
-	    else
-	      return false;
-	  }
-	e = e.next;
+        if ((e.status & (COMPLETE | ERRORED | ABORTED)) == 0)
+          {
+            if (load && ((e.status & LOADING) == 0))
+              {
+                e.status = LOADING;
+                result = false;
+                boolean complete = target.prepareImage(e.image, e);
+                if (complete)
+                  {
+                    e.status = COMPLETE;
+                    result = true;
+                  }
+              }
+            else
+              result = false;
+          }
+        e = e.next;
       }
     return result;
   }
@@ -278,7 +272,7 @@
     while (e != null)
       {
         if ((e.status & ERRORED) != 0)
-	  return true;
+          return true;
         e = e.next;
       }
     return false;
@@ -297,11 +291,11 @@
     while (e != null)
       {
         if ((e.status & ERRORED) != 0)
-	  {
-	    if (result == null)
-	      result = new ArrayList();
-	    result.add(e.image);
-	  }
+          {
+            if (result == null)
+              result = new ArrayList();
+            result.add(e.image);
+          }
         e = e.next;
       }
     if (result == null)
@@ -350,12 +344,12 @@
     synchronized (this)
     {
       while (result == false)
-	{
-	  wait(ms);
-	  result = checkAll(true);
-	  if ((System.currentTimeMillis() - start) > ms)
-	    break;
-	}
+        {
+          wait(ms);
+          result = checkAll(true);
+          if ((System.currentTimeMillis() - start) > ms)
+            break;
+        }
     }
 
     return result;
@@ -378,12 +372,15 @@
     while (e != null)
       {
         if (load && e.status == 0)
-	  {
-	    target.prepareImage(e.image, e);
-	    e.status = LOADING;
-	  }
+          {
+            boolean complete = target.prepareImage(e.image, e);
+            if (complete)
+              e.status = COMPLETE;
+            else
+              e.status = LOADING;
+          }
         result |= e.status;
-	e = e.next;
+        e = e.next;
       }
     return result;
   }
@@ -420,21 +417,23 @@
     
     while (e != null)
       {
-	if (e.id == id && ((e.status & (COMPLETE | ABORTED | ERRORED)) == 0))
-	  {
-	    if (load)
-	      {
-		result = false;
-	        if (e.status == 0)
-		  {
-		    target.prepareImage(e.image, e);
-		    e.status = LOADING;
-		  }
-	      }
-	    else
-	      return false;
-	  }
-	e = e.next;
+        if (e.id == id && ((e.status & (COMPLETE | ABORTED | ERRORED)) == 0))
+          {
+            if (load && ((e.status & LOADING) == 0))
+              {
+                e.status = LOADING;
+                result = false;
+                boolean complete = target.prepareImage(e.image, e);
+                if (complete)
+                  {
+                    e.status = COMPLETE;
+                    result = true;
+                  }
+              }
+            else
+              result = false;
+          }
+        e = e.next;
       }
     return result;
   }
@@ -454,7 +453,7 @@
     while (e != null)
       {
         if (e.id == id && ((e.status & ERRORED) != 0))
-	  return true;
+          return true;
         e = e.next;
       }
     return false;
@@ -476,11 +475,11 @@
     while (e != null)
       {
         if (e.id == id && ((e.status & ERRORED) != 0))
-	  {
-	    if (result == null)
-	      result = new ArrayList();
-	    result.add(e.image);
-	  }
+          {
+            if (result == null)
+              result = new ArrayList();
+            result.add(e.image);
+          }
         e = e.next;
       }
     if (result == null)
@@ -535,12 +534,12 @@
     synchronized (this)
     {
       while (result == false)
-	{
-	  wait(ms);
-	  result = checkID(id, true);
-	  if ((System.currentTimeMillis() - start) > ms)
-	    break;
-	}
+        {
+          wait(ms);
+          result = checkID(id, true);
+          if ((System.currentTimeMillis() - start) > ms)
+            break;
+        }
     }
 
     return result;
@@ -565,15 +564,18 @@
     while (e != null)
       {
         if (e.id == id)
-	  {
+          {
             if (load && e.status == 0)
-	      {
-		target.prepareImage(e.image, e);
-		e.status = LOADING;
-	      }
+              {
+                boolean complete = target.prepareImage(e.image, e);
+                if (complete)
+                  e.status = COMPLETE;
+                else
+                  e.status = LOADING;
+              }
             result |= e.status;
-	  }
-	e = e.next;
+          }
+        e = e.next;
       }
     return result;
   }
Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.3890 kaffe/ChangeLog:1.3891
--- kaffe/ChangeLog:1.3890	Tue Apr 19 18:08:03 2005
+++ kaffe/ChangeLog	Tue Apr 19 18:11:54 2005
@@ -2,6 +2,32 @@
 
         Resynced with GNU Classpath.
 
+	2005-04-13  Roman Kennke  <roman at kennke.org>
+
+        * java/awt/MediaTracker.java:
+        Reindented tabs to spaces.
+
+	2005-04-13  Roman Kennke  <roman at kennke.org>
+
+        * java/awt/MediaTracker.java
+        (MediaEntry.imageUpdate): Removed check for SOMEBITS, this
+        confused the media tracker and lead to lockups. The LOADING
+        bit is handled on other places.
+        (addImage): Removed the 'start image tracking' stuff. This
+        is not necessary and could confuse the media tracker.
+        (checkAll): Improved the check for image status so that
+        images that already complete images are detected. Also now
+        are really all images checked and if necessary loaded. Before
+        the method bailed out after the first incomplete image.
+        (statusAll): Detect images that are complete after the
+        call to Component.prepareImage(..).
+        (checkID): The same as in checkAll.
+        (statusID): The same as in statusAll.
+
+2005-04-19  Dalibor Topic  <robilad at kaffe.org>
+
+        Resynced with GNU Classpath.
+
 	2005-04-12  Roman Kennke  <roman at kennke.org>
 
         * javax/swing/plaf/basic/BasicMenuUI.java




More information about the kaffe mailing list