harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apetre...@apache.org
Subject svn commit: r597432 - in /harmony/enhanced/classlib/trunk/modules/awt/src/main/java/unix/org/apache/harmony/awt/gl/linux: XBlitter.java XSurface.java
Date Thu, 22 Nov 2007 15:30:42 GMT
Author: apetrenko
Date: Thu Nov 22 07:30:41 2007
New Revision: 597432

URL: http://svn.apache.org/viewvc?rev=597432&view=rev
Log:
Patch for HARMONY-5070 "[classlib][swing] Harmony may throw 
NullPointerException in paintIcon"

Modified:
    harmony/enhanced/classlib/trunk/modules/awt/src/main/java/unix/org/apache/harmony/awt/gl/linux/XBlitter.java
    harmony/enhanced/classlib/trunk/modules/awt/src/main/java/unix/org/apache/harmony/awt/gl/linux/XSurface.java

Modified: harmony/enhanced/classlib/trunk/modules/awt/src/main/java/unix/org/apache/harmony/awt/gl/linux/XBlitter.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/unix/org/apache/harmony/awt/gl/linux/XBlitter.java?rev=597432&r1=597431&r2=597432&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/awt/src/main/java/unix/org/apache/harmony/awt/gl/linux/XBlitter.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/awt/src/main/java/unix/org/apache/harmony/awt/gl/linux/XBlitter.java
Thu Nov 22 07:30:41 2007
@@ -343,6 +343,19 @@
             Color bgcolor,
             MultiRectArea clip
     ) {
+
+        if(dstX < 0){
+            width += dstX;
+            dstX = 0;
+        }
+
+        if(dstY < 0){
+            height += dstY;
+            dstY = 0;
+        }
+
+        if(width <= 0 || height <= 0) return;
+
         XSurface xDstSurf = ((XSurface) dstSurf);
 
         boolean srcNoAlpha =

Modified: harmony/enhanced/classlib/trunk/modules/awt/src/main/java/unix/org/apache/harmony/awt/gl/linux/XSurface.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/unix/org/apache/harmony/awt/gl/linux/XSurface.java?rev=597432&r1=597431&r2=597432&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/awt/src/main/java/unix/org/apache/harmony/awt/gl/linux/XSurface.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/awt/src/main/java/unix/org/apache/harmony/awt/gl/linux/XSurface.java
Thu Nov 22 07:30:41 2007
@@ -62,24 +62,7 @@
     }
 
     void setRoi(Rectangle2D roi) {
-        if (roi.getX() < 0 || roi.getY() < 0) {
-            double x = roi.getX();
-            double y = roi.getY();
-            double width = roi.getWidth();
-            double height = (int) roi.getHeight();
-            if (x < 0) {
-                width += x;
-                x = 0;
-            }
-            if (y < 0) {
-                height += y;
-                y = 0;
-            }
-
-            this.roi = new Rectangle2D.Double(x, y, width, height);
-        } else {
-            this.roi = roi;
-        }
+        this.roi = roi;
     }
 
     public ColorModel getColorModel() {



Mime
View raw message